<@U025J6SKFUH> Yes, the conflict between ternary o...
# xyce
e
@User Yes, the conflict between ternary operators and the “:” character is a problem, and (as long as we continue to use “:” as a separator) there isn’t a completely clean way to get around it. The easiest way to ensure that the colon is recognized as part of the ternary, and not a parameter name is via judicious use of parenthesis in the expression. But, more recently I modified the Xyce source to support using a period “.” as the separator rather than a colon. This modification is only in the development branch on github, and is enabled via the command line option “-hspice-ext”. The main commit that created this option is here: https://github.com/Xyce/Xyce/commit/e6daf0eac1856f2dd4f07bb2d2c2c9c3c7c779f3
I should mention that this conflict with ternary operators is likely to be the reason that most codes don’t use a colon as a separator. The original spice3 code did use the colon as a separator, which is the reason that we also did, years ago. But the expression support in spice3 was very limited, and I think didn’t include ternary operators. ngspice (derived from spice3, mostly) uses the period as a separator, and I’m guessing one reason (amongst others) was this issue.
So, probably where this is headed for us is to completely get rid of the colon as a separator and just use the period. The recent changes I made to the Xyce source (where the period can be used, as a non-default option) is an interim change.
r
Noted. I 100% agree with your assessment and the trajectory you all are taking. Just wanted to put a warning sign out for anyone else in the chat.
👍 1