[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ah, those uninitiated people...
- From: Jorge <xxopxe@...>
- Date: Thu, 14 Jan 2010 12:47:49 -0200
On Wed, 2010-01-13 at 15:44 +0100, David Kastrup wrote:
> Wesley Smith <wesley.hoke@gmail.com> writes:
> >> Tail calls are good for state machines.
> >> ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-443.pdf
> >
> > I find coroutines more elegant.
>
> Yup. Nothing beats using the instruction pointer and dynamic state as
> state variable.
>
Ok, hit me with a spoon, can anyone post an example of using coroutines
to implement a state machine?
I guess each state is a coroutine, and transitions are yields and
resumes, but the details escape me.
Jorge
- References:
- Ah, those uninitiated people..., Alexander Gladysh
- Re: Ah, those uninitiated people..., Enrico Colombini
- Re: Ah, those uninitiated people..., Roberto Ierusalimschy
- Re: Ah, those uninitiated people..., Andrew Wilson
- Re: Ah, those uninitiated people..., Mark Hamburg
- Re: Ah, those uninitiated people..., steve donovan
- Re: Ah, those uninitiated people..., David Given
- Re: Ah, those uninitiated people..., Tony Finch
- Re: Ah, those uninitiated people..., Wesley Smith
- Re: Ah, those uninitiated people..., David Kastrup