lua-users home
lua-l archive

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


> [...] Of course this
> concept could be used in a coroutine environment, i.e. having a "stop"
> function that yields the coroutine, i.e.
> 
> while true do
>   local line = readline() or stop()
>  ...
> end
> 
> which looks already quite nice...

Just do  'stop = coroutine.yield'.

-- Roberto