3 ms·
One nice thing about Julia is being able to use Unicode characters in variable/constant names, e.g. π and θ, instead of the usual pi and theta, in programs.
by yesenadam 6y ago
One nice thing about Julia is being able to use Unicode characters in variable/constant names, e.g. π and θ, instead of the usual pi and theta, in programs.
- enriquto 6y agoyou can also do this in python, perl and C (if you use gcc or clang)
- layer8 6y agoMost popular programming languages have that ability. The problem is that most people don’t know how to enter characters that aren’t on the keyboard and don’t have software installed/configured that makes it easy to do so (e.g. using a Compose key).
- yesenadam 6y agoOk, good to know. Well, Julia doesn't have those problems – in the REPL, out of the box, type "\pi[TAB]" for the greek letter, etc. And not needing an explicit multiplication sign in some places also makes mathematical code look more like maths, e.g. julia> 2π 6.283185307179586
- AlbertoGP 6y agoSame with Emacs if you select the TeX input method: Alt-x set-input-method TeX \pi → π That works for any programming language. I’ve used it occasionally for my own programs but use plain ASCII if I expect others to work on the code.