-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Just a quick note-to-self for future implementation.
It wouldn't be that hard to implement capture-by-reference semantics as supported by C++. Such vars would be specified in the capture list as &a, like in C++, and for these would store a pointer in the env struct. Copy-out would instead copy the value in the pointer, and an additional copy-back operation at the end of the lambda would copy the final value of the var back into the pointer.
Similarly, we could also support C++'s mutable capture-by-value by making the env struct vars non-const and copying back the final values of all variables directly into the struct.
Reactions are currently unavailable