≈ the.bay.news

Pitch: Single-yield functions

Swift Forums
Pitch: Single-yield functions
Hi everyone, This is a pitch to introduce single-yield functions to the language. Single-yield functions are declared by writing yield in the result position: func f() -> yield T // yields an owned value func f() -> yield borrow T // yields a borrowed value func f() -> yield inout T // yields a mutable value A single-yield function is a coroutine that runs until it reaches a yield statement. It then yields a value to its caller and suspends. When the caller is finished accessin...

Hi everyone, This is a pitch to introduce single-yield functions to the language. Single-yield functions are declared by writing yield in the result position: func f() -> yield T…

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.