Incongruent hash (really: using #, for building Points)

Mike Klein mike at twinsun.com
Fri Feb 13 19:26:08 UTC 1998


> Wait a minute H-M! First, this is a violation of the semantics of "," meaning
> concatenation (as in strings). I tried to use "+" for string concatenation a
> number of years ago and was convinced (at the time) by Peter Deutsch that this
> was very poor style.

I'm curious what his argument went like.  Since selectors are all in
a "global" symbol table, polysemous selectors (homographs) seem inevitable.
Is it an ideal to strive for that all message names have a single meaning?

The + operator on SequenceableCollections is associative;
empty collections are left & right identity elements;
too bad there are no inverses.  Hmm, anti-characters...
('pasta' + 'antipasta' ) = ''

Seriously, Problems for using #,

Let's say 4,5 evaluates to some tuple: (4,5)
Is this tuple a SequenceableCollection?  thus inheriting traditional #,
is   |x| x:=(4,5). x,6    equal to (4,5,6)? ((4,5),6)?  (4,(5,6))?
is 4 equal to (4)?   (That is a N-tuple where N=1)
What about the 0-Tuple?

> If we're going to differentiate between tuples, 2-D vectors, and points, let's
> use more distinct notations for them. How about  a => b  or  #{a b}  or  a _ b 
> ?

Since Squeak is already in left field mapping 95 asCharacter to _
(backarrow) rather than underscore like the rest of the world
(outside of museums) (thus making 'a _ b' a real hard option to choose)
Let's go all the way.  Invent a new glyph.  Of course, along this path
lead madness... (or something cool...)

-- Mike Klein





More information about the Squeak-dev mailing list