lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

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.)

-- nobody