[Python-Dev] Extended Function syntax

Brett Cannon bac@OCF.Berkeley.EDU
Thu, 30 Jan 2003 18:42:13 -0800 (PST)


[Guido van Rossum]

> What's still missing is a way to add formal parameters to the thunk --
> I presume that J and K are evaluated before interface.interface is
> called.  The thunk syntax could be extended to allow this; maybe this
> can too.  E.g.:
>
>   e:(x, y):
>     S
>

Would something along the lines of::

    foo = e(x,y)::
        S

Work?  The double colons (assuming the parser can handle this; don't see
why not but I am knowledge of parsers amounts to squat) would allow for an
obvious differentiation between a pseudo inline block that is being used
in an assignment statement and where a single colon is normally used.
And since there is no keyword here specifically delineating that it is a
define or something it kind of lets it look like a call on e which is sort
of what it is doing.  A stretch, I know, but hey, every bit helps.  =)

-Brett