From: ara.t.howard@... Date: 2006-09-09T05:22:06+09:00 Subject: Re: state machine in ruby sorry not to include orig message - the text was totally fubar and hosed my mailer... anyone. this is incomplete, but i made a little finite state machine lib and dsl. it even includes tools to vizualize if you have dot installed. it's here http://rubyforge.org/projects/codeforpeople/ http://codeforpeople.org/lib/ruby/ an example harp:~ > cat a.rb require 'fsm' FSM.system do fsm{ states %w( empty full ) transition 'filling', 'empty' => 'full' transition 'emptying', 'full' => 'empty' } observer{ on_entry 'empty' do puts 'became empty.' transition 'empty', 'filling' do puts 'filling...' sleep 1 end end on_entry 'full' do puts 'became full.' transition 'full', 'emptying' do puts 'emptying...' sleep 1 end end } start end STDIN.gets harp:~ > ruby a.rb became empty. filling... became full. emptying... became empty. filling... became full. emptying... became empty. filling... sorry, no docs yet ;-) -a -- what science finds to be nonexistent, we must accept as nonexistent; but what science merely does not find is a completely different matter... it is quite clear that there are many, many mysterious things. - h.h. the 14th dalai lama