Michael Spencer wrote: > > Jeremy Bowers <[EMAIL PROTECTED]> writes: > > > > > >>On Tue, 08 Feb 2005 17:36:19 +0100, Bernhard Herzog wrote: > >> > >>>Nick Vargish <[EMAIL PROTECTED]> writes: > >>> > >>>>"Xah Lee" <[EMAIL PROTECTED]> writes: > >>>> > >>>>>is it possible to write python code without any indentation? > >>>> > >>>>Not if Turing-completeness is something you desire. > >>> > Bernhard Herzog wrote: > .... > a Turing Machine in one line plus assignments - nice! Turns out that pypy is more > verbose than strictly necessary ;-) > ... > > > BTW, I realized that it is indeed possible for a LC to maintain its own state > without being passed an external mutable. The trick is to use itertools.repeat > to return the same mutable object on each iteration.
Pay attention, chief. I suggested this days ago to remove duplicates from a list. from itertools import * [ x for (x,s) in izip(iterable,repeat(set())) if (x not in s,s.add(x))[0] ] ;) There is a way to even avoid repeat if you're feeling EVIL. [ x for x in iterable if x not in locals()['_[1]'].__self__ ] Turning this into a turing machine is left as an exercise. The recipe in effect: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/204297 -- CARL BANKS -- http://mail.python.org/mailman/listinfo/python-list