Need a metavalue singleton kinda thingy as a reserved key...

Paddy paddy3118 at
Mon Aug 12 19:42:48 CEST 2002

Noah wrote:

> Oh, so you want a motivation for doing this?
> I'm creating a generic Finite State Machine class.
> As part of the input to the FSM you specify a map from
>     (input_symbol, state)  -->  (action, next_state)
> The input_symbol can be any object or value you want.
> I want a convenient way for the user to specify
> special symbols that the FSM treats differently
> than regular symbols. For example, some types of
> special symbols might be "MATCH_ANY", "MATCH_ALWAYS", 
> "LAMBDA", "DEFAULT_MATCH". These meta-symbols are
> special in that the FSM will check for a match on them
> before or after other possible transitions. 
You could use a map of 

     (input_symbol, state, meta_sym_flag)  --> (action, next_state)
Set meta_sym_flag to true or 1 for meta_symbols then set
input_symbol to be the type of meta_symbol, e.g. "MATCH_ANY"


More information about the Python-list mailing list