2
我越来越缺少病例定义,当我调用这个缺失情况下的定义在Miranda
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
非常感谢你,没想到现在是在踢我自己。 – user23012