no unit tests?? new accessors
parent
754d68fb95
commit
3f82d8eb9e
|
@ -1,5 +1,6 @@
|
||||||
USING: kernel parser lexer strings math namespaces sequences words io
|
USING: kernel parser lexer strings math namespaces
|
||||||
arrays quotations debugger kernel.private sequences.private ;
|
sequences words io arrays quotations debugger accessors
|
||||||
|
sequences.private ;
|
||||||
IN: state-machine
|
IN: state-machine
|
||||||
|
|
||||||
: STATES:
|
: STATES:
|
||||||
|
@ -20,9 +21,9 @@ M: missing-state error.
|
||||||
! quot is ( state string -- output-string )
|
! quot is ( state string -- output-string )
|
||||||
[ missing-state ] <array> dup
|
[ missing-state ] <array> dup
|
||||||
[
|
[
|
||||||
[ >r dup dup state-data swap state-place r> ] %
|
[ >r dup [ data>> ] [ place>> ] bi r> ] %
|
||||||
[ swapd bounds-check dispatch ] curry ,
|
[ swapd bounds-check dispatch ] curry ,
|
||||||
[ each pick set-state-place swap set-state-data ] %
|
[ each pick (>>place) swap (>>date) ] %
|
||||||
] [ ] make [ over make ] curry ;
|
] [ ] make [ over make ] curry ;
|
||||||
|
|
||||||
: define-machine ( word state-class -- )
|
: define-machine ( word state-class -- )
|
||||||
|
|
Loading…
Reference in New Issue