Possible pseudo-bug in perform: ???
Robert M. Fuhrer
rfuhrer at watson.ibm.com
Tue Sep 21 18:38:15 UTC 1999
[Pardon if any of this is newbie-speak...]
Evaluate the following code fragment:
(1 to: 10) perform: #at:
I get the exception: "SmallIntegers are not indexable", which is misleading.
[N.B.: Of course, the above is an invalid expression -- the #at: message
requires an argument. A well-formed #at: message would look like:
(1 to: 10) perform: #at: with: someIndex
I got into this trouble when toying around with PluggableListMorph
before I understood how getListSelector is used.]
It seems the exception arises because Interval>>at: receives the symbol #at:
as its only argument, anInteger (since in fact no argument was passed
in). One thing leads to another, and...
I would have expected it to say something more like: "perform: this
selector requires additional arguments".
I can imagine that sanity checking like this might be bypassed for
performance reasons, but it comes at the cost of leaving the user
tracing through odd parts of the system.
--------------------------------
Robert M. Fuhrer 34-231 (914) 945-3830
IBM T. J. Watson Research Center rfuhrer at watson.ibm.com
Yorktown Heights, NY 10598 PGP Public Key available on request
More information about the Squeak-dev
mailing list
|