From 73be8fb60adc4723421e73d38331f793f1d16886 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 14 Mar 2015 22:43:12 +0100 Subject: Implemented basic tape log printout in _Turing_ example * `machine::simulate` now returns a list of all tape states and corresponding head positions * rewrote some of the actual print logic in terms _TypeAsValue_ --- example/turing/src/machine.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'example/turing/src/machine.h') diff --git a/example/turing/src/machine.h b/example/turing/src/machine.h index a30c6e3..4a72d94 100644 --- a/example/turing/src/machine.h +++ b/example/turing/src/machine.h @@ -63,19 +63,22 @@ class simulate { >::template get; public: - using type = tav::Eval, - tape::writeSymbol< - Position, - current_state, - Tape - >, - updatePosition< - current_state, - Position - > - >>; + using type = tav::Cons< + tav::Pair, + tav::Eval, + tape::writeSymbol< + Position, + current_state, + Tape + >, + updatePosition< + current_state, + Position + > + >> + >; }; template < @@ -84,7 +87,10 @@ template < typename Position > struct simulate { - typedef Tape type; + using type = tav::Cons< + tav::Pair, + void + >; }; // (define (run program state tape position) -- cgit v1.2.3