Can I do this?

David Haynes david.haynes2 at sympatico.ca
Wed May 23 05:23:26 EDT 2001


I want to implement a light-weight finite state automata as a set of
rules. Each rule consists of a rule number, regular expression,
function if true, function if false.

Can I somehow call the function named in the rule or do I have to use
the value in the function area to do a lookup for the function?

That is, should my rules look like:

10,a < b, do_a(a, b), do_b(b, a)

or should they look like:

10,a<b,11,12

and have a function that converts the '11' to a call to do_a()?

Thanks
-david-




More information about the Python-list mailing list