[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Nick Coghlan
Nick Coghlan added the comment: To clarify how my patch works: leaving out the parentheses is permitted *only* when the call is a statement unto itself. That's how it avoids conflicting with any existing syntax like "a *b" or "a **b": the parser consumes those as part of the initial expression, s

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Alex Gaynor
Alex Gaynor added the comment: I suppose I'm one of the more qualified people to comment on how Ruby does it: a mess of hacks in the lexer/parser. Ruby's case is complicated by the fact that a bare `foo` can either be a local variable or a method call on self. Consider the case `a +b`, should

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Guido van Rossum
Guido van Rossum added the comment: Well aren't there other languages (Ruby, Coffeescript) that have the same syntax? How do they do it? (Haskell does it too, but I don't think we can learn from it -- but in Ruby and IIRC Coffeescsript it is syntactic sugar for a regular call.) Heck, even P

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Ramchandra Apte
Ramchandra Apte added the comment: I do not see much use of of implicit call syntax, a good editor will autocomplete the brackets. -- nosy: +Ramchandra Apte ___ Python tracker _

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I like a parens-less call syntax, but it is unpythonic and even anti-pythonic. It can be good in some other language (like Forth or Tcl, may be Perl or Ruby) but not in Python. It requires some other coordinated features (a syntax to obtaining a reference to

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Nick Coghlan
Nick Coghlan added the comment: As Serhiy's examples show, the ambiguities this introduces get confusing fast. A more constrained version that (for example) permitted only name references for the callable could resolve that, but it's probably still a bad idea. Still, interesting to know it is

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Ambiguous cases (such as "expr * expr" and "expr ** expr") obey the rule that > implicit calls are very *low* precedence, so you have to use parens to force > the call interpretation. Does "a + b c" mean "(a + b)(c)"? Does "a + b (c)" mean "(a + b)((c))"?

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Peter Otten
Peter Otten added the comment: > a bare expression is not call Wouldn't that silently swallow a lot of bare print statements? -- nosy: +peter.otten ___ Python tracker ___

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: > In addition to being a pain at the interactive prompt Just type "pr" and the "print(" call will be auto-completed. (with TAB-completion being enabled by default in 3.4 ;-)) > the change of print from a statement to a function has also been noted > as one of

[issue18788] Proof of concept: implicit call syntax

2013-08-19 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue18788] Proof of concept: implicit call syntax

2013-08-19 Thread Nick Coghlan
New submission from Nick Coghlan: After watching one of the presenters at PyTexas struggle painfully with the fact "print value" doesn't work in Python 3, I decided I had to at least *try* to see if a general "implicit call" syntax was feasible within the constraints of the CPython parser. Th