Namespaces (was: Re: [ANN]A plan for 3.8/4.0...
(insertdrumrollhere))
Avi Bryant
avi at beta4.com
Fri Apr 2 00:24:35 UTC 2004
On Apr 1, 2004, at 4:14 PM, Andreas Raab wrote:
>> 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
> ...
And if a new class is added to the base, you have to reimport #Squeak?
Ok, fair enough.
>> 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: ;-)
Well, ok, if we refactor the Compiler to use
Class>>hasInternedSymbol:ifTrue: ...
Isn't that then a more general namespace mechanism than #bindingOf:? A
"namespace" just becomes a mapping from short names to fully qualified
symbols, which are then either encoded as literals (for selectors), or
looked up in Smalltalk (for globals).
More information about the Squeak-dev
mailing list
|