## Recursive Generators and Backtracking Search (Python)

From: "andrew cooke" <andrew@...>

Date: Tue, 5 Aug 2008 22:04:02 -0400 (CLT)

Very interesting thread from the Python archives -
http://mail.python.org/pipermail/python-list/2005-October/348485.html

The test code referred to in the final email from Tim is available here:

I need to sleep, but that looks very much worth reading.

Andrew

### I Have to Agree

From: "andrew cooke" <andrew@...>

Date: Sun, 10 Aug 2008 16:34:31 -0400 (CLT)

Now that I've started trying to write a parser with generators I have to
agree with the first post linked to above - it really is anuisance that
you have explicitly "bounc" the results from a recursive invocation.

I have lots of code that looks like this:

def my_thing(args...):
if (still_not_finished):
yield result_at_this_level
for further in my_thing(less_args):
yield further

The point is that the last two lines are somewhat silly - it would be
nicer to have something like:

def my_thing(args...):
if (still_not_finished):
yield result_at_this_level
my_thing(less_args)

or

def my_thing(args...):
if (still_not_finished):
yield result_at_this_level
yield_all my_thing(less_args)

or similar

Andrew

### Recursive Descent Parser

From: "andrew cooke" <andrew@...>

Date: Wed, 4 Feb 2009 07:09:16 -0300 (CLST)

If you're interested in this post you may also be interested in the
recursive descent parser I wrote a few months later, in Python.  It's
called LEPL and available from http://www.acooke.org/lepl

Andrew