I have been away from smalltalk coding for a while. On returning to the fold, I often see the use of a right arrow in code. Is this something new?
Today in a Teapot app example, I saw,
Teapot on GET: '/welcome' -> 'Hello World!'; start.
What is the arrow for?
As Sebastian said, #-> is a message that creates an
Association, with the receiver as the key and the argument as the
value of the Association. This has actually been around a very
long time, though perhaps it's getting more widely used these
days. It doesn't appear to be in the Blue Book, but I think it was
probably actually in the Smalltalk-80 image 1 release.
I'm not *quite* curious enough to verify that by rooting around in my basement for the machine that actually runs that version and seeing if it will still power up after all these years. :-)
Regards,
-Martin
Free forum by Nabble | Edit this page |