Greek letters for variable names?

bech
Posts: 77
Joined: 2007-10-20
Location: Canada

I am disappointed to (belatedly) realize that IP7 does not allow Greek letters as variable names (and requires literal quotes for waves). Since Igor has not used these symbols for any commands, why can't they be parsed similarly to Roman letters? It seems a bit retro to have to write Variable alpha in 2017....

John Bechhoefer
Department of Physics
Simon Fraser University
Burnaby, BC, Canada


jjweimer
jjweimer's picture
Posts: 1219
Joined: 2007-08-14
Location: United States

Just curious. What other applications currently fully support Unicode for variable definitions? I know that Maple does. But, even it has its "glitches".

And would you expect this to go hand-in-hand with having a cross-platform method to select those symbols efficiently? Again, Maple has its set of panels on the left side to select such stuff?

I'm not saying this ideas is bad. I'm just pondering in perspective whether the implementation effort is worth the time compared with other advancement points for Igor 8 (or later).

(Of course, perhaps WaveMetrics will chime in immediately to say they have it solved already for Igor 8).

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH


thomas_braun
Posts: 475
Joined: 2009-10-07
Location: Germany

What other applications currently fully support Unicode for variable definitions?

I can't speak of applications but Perl 6 does. And I must say I really don't like it. As it can create a completely new type of unreadable mess.

Edit: One the other hand if cleverly restricted it could be a pleasure to be able to write something like the attached image as code.

AttachmentSize
render.png1.05 KB

[ last edited March 21, 2017 - 14:26 ]
Posts: 769
Joined: 2007-03-01
Location: United States

Without executing this function, take a look and figure out how many lines will give a function execution error using Igor Pro 7.

Function pullHairOut()
	Make/N=1 'α' = 1
	Make/N=1 '⍺' = 2
	Make/N=1 'Θ' = 3
	Make/N=1 'θ' = 4
	Make/N=1 'μ' = 5
	Make/N=1 'µ' = 6
	Make/N=1 'ä' = 7
	Make/N=1 'ä' = 8
	Make/N=1 XX = 9
	Make/N=1 'XX​' = 10
End

If you guessed 0, you must understand Unicode tricks pretty well. If you get a function execution error, it's possible that some of this code got mangled on the way.


bech
Posts: 77
Joined: 2007-10-20
Location: Canada

jjweimer wrote:
Just curious. What other applications currently fully support Unicode for variable definitions? I know that Maple does. But, even it has its "glitches".

Mathematica. See attached program to integrate Lorenz equations. There are shortcuts for common symbols. For Greek letters, entering escape a escape gives alpha, etc. One could imagine, instead, adopting the LaTeX commands.

Adam's implicit point is well taken: if you allowed all unicode symbols, you could get bugs when you don't realize that α is not ⍺. Still, restricting oneself to ASCII seems overly restrictive.

AttachmentSize
lorenzEqs.png102.65 KB

Back to top