>  explaining the practical uses of sequential machines in programming?

A better known term is "Finite State Machine".  These are very useful
constructs in general programming (you can google them -- our J OMS used
one for order state management).  

J's sequential machine dyad  ;:  uses FSMs to tokenize strings.  It's
intended (and commonly used) to to parse user data, implement a DSL, etc.  

Of course, like any primitive, you can get creative with it.  For example,
I once used it to calculate some statistics about family size, and
produced a solution 3 OOM faster and 2 OOM leaner than the "obvious" way
I'd tried before.  

Not that I'd have retained the  ;:  in production (the cost of maintenance
would be too high), but it was a fun exercise.   

-Dan

[1]  http://www.jsoftware.com/pipermail/general/2005-August/024064.html


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to