An idea; Coroutines

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Tue Jan 16 19:14:18 UTC 2024


On 17/01/2024 8:05 AM, victoroak wrote:
> I was thinking about this. The generated struct would probably need to 
> allocate in the GC if any parameter to the generator function escaped. 
> We could use something like scope but I don't know how reliable it would 
> be to make it safe. I would really like to see some kind of stackless 
> resumable function in D.

What you are thinking about is the inverse of scope.

You are not allowed to be borrowed from the state and I don't think we 
have the logic to represent that.

I suppose something like ``@live`` forced on you could work though for 
owners only.


More information about the Digitalmars-d mailing list