[Prev][Next][Index][Thread]

Re: multi-level namespaces?



I guess nobody prevents you from defining your
libraries named as org/hoult/Sorting for example.

And remember that you can rename modules on import
just as identifiers.

I do not like the idea of having hierarchical
namespaces (in Dylan) per se, but you could surely
write a macro that expands like define library but
enforces some naming convention by name pasting. Of
course you would need to load your custom macro with
define library first :-(

	Gabor

--- Bruce Hoult <bruce@hoult.org> wrote:
> I'm wondering if anyone can explain the reasons for
> the two-level 
> library/module affair in Dylan.
> 
> I understand the protection and rganizational
> reasons for having two 
> levels not one and think that it woks pretty well,
> but I'm wondering why 
> there aren't *more* levels.
> 
> One of the few things that I find I like about Java
> is that it has a 
> reasonable solution for making library names
> globally unique.  If I call 
> my favourite sorting library "org.hoult.Sorting"
> then I *know* that it's 
> not going to collide with anyone else's sort library
> [1].
> 
> It seems to me that something similar would be
> useful for Dylan.
> 
> The question is, should this be enshrined in the
> language syntax with 
> additional layers of library nesting (and possibly
> runtime introspection 
> of the structure of libraries), or would it be
> better handled by a mere 
> lexical convention of people simply happening to
> name their libraries 
> that way?
> 
> e.g.
> 
> define library org.hoult.Sorting
>    use dylan;
> end library;
> 
> etc
> 
> 
> -- Bruce
> 
> 
> 
> [1] assuming they follow the rules, that is.  But
> that's true of all 
> programming language protection mechanisms --
> they're to prevent 
> accident, not terrorism.
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/


References: