News for hackers. Stuff that matters.
Re:Pyret – A language exploring scripting and functional pro... by cglouch on Thursday December 15, 2016 @12:23PM (#13186267)
Well as dumb as it sounds, one reason to allow hyphens instead of requiring underscores is that the former takes one keystroke to type, whereas the latter takes two. This is kind of nice when dealing with longer function names.

It's also worth noting that pyret requires spaces between all math operators, not just subtraction. In other words, 3+4 is not valid; you would need to type 3 + 4. So at least it's internally consistent in that sense.

Re:Pyret – A language exploring scripting and functional pro... by danso on Thursday December 15, 2016 @12:32PM (#13186343)
Not dumb at all...it's just that assuming that we spend more time re-reading code than we do in the initial writing of it, saving the keystroke from hyphen-to-understroke seems like premature optimization :).

Good to know that Pyret requires spacing between the other operators. That does help a lot, and an argument could be made that it forces folks to not do `a-b` when they mean `a - b`.

Re:Pyret – A language exploring scripting and functional pro... by yoz-y on Thursday December 15, 2016 @02:37PM (#13187508)
Personally I find that hyphen-separated identifiers are more readable than when they have underscores. When dabbling in perl6 I got accustomed to then very quickly. And forcing people to put spaces around binary operators is definitely a plus.
Re:Pyret – A language exploring scripting and functional pro... by skrishnamurthi on Thursday December 15, 2016 @02:37PM (#13187510)
It's not dumb at all. It's one of the things we had in mind when we designed the syntax!