Yet another namespace proposal (was Re: Quick comparison of two Namespaces proposals)

Jason Johnson jason.johnson.081 at gmail.com
Wed Oct 3 21:41:34 UTC 2007


Ok, I've stated my reasons why I don't like Göran's approach, now time
to give a suggestion myself:

What if namespaces were just objects that behave like dictionaries
with the key being a string and value being a meta-class?

They could be used as in:

Seaside at: #Component

or perhaps with a special shorthand:

Seaside Component   "maybe Component needs a #?"

This way it is just an object like everything else, with full
reflection and everything else we love about Smalltalk.  The only
issue is that this is a pure runtime lookup.  We would probably like
to have at least the option of it being compile time.

No problem, we just need my other previous proposal:  Macros. :)  Then
you can make the namespace lookup at compile time with:

##(Seaside at: #Component)

or:

##(Seaside Component)

So what do you all think? :)

P.S.  Oh yea, I didn't say anything about imports etc.  Well, I
haven't thought about that part yet. :)  Maybe a later email.  :)



More information about the Squeak-dev mailing list