News for hackers. Stuff that matters.
Re:Elm for the Front End, Right Now by conistonwater on Wednesday November 23, 2016 @08:25PM (#13027217)
A prime as an identifier constituent is not "weird syntax". The ancient C tradition of only allowing [_[:alnum:]] characters in identifiers is pretty pointless anyway. I really wish more languages would allow question marks and exclamation marks (and everything else), the way Lisp and Scheme do (e.g., https://docs.racket-lang.org/guide/syntax-overview.html#%28p...)

There's a very good example in C++ of how this causes problems, where vector::clear and vector::empty are much too easy to confuse (which one of them deletes all elements, and which one of them checks if a vector is empty?). Replacing them with clear! and empty? (or is it clear? and empty!) would be a huge improvement. Whenever a language moves away from arbitrary legacy restrictions, that's a good thing.

Re:Elm for the Front End, Right Now by kbp on Thursday November 24, 2016 @10:24AM (#13030753)
The problem is that prime (as it's used, anyway) doesn't carry any meaning the way ? and ! (as they are used) do in Scheme, it's just used for "I couldn't bother to think of another name". Enabling clearer names is great, but the language allowing primes in names was accomplishing the opposite of that.
Re:Elm for the Front End, Right Now by conistonwater on Thursday November 24, 2016 @01:22PM (#13031844)
I think that's a coding style decision, and shouldn't be part of language specification. I certainly don't feel about primes the way you do: having a function f and a function f' usually means they are sort of similar with some specific difference between them, definitely not "couldn't think of a better name". E.g., in haskell a prime often denotes a strict function, it's a better convention than having f and f_strict. Plus, how are you going to decide which unicode symbols should not be allowed? It can get a little random.
Re:Elm for the Front End, Right Now by kbp on Thursday November 24, 2016 @03:32PM (#13032586)
It's definitely a matter of taste, but I feel like settling for "similar except different somehow" is the same thing as "couldn't think of a better name". I would much prefer f-strict because then I don't need to be familiar with the punctuation conventions of the codebase to know how it's different from f, it's right there in English.

Edit: Plus, then you don't have to wonder if that particular function follows that naming convention; prime meaning strict isn't nearly as universally followed as ? or ! in Scheme, for instance.

Re:Elm for the Front End, Right Now by masklinn on Thursday November 24, 2016 @10:39AM (#13030836)
In Haskell it's sometimes (often?) used for strict versions of functions e.g. foldl and foldl'.
Re:Elm for the Front End, Right Now by manu3000 on Thursday November 24, 2016 @04:50PM (#13033004)
it's a convention in ML languages, for a name whose value has been modified