Generators in lua?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Generators in lua?

rhq093
I wonder if anyone has a good way of emulating Generators and goal
directed evaluation in Lua. Or if they have been considered for
implementation in the core language. Functions as values coupled with
upvalues make me think it would be reasonably easy.  Python recently
added them and I am a longtime Icon programmer.

MvH Dan Andersson


Reply | Threaded
Open this post in threaded view
|

Re: Generators in lua?

James Hearn
> I wonder if anyone has a good way of emulating Generators and goal
> directed evaluation in Lua. Or if they have been considered for
> implementation in the core language. Functions as values coupled with
> upvalues make me think it would be reasonably easy.  Python recently
> added them and I am a longtime Icon programmer.
>
> MvH Dan Andersson

Um, you might check out http://lua-users.org/wiki/ExtendingForAndNext ,
which talks about generators... I really don't know much about the subject,
so I'll just leave it at that.

--James Hearn