[Cuis-dev] Methods that return multiple values
Luciano Notarfrancesco
luchiano at gmail.com
Wed Jun 21 07:34:16 PDT 2023
Yes, I do that sometimes, but in general I avoid creating extra classes,
and in my math project I make an extra effort to avoid creating new classes
for objects that are neither algebraic structures nor morphisms or elements
of algebraic structures (since usually those things are software
engineering artifacts and not actual mathematical things). Also, it doesn’t
simplify the use of the multiple returned values if I still have to send
messages to this new object to obtain them and assign them to variables. I
like the json objects that they have in Bee, tho, they can be very handy
sometimes.
On Wed, 21 Jun 2023 at 15:59 Nicolás Papagna Maldonado <
nicolas.papagna at gmail.com> wrote:
> Interesting!
>
> For multiple-value returns, how about an object holding these values?
> I know this might introduce many of these tiny objects, but I'm okay with
> that!
>
> IIRC Leandro implemented a feature in Bee where you can return anonymous
> objects.
> Something along the lines of {foo: 1, bar:2}. Then you can do `result
> foo`, etc.
>
> I'm more on keeping the syntax simple camp, but that is an interesting
> idea too.
>
> Cheers,
> Nico PM
>
> On Wed, Jun 21, 2023 at 10:54 AM Mariano Montone via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> 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
>>
>
>
> --
>
> Nicolás Papagna
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230621/726241ce/attachment.htm>
More information about the Cuis-dev
mailing list