]> gitweb.factorcode.org Git - factor.git/commitdiff
new accessors
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Aug 2008 02:22:29 +0000 (21:22 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Aug 2008 02:22:29 +0000 (21:22 -0500)
extra/turing/turing.factor

index f5b510237bd6954f05918d66673cb1c0038c944c..18d66a2e516d2fd0f49dc622682f0a0e600a8609 100644 (file)
@@ -1,6 +1,6 @@
-IN: turing
 USING: arrays assocs io kernel math namespaces
-prettyprint sequences strings vectors words ;
+prettyprint sequences strings vectors words accessors ;
+IN: turing
 
 ! A turing machine simulator.
 
@@ -55,9 +55,9 @@ SYMBOL: tape
 : turing-step ( -- )
     #! Do one step of the turing machine.
     next-state
-    dup state-sym set-sym
-    dup state-dir position [ + ] change
-    state-next state set ;
+    dup sym>> set-sym
+    dup dir>> position [ + ] change
+    next>> state set ;
 
 : c ( -- )
     #! Print current turing machine state.