Namespaces (was: Re: [ANN]A plan for 3.8/4.0...
andreas.raab at gmx.de
Fri Apr 2 00:14:59 UTC 2004
> Right, after having looked at your code I realized that. But
> Squeak::Object subclass: #'Tweak::Object'
> would work at least, right?
Well, not in the way I wanted it to ;-) I really hate the idea of writing
this kind of stuff unless I'm forced to...
> > self import: A::Foo as: #Foo.
> > self import: A::Bar as: #Bar.
> > self import: A::Mumble as: #Mumble.
> Convinced, I think. But namespaces are hierarchical, right?
They could be but I'm not convinced they should automatically provide access
to all of the names from their parent space. I see hierarchies here as an
organization principle not a mechanism for composition.
> So you can still reference objects in your parent namespace without
> qualifying them? Since surely we won't be constantly using
> (Squeak::Array new: 10), etc.
We could easily solve that problem by having
self import: Squeak::Object as: #Object
self import: Squeak::Array as: #Array
being executed when we create a namespace.
> > Sent it in another mail already. Oh, and do you realize that the
> > same "naming scheme" can be applied to selectors? Say having message
> > Foo::bar vs. Mumble::bar ;-)
> Yup, I mentioned that earlier. But since there's no equivalent to
> #bindingOf: for selectors, that's less immediately useful.
Sure there is - it's called Symbol>>hasInterned:ifTrue: ;-)
More information about the Squeak-dev