Hello,
On Sat, 13 Feb 2021 16:25:24 -0500
Cade Brown
In my humble opinion, arrows should be '->' instead of '=>'. It always annoys me when languages use that symbol
That's unlikely, as was discussed in this thread previously: a) JavaScript already uses "=>", and it doesn't make sense to be different just for the purpose of being different. That will only confuse people. b) Python already uses "->" for function return *type*. And there's idea to generalize it to *function type* in general. E.g. a function "(a, b) => a + b" can have type "(int, int) -> int". (I agree that intuitively, types would rather have "fatter" arrow, because types are "meta", but again, that doesn't correspond to the practical context we live in. So, let's look at the bright side of it - "=>" is more visible, because otherwise, arrow functions are really skinny and can be easily missed at all).
On Sat, Feb 13, 2021, 14:52 Paul Sokolovsky
wrote: Hello,
On Sat, 13 Feb 2021 09:24:51 -0800 Matthias Bussonnier
wrote: Works well with 0 parameters and currying, read almost like a haskell function definition.
f = () => ((b) => b) g = (a) => (b) => b+a h = (a) => (b) => (b, a) i = (a,b) => a
print(f()(2)) print(g(1)(2)) print(h(1)(2)) print(i(1, 2))
Thanks for testing! Yeah, I didn't even think about recursive syntax cases, glad to know they work out of the box. Seems like writing macros for Python isn't that hard, even on the token stream level.
And this comparison with Haskell - don't know if it's good or bad. Definitely feels a bit scary ;-). We'll see how this idea goes...
[]
-- Best regards, Paul mailto:pmiscml@gmail.com _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@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/R7QVXQ... Code of Conduct: http://python.org/psf/codeofconduct/
-- Best regards, Paul mailto:pmiscml@gmail.com