[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18788 ___ ___

[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 prTAB 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 the

[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 rep...@bugs.python.org http://bugs.python.org/issue18788

[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))? What does a

[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: 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

[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 rep...@bugs.python.org http://bugs.python.org/issue18788

[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

[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 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, so

[issue18788] Proof of concept: implicit call syntax

2013-08-20 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18788 ___ ___ Python-bugs-list

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