Re: init.e - standard library candidate

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...
ghaberek said...

I had no idea that initializer values were called inline, which is what seems to make this magic work.

Yes:

-- foo.ex 
include foo.e 
procedure bar() 
 
end procedure 
foo( "bar" ) 
 
-- foo.e 
 
export procedure foo( sequence name, integer rid = routine_id( name ) ) 
	? rid 
end procedure 

$ eui foo.ex 
0 

Success!

Matt

I suspect this is simply broken. What should the following do?

somefile.e

constant A="1" 
 
global procedure putsomething(sequence s=A) 
    puts(1,s) 
end procedure 

someotherfile.exw

include somefile.e 
constant A="2" 
putsomething() 
if getc(0) then end if 

I'm quite happy that it prints 1, but that is not what was said, and routine_id is breaking scope by working...

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu