5 ms·
How many languages support kebab case with any Unicode dash that isn't the ASCII one? :)
by oconnor663 4y ago
How many languages support kebab case with any Unicode dash that isn't the ASCII one? :)
- adastra22 4y agoProbably any language that supports Unicode identifiers.
- jfoutz 4y agoAt the moment, the only one I know for sure is Agda. I suspect java would work as well, not sure about golang unicode var naming.
- zimpenfish 4y agoplay.golang wouldn't let me use figure (‒, U+2012), endash (–, U+2013) or emdash (—, U+2014) in a variable name directly. But then the spec[1] says that only code points characterised as "Letter", an underscore, or characterised as "Number, decimal digit" are valid. [1] https://go.dev/ref/spec#Identifiers https://go.dev/ref/spec#Identifiers
- leipert 4y agoCoptic Small Letter Dialect-P Ni should work, looks like a hyphen. Go Playground: https://go.dev/play/p/kxgOcEWsznz https://go.dev/play/p/kxgOcEWsznz https://www.compart.com/en/unicode/U+2CBB https://www.compart.com/en/unicode/U+2CBB
- zimpenfish 4y agoOh, neat catch!
- Smaug123 4y agoF# allows arbitrary names within double-backtick identifiers. The following is a valid declaration, where I've used a hyphen, en-dash, and em-dash: let ``foo-bar–baz—quux`` = 3
- dunham 4y agoAgda does, but it also supports a plain ascii hyphen in identifiers. It allows operator characters inside identifiers and requires spaces around operators otherwise (as proposed in the article). So you can use x-y as an identifier: x-y : ℤ → ℤ → ℤ x-y x y = x - y The Agda community also heavily uses unicode characters. I've even seen a unicode colon used for a custom syntax because the ascii colon was unavailable.
- still_grokking 4y ago> The Agda community also heavily uses unicode characters. Wise move. Finally a language from the 21 century. Still sticking to ASCII is madness. Especially as most people on this planet don't use ASCII as their native char set.