> On Oct 20, 2016, at 9:12 AM, Robin Heggelund Hansen <skinney...@gmail.com> 
> wrote:
> 
> In Elm 0.18, primes are being removed as valid characters in a 
> variable/function name. 


That’s unfortunate. Non-alphabetical characters can be really useful for 
signaling intent.

For example, an ending <?> can usefully be a quick signal that the function is 
a boolean predicate. That’s less useful in a statically-typed language, but 
“less useful” is not the same thing as “useless”. 

Adding a prime mark has a long, even pre-computer, history of signaling. <x’> 
quickly tells the reader that the value is intimately bound up with <x> but has 
a contextually relevant difference. To be less abstract:

When working with SVG, it’s really awkward that `Svg.Attributes.x` takes a 
String argument, given that graphics often involves working with numeric 
values. So it’s not a horrible idea for graphics code to establish a convention 
that primed names take a (consistently, thus predictably) nonstandard type. 

I confidently predict that removing primes won’t result in `xInteger` 
definitions but rather `x2` - which I’d argue is less clear than x’

I could imagine libraries that said explicitly “In this library, functions 
doing <some thing> use the <‘> suffix, but functions doing <some other thing> 
use <!>. (Neither Ruby nor Clojure are really consistent, but experienced users 
know roughly how to react to functions ending in <!>.) Community pressure could 
help with that. 

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to