JuliaDynamics / ResumableFunctions.jl

C# style generators a.k.a. semi-coroutines for Julia.
Other
160 stars 19 forks source link

@yield returns nothing #43

Closed hdavid16 closed 4 years ago

hdavid16 commented 4 years ago

In /paper/paper.md, there is the following statement:

"Straightforward two-way communication between the caller and the callable type is possible by calling the callable type with an extra argument. The value of this argument is passed to the left side of an arg = @yield ret expression."

However, using an expression of the form arg = @yield request(res) returns nothing. This should ideally return the Put object that is created when the request is made. Is there a way to access this Put object?

hdavid16 commented 4 years ago

I see the value function can be called on a process to get the return value of the corresponding resumable function

hdavid16 commented 4 years ago

If the process has a return value, then @yield will return the value.

See Miscellaneous section in: https://benlauwens.github.io/SimJulia.jl/stable/guides/environments.html