On Tue, Feb 23, 2021 at 1:34 PM 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.
>

I was, implicitly, talking about "modern JavaScript" (which one could argue
is post-ES6 or at least post-ES5 JavaScript) since arrows were introduced
in ES6.

In this sense, "modern JavaScript" (or post-ES6 JavaScript) is a modern
computer language.

Another point: ES6 gained arrows because of Scala's influence, I'm pretty
sure. But also because of the influence of CoffeScript whose motto was to
be "Just JavaScript" - with an alternative syntax. And this alternative
syntax was eventually subsumed by JavaScript itself.

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.
>

Indeed. This makes the proposal much less controversial IMHO.

This wouldn't be the first time some syntactic sugar would be added to the
language to bring its syntax closer to traditional mathematical notation.

See for instance:

>>> pow(2,3)
8
>>> 2**3
8

Or the matrix multiplication operator (@).

Or complex numbers:

>>> complex(0,1)
1j
>>> 1j
1j

  S.

-- 
Stefane Fermigier - http://fermigier.com/ - http://twitter.com/sfermigier -
http://linkedin.com/in/sfermigier
Founder & CEO, Abilian - Enterprise Social Software -
http://www.abilian.com/
Chairman, National Council for Free & Open Source Software (CNLL) -
http://cnll.fr/
Founder & Organiser, PyParis & PyData Paris - http://pyparis.org/ &
http://pydata.fr/
_______________________________________________
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/TN7LDTHYIJW664O4VRDR4F467WZ6TURZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to