[squeak-dev] [Discussion] Creating message sends via anObject >>> #selector ?
frank-lesser at lesser-software.com
Thu Jun 13 14:21:52 UTC 2019
adding "syntactic sugar to Smalltalk is a bad idea", IMO.
first of all it covers only specific bkocks ( which are not bound to a
context ) - then in terms try to debug the newly added construct - more
complex IMO -
Finally it affects performance - since extra Objects have to be created & a
perform: is needed.
Von: Squeak-dev [mailto:squeak-dev-bounces at lists.squeakfoundation.org] Im
Auftrag von Marcel Taeumel
Gesendet: Donnerstag, 13. Juni 2019 15:57
An: Robert via Squeak-dev
Betreff: Re: [squeak-dev] [Discussion] Creating message sends via anObject
>>> #selector ?
thanks for sharing. :-) Yes, I am familiar with this work. It is really
interesting to see such ideas tackling the line between being language
extensions and libraries. Such HOM constructs change the appearance of
traditional Smalltalk code. Yet, I got used to passing blocks (and closures)
around --- which wasn't possible in Smalltalk-76 ... if I recall correctly.
One could still use instances of MessageSend to manage callbacks.
Am 13.06.2019 15:41:59 schrieb Francisco Garau <francisco.garau at gmail.com>:
Have you looked at the Higher Order Messaging from Marcel Weiher?
On 12 Jun 2019, at 14:31, Marcel Taeumel <marcel.taeumel at hpi.de> wrote:
One of our students was curious about whether the following expression could
be somehow improved:
someObjects collect: [:each | self convert: each].
I suppose that the main goal was to remove the brackets. Similar to the
existing symbol shortcut:
someObjects collect: #message.
Looking at all implementors of #value:, #cull: and alike, I suppose that a
more convenient creation of a MessageSend could tackle this case directly:
someObjects collect: self >>> #convert:.
This feels strange. :-) Very strange. But maybe it's just me. I don't see
the traditional [:each | ...] version as neither difficult to read nor
What do you think about adding the #>>> message to MessageSend for more
compact instantiation? Do you see other scenarios of interest? Would it be
just superfluous? Producing less readable code?
P.S.: #>>> would be close to #>>, which is implemented on Behavior to access
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev