turing machine in an LC
Greg Ewing
greg at cosc.canterbury.ac.nz
Wed Feb 9 18:55:36 EST 2005
Jeremy Bowers wrote:
> I can't figure out how to write a TM in a Python List Comprehension
> without one of either "variable binding" (so we can store the last symbol
> list and manipulate it in the next iteration) or "recursive function" (to
> express the whole tape as a recursive function), both of which require
> statements.
Lambdas can give you one-line functions, local variable
binding, if-then-else capabilities, and recursion. Everything
else should be possible from there.
As a fellow named Church once pointed out, lambdas are really
*all* you need in a language...
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list