Re: [Python-ideas] Dollar operator suggestion

2017-10-26 Thread Mike Müller
This already exists in Coconut: http://coconut.readthedocs.io/en/master/HELP.html#function-composition From http://coconut-lang.org/: > Coconut is a functional programming language that compiles to Python. > Since all valid Python is valid Coconut, using Coconut will only extend > and enhance

Re: [Python-ideas] Dollar operator suggestion

2017-10-26 Thread Nick Coghlan
On 27 October 2017 at 02:23, Chris Barker wrote: > > > On Thu, Oct 26, 2017 at 6:32 AM, Paul Moore wrote: > >> >> Procedural languages, and Python in particular, simply don't work like >> that. Functions have arbitrary numbers of arguments, > > > And

Re: [Python-ideas] Dollar operator suggestion

2017-10-26 Thread Chris Barker
On Thu, Oct 26, 2017 at 6:32 AM, Paul Moore wrote: > > Procedural languages, and Python in particular, simply don't work like > that. Functions have arbitrary numbers of arguments, And can return an arbitrary number of values. OK, technically a single tuple of values, but

Re: [Python-ideas] Dollar operator suggestion

2017-10-26 Thread Daniel Moisset
Expanding on the comments of the OP (to give more information, not necessarily to support or be against it): The "$" operator in Haskell is not a composition operator, it's essentially the same as python's apply builtin (the python2 builtin, removed for python 3), but with an operator syntax; the

Re: [Python-ideas] Dollar operator suggestion

2017-10-26 Thread Thomas Jollans
On 2017-10-26 13:06, Yan Pas wrote: > I've looked up this feature in haskell. Dollar sign operator is used to > avoid parentheses. > > Rationalle: > Python tends to use functions instead of methods ( e.g.len([1,2,3]) > instead of [1,2,3].len() ). Sometimes the expression inside parentheses > may

Re: [Python-ideas] Dollar operator suggestion

2017-10-26 Thread Rhodri James
On 26/10/17 12:06, Yan Pas wrote: I've looked up this feature in haskell. Dollar sign operator is used to avoid parentheses. If I understand your example correctly, it does no such thing. "A $ B" appears to mean "apply callable A to object B", at least the way you portray it below. I don't

Re: [Python-ideas] Dollar operator suggestion

2017-10-26 Thread Stephan Houben
Why not a functional syntax, i.e. compose(f, g, h) rather than f $ g $ h Advantage: you can do it today. Without need to convince Guido to add more line noise to the language. https://gist.github.com/stephanh42/6c9158c2470832a675fad7658048be9d Stephan 2017-10-26 13:06 GMT+02:00 Yan Pas

[Python-ideas] Dollar operator suggestion

2017-10-26 Thread Yan Pas
I've looked up this feature in haskell. Dollar sign operator is used to avoid parentheses. Rationalle: Python tends to use functions instead of methods ( e.g. len([1,2,3]) instead of [1,2,3].len() ). Sometimes the expression inside parentheses may become big and using a lot of parentheses may