Keyword order in Smalltalk
Stephen Pope
stp at create.ucsb.edu
Wed Aug 11 22:39:54 UTC 1999
Hello all,
I was just talking to a colleague who's a Java programmer interested in
Smalltalk, and I could not come up with a meaningful example of when
keyword order really matters in a method body. (It can of course matter
in what order you compute the arguments in the calling method, in case
the preparation of one argument has side-effects that influence the
value of another method.)
Apart from the obvious faster method lookup, why *should* Smalltalk
treat two methods with the same keywords but different keyword order as
unique methods?
Exanmples:
Boolean ifTrue:ifFalse vs. ifFalse:ifTrue
Rectangle left:top:right:bottom vs left:right:bottom:top
Dictionary case:otherwise: vs. otherwise:case
Any ideas?
stp
--
Stephen Travis Pope -- http://www.create.ucsb.edu/~stp
stp at create.ucsb.edu -- stp9 at cornell.edu
More information about the Squeak-dev
mailing list
|