[Python-Dev] Re: Extended Function syntax

Aahz aahz@pythoncraft.com
Sat, 1 Feb 2003 17:41:54 -0500


On Sat, Feb 01, 2003, Guido van Rossum wrote:
>
> I received this from Glyph.  He brings up some interesting use cases
> for thunks.  I guess it could be used for "on" style event handler
> declarations.  Hmm, you could even craft your own case statement with
> his suggestion:
> 
>   switch(expr):
>     case(val1):
>       block1
>     case(val2):
>       block2
>     default:
>       block3
> 
> This actually makes me worry -- I didn't plan thunks to be the answer
> to all problems.  A new idea that could cause a paradigm landslide is
> not necessarily right.

That's why I made my lambda joke earlier, and why I've been pushing for
thunk types at the syntactic level.  I think we do need a generalizable
thunk from the POV of the Python internals, but I don't think we should
expose that mechanism to the language itself, except through specific
keywords or pseudo-keywords.  Using "as" with pseudo-keywords gives the
best of all worlds, I think, and allowing the [] notation to operate on
a thunk gives a fair amount of flexibility without permitting baroque
syntactic forms.
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Argue for your limitations, and sure enough they're yours."  --Richard Bach