Newbie Question about Symbols was: Re: [ENH] Lispy list functions

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Thu Sep 9 15:30:32 UTC 1999


On Thu, 9 Sep 1999, John-Reed Maffeo wrote:

> Why would this matter? I thought Symbols were a class of objects
> designed to be used for comparisons and that they had no special
> meaning outside of the context in which they were being used.

That's true, but ...

> Is there something about Symbols that I am missing?

.... I was talking about method selectors (which happen to be Symbols), not
Symbols in general. 

There is no difference in naming a method #head or #listHead - but it's
more likely the first is already used in some class. In Squeak 2.5, #head
is used by class HtmlDocument and the bunny in Wonderland has a head, too. 
If I had designed the list as a class, this really wouldn't matter,
because these messages would be sent only to instances of the list class.

But my lists are defined merely by protocol (the set of selectors an
object understands). I just made every object understand #listHead. So
this selector has to be unique and should not be redefined in some class
with a different meaning.

HTH
 /bert

> Bert Freudenberg wrote:
>  --- snip 
> > Also worth considering might be, as you others suggested, using #head and
> > #tail instead of my #listHead and #listTail. The problem with these
> > easier-to-type selectors is that there exist some classes already using
> > #head and it would surely be reasonable to have some WonderlandActor
> > equipped with a #tail ...
> --- snip





More information about the Squeak-dev mailing list