Hello,

On Tue, 23 Feb 2021 23:29:33 +1100
Steven D'Aprano <st...@pearwood.info> wrote:

> On Tue, Feb 23, 2021 at 11:27:12AM +0100, Stéfane Fermigier wrote:
> 
> > Also: I know there are several modern computer languages that use
> > arrows to represent anonymous functions (JS, Kotlin, Scala...).  
> 
> Javascript: first release was 1995, making it 25 years old. It's
> older than most Javascript programmers.
> 
> Kotlin is only 9 years old. But Scala is 17 years old.
> 
> (By the way, Julia calls the -> arrow "the stab operator". I think 
> that's amusing.)
> 
> Python has a long history of taking inspiration from other languages, 
> but we've had anonymous functions for longer than Javascript has 
> existed. This proposed arrow function would just be an alternative 
> spelling for the same thing. It adds no more power, and no more 
> expressiveness to the language.
> 
> It would be just one more thing to learn, one more decision to make 
> ("lambda or arrow?"), one more question to be asked a thousand times 
> ("what's the difference between lambda and arrow?").

So, (unlike JS) we should make sure that there's no (semantic)
difference between lambda and arrow functions, and the answer to
"which?" should be "what you want or whatever your boss says".

(Btw, syntactically, there may be difference. I hope that we'll
eventually extend lambda to multiline, I'm not so sure about arrow. Of
course, with braces syntax variant both will be multiline).

[]

-- 
Best regards,
 Paul                          mailto:pmis...@gmail.com
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/QKPHHKETF2RYDCPTT3C5PKLUB5IDQJIP/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to