Re: [phix] How does namespacing work?

new topic     » goto parent     » topic index » view thread      » older message » newer message
_tom said...
namespace m 
include builtins/map.e 
 
map x = new() 
put( x, "one",  1000 ) 
? m:get(x, "one" ) 
 
/* 

? m:get(x, "one" ) 
    ^ undefined identifier get 
*/ 

map.e defines its own namespace, "map."

I wonder if map.e didn't define its own namespace, would adopt "m" as its namespace. Certainly not! That would not be expected behavior... would it?

namespace m 
include builtins/map.e 
 
map x = new() 
put( x, "one",  1000 ) 
? map:get(x, "one" ) 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu