Re: ver 4 and ver 3.11 function name conflicts

new topic     » goto parent     » topic index » view thread      » older message » newer message
jeremy said...
euphoric said...
jeremy said...
euphoric said...

Is the "default namespace" for a file the filename sans extension? or is it otherwise defined?

There is no automatic default namespace...

When you created your example, you used map:xxx and regex:xxx. Where did those namespaces come from? I didn't see them defined in the sample program (reproduced below), as you did with "include get.e as old_get."

include std/map.e  
include std/regex.e  
include get.e as old_get  
  
map m = map:new()  
regex r = regex:new()  
? old_get:get()  
? map:get(m, "name")  

It came from inside of std/regex.e and std/map.e ... they contain 1 line of code that looks like:

namespace map 
-- or -- 
namespace regex 

What I meant by automatic is a file w/o a namespace keyword does not get a default namespace assigned to it. The programmer of map.e must decide that a default namespace would be handy and issue a default namespace him/herself.

Jeremy

In other words every time I write a program I do all this extra work
of typing a foo:get()

That stinks !

Now you have functions with same name all over the place even in the same
directory.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu