Incongruent hash

Ian Bicking bickiia at earlham.edu
Thu Feb 12 15:19:42 UTC 1998


All this talk of Points has reminded me of a oddity with Points that I
think I understand now.

I wanted to implement a to:do: method for Point that would go through
all the integer points inside the rectangle defined by the two
corners.  I was doing this a lot in my programming, and to:do: seemed
like the best way to name this method.  So, I wrote it up and it would
never work.  It went through the points in an order like 3 at 6, 4 at 7,
5 at 8, etc.  Eventually I renamed my method toPoint:do: and it worked.
I didn't understand why at that time, but feeling frustrated and
annoyed I left it alone.

Now, I'm supposing it's because to:do: is inlined, and 3 at 6+1=4 at 7.  Is
it at all possible to make a sensible to:do: method for Points?  The
current one is just weird, and it would be better to just signal an
error, I think.  Is the to:do: inlining impossible to get around?

In a way, I think this is an argument that allowing forms like 3 at 6+1
isn't sensible, both because the result is surprising (and can be
confusing, making errors harder to track down), and because
conceptually someNumber+aNumber is completely unlike
(x+aNumber)@(y+aNumber).

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|| Ian Bicking                 |  bickiia at earlham.edu ||
|| drawer #419 Earlham College |  (765) 973-2537      ||
|| Richmond, IN 47374          |                      ||
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --





More information about the Squeak-dev mailing list