From 0dde43edac6817c3f0a237d25c2054c0ee75926c Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 23 Feb 2015 19:03:16 +0100 Subject: Added binary incrementer state table to Turing machine example * reintroduced `BLANK` as the _BLANK_ symbol * fixed implicit tape expansion in `tape::readSymbol` --- example/turing/src/tape.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'example/turing/src/tape.h') diff --git a/example/turing/src/tape.h b/example/turing/src/tape.h index 39814d8..4f79bd9 100644 --- a/example/turing/src/tape.h +++ b/example/turing/src/tape.h @@ -10,6 +10,12 @@ namespace machine { namespace tape { +struct BLANK { + typedef BLANK type; + + static constexpr char value{'\0'}; +}; + // (define (readSymbol position tape) // (if (= (length tape) position) // '() @@ -18,11 +24,11 @@ template < typename Position, typename Tape > -using readSymbol = tav::If< - tav::IsEqualValue, Position>, - void, - tav::Nth ->; +using readSymbol = tav::Eval>, + tav::utility::defer_eval, + BLANK +>>; // (define (writeSymbol position symbol tape) // (if (= (length tape) position) -- cgit v1.2.3