[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Has Lua reached perfection?
- From: nobody <nobody+lua-list@...>
- Date: Mon, 29 Jan 2018 03:01:03 +0100
On 2018-01-28 13:09, Tony Papadimitriou wrote:
The only thing I would certainly add to Lua is a `yield` keyword to
complement `return` similar to Python’s way.
You sure that's a good idea?
How would you prevent code from using coroutines? Right now, you just
take away the `coroutine` library (e. g. in a sandboxed _ENV) and you
know that the code won't (be able to) use it.
How would you 'tag' results coming from certain coroutines? (E.g. all
workers always `yield( "worker", id, ret... )`.) Right now, you write a
wrapper function and call that instead. If yield is a keyword, I hope
you're not manually hard-coding the prefix everywhere but will also use
a wrapper, right?
So, what has been gained? (...and what has been lost?)
(This is another instance of the saddle-not-optima thing I was referring
to in another branch of this thread.)