From: Zellyn Hunter Date: 2003-06-20T21:44:05+09:00 Subject: Re: Code generation and state machines On Friday 20 June 2003 06:34, Robert Klemme wrote: > I'd store the state info in an instance variable of the class instance and > not use a class variable, because the latter is inherited and thus visible > to sub classes. Okay - I understand that. I take it class instance variables are not inherited, then? > I also wonder why your state machine runs automatically in method run. Yeah. The run method is as simple as possible to demonstrate the principles - at the moment I'm worried about classes, superclasses, instances, and syntax extension (the "state" and "transition" keyword-looking functions used to easily define state machines). The run method will definitely change, probably in the direction you've mentioned. I like the event idea - I'll have to think about it a little more. > Also, is it possible that you use 0 to mean "false"? This is true for Perl > but not Ruby. In Ruby the only two values that are equivalent to false > are false itself and nil. Aah. Yes, oops! It's going to be difficult getting used to that one! Thanks for your help! Zellyn