[Python-Dev] Extended Function syntax

Paul Moore lists@morpheus.demon.co.uk
Sun, 02 Feb 2003 17:14:43 +0000


Jeremy Hylton <jeremy@alum.mit.edu> writes:

> It's unfortunate that you can't extend the syntax, too.

You often don't need to extend the syntax, as long as the existing
syntax and semantics do the right thing. My favourite example of this
is the C++ idiom of "resource acquisition is initialisation", which
combines the semantics of deterministic destructors and the syntax of
being able to define a new variable scope (via {...}) whenever you
need to, to give a very readable and general solution to all sorts of
acquire/release problems.

In my view, Guido's thunk proposal gives the right semantic
flexibility to let people define idioms like this within the fixed
syntax. Even if the generality of it scares him :-)

Paul.
-- 
This signature intentionally left blank