Elektrine lite

← Feed

@foonathan@fosstodon.org

Post #3613083

2025-12-29 16:47 UTC

@zwarich@hachyderm.io @dotstdy@mastodon.social @ianh@mastodon.social @joe@f.duriansoftware.com Related, but why isn't first class multiple return values a thing more often? For example, the C++26 standard library has senders/receivers which essentially work via continuations, so you can write async functions that take N inputs and M outputs natively without resorting to tuples. You can even send outputs of different types without having to box them into a sum type (because they just statically dispatch to different overloads).

Replies (1)

  • @zwarich@hachyderm.io 2025-12-29 18:17

    @foonathan@fosstodon.org @dotstdy@mastodon.social @ianh@mastodon.social @joe@f.duriansoftware.com My guess has always been that first-class multiple return values are overlooked because tuples serve their use case fairly well. When I think of use cases for them, my mind always goes to alternate ABIs like returning bools in status flags, etc.

    Open ##3613082