earl-grey icon indicating copy to clipboard operation
earl-grey copied to clipboard

Allow await (from async functions) in generators

Open davej opened this issue 9 years ago • 0 comments

I think this was discussed before in Gitter but I just wanted to make a note of this here so it wouldn't get lost.

fib = *->
   var {a, b} = {0, 1}
   while true:
      await write-file("/var/fib", a.toString())
      yield a
      {a, b} = {b, a + b}

davej avatar Aug 06 '15 11:08 davej