Is undocumented \.bd = ½ bad to use?

It's actually not an undocumented syntax. the Shortcut \.nn stands for a character with hexadecimal code nn. In the default UTF-8 encoding, this means you get the unicode character ½ and that character can be used as a symbol because it has no built-in meaning (you see it's colored blue in the notebook). So you can assign values to it:

½ = 1/3;

½

1/3

See the tutorial Input Syntax.


As explained by @Jens you can use such unconventional symbols in variable names. However, I would tend to avoid it, having been bitten in the past. In version 7 (I think) I was able to use \[Dash] (Esc+-+Esc) in variable names, and I used it extensively. When I upgraded, I found that all these notebooks broke. Wolfram confirmed this was a bug, but it has still not been fixed (in 11.0). It is still documented as a "letter-like form".

Tags:

Symbols