News for hackers. Stuff that matters.
Re:Pyret – A language exploring scripting and functional pro... by cygned on Thursday December 15, 2016 @12:31PM (#13186337)
As a Clojure programmer, I learned to love hyphens, so much more readable. But since Clojure is a Lisp, is does not suffer this whitespace problem/confusion.

    (- a b)
Re:Pyret – A language exploring scripting and functional pro... by kazinator on Thursday December 15, 2016 @01:14PM (#13186724)
An infix language could also require whitespace around operators, so that a-b could be a an identifier.

Like in a Lisp infix macro: (infix (a + b * c) / d).

This kind of thing is quite habitable: we hardly lose sleep over (3.4) the list of one float versus (3 . 4) the dotted pair of integers.

Re:Pyret – A language exploring scripting and functional pro... by skrishnamurthi on Thursday December 15, 2016 @05:40PM (#13189308)
We're discussing an infix language that does exactly that. In Pyret, binary operators must be surrounded by spaces. Therefore, `a-b` is not ambiguous.
Re:Pyret – A language exploring scripting and functional pro... by brudgers on Thursday December 15, 2016 @03:45PM (#13188223)
I'd say that white space requirements around operators even seems implicitly consistent with the Pythonic idiom of semantic white space and the Pythonic dictum of only one way to do things.
Re:Pyret – A language exploring scripting and functional pro... by skrishnamurthi on Thursday December 15, 2016 @09:46PM (#13190681)
Python has many ways to do just about everything (e.g., list comprehensions are completely redundant). It's a nice marketing slogan, though.
Re:Pyret – A language exploring scripting and functional pro... by brudgers on Thursday December 15, 2016 @10:18PM (#13190803)
Yes, there's even two Pythons.
Re:Pyret – A language exploring scripting and functional pro... by kpil on Thursday December 15, 2016 @01:10PM (#13186682)
I'd say there is some room for confusion, even if it's not in the grammar.

I have spent quite some time chasing bugs of the type (- a -1) where the second minus ended up there because of either a copy/paste-error or a brain fart due to the original expression was a - 1...

Re:Pyret – A language exploring scripting and functional pro... by wolfgang42 on Thursday December 15, 2016 @01:22PM (#13186792)
I'm not sure how (- a - 1) would work, unless you've named something "-"?
Re:Pyret – A language exploring scripting and functional pro... by Grue3 on Friday December 16, 2016 @05:09AM (#13192233)
- is a function. Because Closure is a Lisp1, substraction function being passed as an argument like that is very probable. In Common Lisp you'd pass #'-, so it's clear that it's a function being passed.