From 3f82d8eb9e8a196b29a9ed0a642e080f28c8e440 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 30 Aug 2008 21:25:47 -0500 Subject: [PATCH] no unit tests?? new accessors --- extra/state-machine/state-machine.factor | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/extra/state-machine/state-machine.factor b/extra/state-machine/state-machine.factor index b5e8c16b02..6a785e91b7 100755 --- a/extra/state-machine/state-machine.factor +++ b/extra/state-machine/state-machine.factor @@ -1,5 +1,6 @@ -USING: kernel parser lexer strings math namespaces sequences words io -arrays quotations debugger kernel.private sequences.private ; +USING: kernel parser lexer strings math namespaces +sequences words io arrays quotations debugger accessors +sequences.private ; IN: state-machine : STATES: @@ -20,9 +21,9 @@ M: missing-state error. ! quot is ( state string -- output-string ) [ missing-state ] dup [ - [ >r dup dup state-data swap state-place r> ] % + [ >r dup [ data>> ] [ place>> ] bi r> ] % [ swapd bounds-check dispatch ] curry , - [ each pick set-state-place swap set-state-data ] % + [ each pick (>>place) swap (>>date) ] % ] [ ] make [ over make ] curry ; : define-machine ( word state-class -- )