lua-users home
lua-l archive

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

Mark Hamburg <> writes:

> On Jan 14, 2010, at 8:05 AM, David Kastrup wrote:
>> No, the whole "state machine" is one coroutine.  You just program the
>> control flow that is to be modelled by the state machine.  Yield/resume
>> pairs are used to get new input, and the input is processed with normal
>> conditionals and other branches.  Every code path containing a yield
>> call corresponds to a state.
> Which maps nicely to the state machine = regular language = structured
> programming equivalence, but I'm not sure it always maps well to the
> cases where one wants to use a state machine.

Well, the point is that it often maps well to the cases where you don't
want to use a state machine.

I mean, who wants to use a state machine?  Seriously?

Even if you see people drawing a state machine, they tend to do it in a
diagram, with anonymous states.  States that you have to name and look
up just are not fun.

David Kastrup