On Tue, Jul 27, 2010 at 6:43 PM, Greg Ewing email@example.com wrote: <snip>
One of the things I would like to get from a code-as-ast feature is a natural way of embedding sub-expressions that *do* get evaluated according to the normal Python rules. For example, one should be able to write something like
cust = "SMITH" date = today() sales = select(transactions, @ast: customer_code == cust and transaction_date == date)
and have it possible for the implementation of select() to easily and safely evaluate 'cust' and 'date' in the calling environment.
In other words, you want (possibly an implicit form of) the comma operator from Scheme's quasiquote. Maybe Paul Graham /was/ onto something.
Cheers, Chris --  http://www.cs.hut.fi/Studies/T-93.210/schemetutorial/node7.html