In fact, it could just as well be set up at the start with any category which has an expansion provided for it in the rules or for that matter with any sequence of categories for which there are rules.
1. To check WM to determine if the condition part of a rule is met
to match.pat? :pat op member? :pat :wm end2. To interpret the parts of a rule as an action affecting WM
to do :cond :act ( pr "firing :cond "\-\> :act ) make "wm replace :cond pickrandom :act :wm pr :wm pr [ ] end3. To control the cyclic passage through the rules
to go.through :current.rules if empty? :current.rules [stop] local "condition local "action make "condition first first :current.rules make "action last first :current.rules if match.pat? :condition [do :condition :action go.through :rules] ;Nota bene :rules not :current.rules! go.through bf :current.rules end
to replace :old.item :new.item :list if empty? :list [op ] if :old.item = first :list [op se :new.item bf :list] op se first :list replace :old.item :new.item bf :list end