Is there an equivalent to the expr command which works for complex numbers (represented lists of two doubles)?
This library provides functions for complex number arithmetic, and this seems to be a useful utility to define the required cexpr function, but it doesn’t work well.
E.g. it doesn’t handle properly the brackets.
ParseExpressions::ParseExpr { (1) + ((2) + (3)) } { }
returns
+ [+ 1 ((2)] (3))
while it should return
+ [+ 1 2] 3
Also
ParseExpressions::ParseExpr { {1 2} + {3 4} } {}
returns
+ 1 2 3 4
while it should return
+ {1 2} {3 4}
So basically I am asking for a robust version of this utility.
Why don’t you try this: http://wiki.tcl.tk/11415
or something like this too: http://wiki.tcl.tk/13885
I hope these are easy to use alternatives for the mentioned utility.