[squeak-dev] The Trunk: Collections-ct.982.mcz

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Sun Jan 30 19:23:12 UTC 2022


We already had a similar thread some time ago, see "zöglfrex": http://forum.world.st/collect-thenDo-woes-td5103635.html :-)

By the way, the idea is not completely new; for instance, JS Lodash has a chain() function too: https://lodash.com/docs/#chain

Do we want support in the Trunk for this? It is an intereesting concept but changes the semantics of messaging significantly.

Best,
Christoph

---
Sent from Squeak Inbox Talk

On 2022-01-30T19:41:46+01:00, das.linux at gmx.de wrote:

> Hi
> 
> > On 30. Jan 2022, at 19:23, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> > 
> > On Sun, 30 Jan 2022, Tobias Pape wrote:
> > 
> >> 
> >> That's just HOM with additional hops, right? ;D
> >> -t
> > 
> > Never heard about HOM. I assume you meant Higher order message[1].
> > In that case, ChainedObjectWrapper is similar but different: it only adds one selector to Object, #wrap:, which is only there for convenience. It could be a class-side method of ChainedObjectWrapper.
> > 
> > While HOM either adds all those selectors with one less argument to all those classes, e.g #select to everything that implements #select:, or it implements #doesNotUnderstand: on Object.
> > Both options have unpleasant side-effects.
> > 
> > Another difference is the purpose. The idea here is to turn cascaded messages sent to the wrapper into chained message sends to the wrapped object inside a single block. So that you don't feel like implementing #select:thenCollect:andFinallyReject: and friends.
> 
> 
> But why half the cake when we can have it whole?
> @Marcel, did you have a Squeak impl back in 2005 or later of it?
> 
> Best regards
>     -Tobias
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220130/1efdcb24/attachment.html>


More information about the Squeak-dev mailing list