Why so few binary method selectors?

Joachim Durchholz joachim.durchholz at munich.netsurf.de
Mon Mar 22 06:03:45 UTC 1999


Iannis Zannos wrote:
> 
> Proposal for a binary method selector (somebody asked
> here to post our favorites:)
> 
> @ for at:  (access to collections elements by numerical index)

I like it. (Incidentally, I know of only one other language that
exploits @ being pronounced as "at".)
Is it correct that you can use at: only for numeric indices? I'd like to
use it for keys as well...

> @@ for wrapAt: (index access wrapping back to 0 for indices
> beyond the size of the accessed arrayed collection. ) .

The wrapping process is not really part of the indexing IMHO. The idiom
of wrapping around isn't really common. So I don't see a reason to
include this; I think in this case the overhead to learn the symbol
outweighs the benefits.
YMMV of course...

Regards,
Joachim
-- 
Please don't send unsolicited ads.





More information about the Squeak-dev mailing list