Re: ver 4 and ver 3.11 function name conflicts
- Posted by jeremy (admin) Sep 03, 2008
- 1027 views
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