Skip to content

Conversation

@elbeno
Copy link
Contributor

@elbeno elbeno commented Sep 23, 2025

Problem:

  • Function call is asymmetric: it allows many arguments, but only one return value.
  • Higher-order asynchronous functions like async::then deal with calling multiple functions and forwarding multiple results; they don't have any building-blocks to work with.

Solution:

  • Add call_by_need which, given a tuple of functions and a tuple of arguments, calls the functions as is possible, returning their results and passing on any unused arguments.

@elbeno elbeno force-pushed the call-by-need branch 2 times, most recently from 7086d55 to a4afd05 Compare September 23, 2025 22:50
@elbeno elbeno marked this pull request as draft September 24, 2025 16:21
@elbeno elbeno marked this pull request as ready for review September 24, 2025 17:10
@elbeno elbeno force-pushed the call-by-need branch 4 times, most recently from fa15e63 to f2241c1 Compare September 29, 2025 16:34
Problem:
- Function call is asymmetric: it allows many arguments, but only one return value.
- Higher-order asynchronous functions like `async::then` deal with calling
  multiple functions and forwarding multiple results; they don't have any
  building-blocks to work with.

Solution:
- Add `call_by_need` which, given a tuple of functions and a tuple of arguments,
  calls the functions as is possible, returning their results and passing on any
  unused arguments.
Copy link
Contributor

@mjcaisse-intel mjcaisse-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking forward to the sender!

@elbeno elbeno merged commit 316da30 into intel:main Sep 30, 2025
48 checks passed
@elbeno elbeno deleted the call-by-need branch October 16, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants