これを呼んでいると、ケース定義が欠落しています
check c (n:nx) state (l:ls,r:rs)
=true,if((isprefix state c)&(r=n))
=false, otherwise
私はこれをチェックしました、そしてそれは私がそれを何を送ってもそれ自身で働きます。
これは私がそれを呼んでいるところです(警告:それは今のところ少しひどく書かれています):
readword input state tape
=output tape, if (((haltcheck sWord sNum state tape)=true)&(isprefix " halt" rline))
=doinst rline state tape , if ((check sWord sNum state tape)=true)
=readword tail state tape, otherwise
where
theline = dropwhile notit input
start = dropwhile isspace theline
sWord = takewhile letter start
ends = dropwhile notspace start
distart = dropwhile isspace ends
sNum = takewhile notspace distart
tail = dropwhile notspace distart
rline = takewhile notit tail