[Cuis-dev] Methods that return multiple values
Stephen Travis Pope
stephen at heaveneverywhere.com
Wed Jun 21 16:55:37 PDT 2023
Hi all,
Back in the ‘70s when I programmed LISP machines (before getting access to Smalltalk), multi-value return was most frequently used to return a value and an “condition” flag.
I’ve done something similar in Smalltalk apps where you have a global weak dictionary (like DependentsFields) for the conditions associated with a specific object (or with a context). This way, a calling method can process the return value and then (optionally) look at the return condition.
stp
--------
Stephen Travis Pope Ojai, California, USA

http://HeavenEverywhere.com
http://FASTLabInc.com
https://vimeo.com/user19434036/videos
http://heaveneverywhere.com/Reflections
> On Jun 21, 2023, at 7:44 AM, Christian Haider via Cuis-dev <cuis-dev at lists.cuis.st> wrote:
>
> Yes, it is a simple destructuring. The real thing I saw in Lisp was able to destruct lists of lists of lists ...
> Here it is the simple case for flat lists.
>
> When I came across this, I asked in the vwnc list about the name. My proposal was something like #destuctDo:.
> Other good names were #allIn: (which is implemented in Amber) or #in:.
> Vanessa Freudenberg came up with #asArgumentsIn: which I adapted, because it names exactly what it does.
> The other names are nice and short, but not distinctive enough for my taste.
> I have a hunch that there is a better name out there, but it has not been found yet.
>
>
> -----Ursprüngliche Nachricht-----
> Von: Cuis-dev <cuis-dev-bounces at lists.cuis.st> Im Auftrag von Mariano Montone via Cuis-dev
> Gesendet: Mittwoch, 21. Juni 2023 15:54
> An: Discussion of Cuis Smalltalk <cuis-dev at lists.cuis.st>
> Cc: Mariano Montone <marianomontone at gmail.com>; Luciano Notarfrancesco <luchiano at gmail.com>
> Betreff: Re: [Cuis-dev] Methods that return multiple values
>
> El 21/6/23 a las 10:44, Luciano Notarfrancesco via Cuis-dev escribió:
>> Interesting, thanks for sharing!
>> Actually I think it’s the same thing I did
>
> Yes, I think you've implemented destructuring rather than multiple-value return, as your solution can be applied to other things than method call returns.
>
> This is something nice to have, makes code more readable.
>
>
> Mariano
>
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230621/b8e7bb21/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedGraphic.tiff
Type: image/tiff
Size: 2442 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230621/b8e7bb21/attachment.tiff>
More information about the Cuis-dev
mailing list