RE: Revised Namespace Proposal

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

On 10 Jul 2001, at 16:36, Gilbert Lemaitre wrote:


> 
> 
> Robert Craig wrote:
> > I read through the suggestions that people put forward
> > last week regarding the namespace issue, ...
> > If anyone can see a simple way to improve ...
> > please post it to this list. ...
> >    Rob Craig

Some of these namespace suggestions are really getting confusing to me. 
How about a simple assignment, local to the file the assignment is made?

win. = include { "win32lib.ew","-abs"}
win. = include {"e:/math/eu libs/intmath.ew","abs"}

That would drop intmath's abs() into my code in place of win32lib's abs(), for 
whatever reason i haven't thought of yet.

win. = include { "win32lib.ew","-abs"}
int. = include {
  {"e:/math/eu libs/intmath.ew","abs"},
  {"d:/graphics/vectormath.ew","3d.distance.*"}
}
str. = include {
    {"d:/euphoria/string libs/strtok.ew"},
    {"d:/euphoria/string libs/strings.ew","left","right","mid"},
    {"d:/euphoria/string libs/strmath.ew","abs","add","divide"}
}

So i don't have the "attempt to redefine abs()" error, 
and all the string code i included would all be seen as

str.mid() -- from strings.ew
str.right() -- from strings.ew
str.parse() -- from strtoks
str.gettok() -- from strtoks
int.abs() -- from intmath.ew, not win32lib
str.abs() -- from strmath.ew 

but in my program only, no passing of my namespaces happens for 
programs that include my file, unless i provide a "global functioname()".

Kat

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

Search



Quick Links

User menu

Not signed in.

Misc Menu