With conditional sends #1273, we maybe need the concept of an optional receive action.
The idea would be that if there is no message to receive, instead of the result being an error, the result is nil. This is for the case where the user knows that it is possible for there to be no message (perhaps from merging two things where the existence of one might depend on something in the message).
This is analogous to how m["x"] produces nil in the case where a m m has no field "x". Just as in this case, if the compiler determines that there will always be a message receivable, then nil would not be in the type of the expression.
A tool that generated a dataflow graph might generate optional receive actions by default.
With conditional sends #1273, we maybe need the concept of an optional receive action.
The idea would be that if there is no message to receive, instead of the result being an error, the result is nil. This is for the case where the user knows that it is possible for there to be no message (perhaps from merging two things where the existence of one might depend on something in the message).
This is analogous to how
m["x"]
produces nil in the case where a mm
has no field"x"
. Just as in this case, if the compiler determines that there will always be a message receivable, then nil would not be in the type of the expression.A tool that generated a dataflow graph might generate optional receive actions by default.