[Python-ideas] Multi-statement anonymous functions

Steven D'Aprano steve at pearwood.info
Tue Jan 14 03:33:50 CET 2014


On Mon, Jan 13, 2014 at 09:06:03PM +0700, musicdenotation at gmail.com wrote:

> What I want is a canonical, obvious, natural solution to a problem, 
> not a workaround.

Please explain what the problem is, what you consider "canonical", 
"obvious", and "natural", and how we should distinguish a "solution" 
from a "workaround".

Dropping arbitrary syntax into our laps with no explanation of what it 
means and what is metasyntax does not help. For example, you proposed:

    let function(*args,**kwargs):
        ...body...
    function2(...args...):
        ...body...
    in:
        [statements]
    do:
        [statements]
    where [function declarations in the same form as above]


I have no idea what that is supposed to mean. E.g. is "function" a 
keyword (part of the syntax) or the name of something (a new function 
perhaps?)? Are the dots and [] syntax or metasyntax?

Don't assume we are familiar with Haskell and Julia, or that we can tell 
which bits are metasyntax and which are intended as new syntax. A good 
way to proceed is to give examples of the syntax, show the expected 
output, and preferrably include a plain English description of what it 
does that is new or different from existing syntax.


Thank you.


-- 
Steven


More information about the Python-ideas mailing list