Re: Name-space proposal

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

Bernie Ryan wrote:
> 
> Anybody:
> 
> If name-space worked in this way it would solve a lot of problems.
> 
> If a program contains a function foo()in the local main file and another
> file is included containing a foo() function. The interpeter would not
> stop but continue using the foo() function in the local main file.
> 
> When the program ends; the program would issue a warning that there
> is a duplicate function foo() exists in include file xxx.e just
> as it lists unused constants etc.
> 
> This would eliminate breaking code and allow debugging.
> There could also be a special flag Example: with_out_name_space
> to turn this on/off 

Except for the warnings, this sounds exactly like how it works now.
Here's how I tested this (maybe you can change it to cause the problem
you're having, since I suspect that it just wasn't clear what you meant):

file bar.ex:
--- begin file
include foo.e as Foo

global procedure foo(sequence foo)
	printf(1, "%s: bar.ex\n", {foo} )
end procedure

Foo:foo("foo")
foo("bar")
--- end file


file foo.e:
--- begin file
global procedure foo( sequence foo)
	printf(1, "%s: foo.e\n", {foo})
end procedure
--- end file


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

Search



Quick Links

User menu

Not signed in.

Misc Menu