Is pyparsing really a recursive descent parser?

Neil Cerutti horpner at yahoo.com
Sun Nov 4 21:52:48 EST 2007


On 2007-11-05, Neil Cerutti <horpner at yahoo.com> wrote:
>   def Ack(x, y):
>     """ The Ackermann function. Creates a humongous mess even
>     with quite tiny numbers. """
>     if x < 0 or y < 0:
>       raise ValueError('non-negative integer')
>     elif x == 0:
>       return y + 1
>     elif y == 0:
>       return foo3(x-1, 1)
>     else:
>       return foo3(x-1, foo3(x, y-1))

Urk! Of course those foo3 calls should have been Ack calls.

-- 
Neil Cerutti



More information about the Python-list mailing list