Incongruent hash

Andreas Raab raab at isgnw.cs.Uni-Magdeburg.DE
Wed Feb 11 19:21:42 UTC 1998


David,

> How about consideingr Point to be a Smalltalk-ism and not related to a 2D
> Vector, mainly because of the tradition of its definition. It really just
> defines an x coordinate and a y coordinate, to which have been added
> various methods which don't quite fit.

You're right. In a certain sense, class Point is quite Smalltalk specific.
But I think part of the problem comes from the fact that a number of
people (including me) tend to use Point as a 2d vector. And why shouldn't
they?! Is there any good reason for Point not to be a 2d-vector? This is
a serious question - I haven't seen any method yet which really needs the
special Smalltalk behaviour of Point.

> One thing that has always bugged me is the notation x at y. X is not AT y.

I'm no native speaker - I shouldn't comment on this ;-) But my
understanding for x at y was matrix notation where you can say "column x AT
row y". Not that it would make sense for arbitrary numbers such as floats...
Maybe one should treat Point more like 2d index into an array. This would
mean it contains only integer values (might even give a speed up to the
VM) and it can define an arbitrary sort order and special index
operations (such that "0 at 0 + 1 = 1 at 1"). But I wouldn't call it a Point.
How's that?

> We'd need another notation for forming vectors and the only thing that
> comes to mind offhand is -> which is as bad, but at least it looks like a
> vector, sort of.

Since a vector is a k-dimensional object I would rather make it a subclass
of SequenceableCollection. And why not using #(1 2) asVector?

Andreas
-- 
Linear algebra is your friend - Trigonometry is your enemy.
+===== Andreas Raab ============= (raab at isg.cs.uni-magdeburg.de) =====+
I Department of Simulation and Graphics      Phone: +49 391 671 8065  I
I University of Magdeburg, Germany           Fax:   +49 391 671 1164  I
+=============< http://isgwww.cs.uni-magdeburg.de/~raab >=============+





More information about the Squeak-dev mailing list