[Kst] if then else in equations?
Nicolas Brisset
nicolas.brisset at free.fr
Fri Oct 5 21:40:41 UTC 2012
Hi,
so, I've been looking at this a bit and it's more complex than I thought. The escan.l and eparse.y are not so much the issue, but rather:
1) how to regenerate the files we use in our build from those (Barth mentioned some manual patches...)?
2) to add a ternary node while being consistent with the rest requires more C++ fu than I currently have. The *Node classes seem to use design patterns. I know they exist, but I can't really say I'm familiar with them.
All in all, probably not worth the pain while there's the trick mentioned by Barth: (cond 1)*(expr 1) + (cond 2)*(expr 2). So I think I'll move on to something else...
I just wanted to mention it in case anyone is holding his breath!
Nicolas
----- Mail original -----
> De: "Nicolas Brisset" <nicolas.brisset at free.fr>
> À: kst at kde.org
> Envoyé: Jeudi 20 Septembre 2012 21:04:40
> Objet: Re: [Kst] if then else in equations?
>
> Hi Matt,
>
> > Back when George switched to yacc/bison, I thought my favorite
> > operator, ?:, was added. I do recall George sending out an email
> > asking which operators should be added and I can’t believe I would
> > have forgotten the ternary operator. Then again, maybe there is a
> > reason it wasn't added? If not, this is what is needed here.
> I just tried "([Phi (V2)]>0) ? [Phi (V2)] : 0" and it does not work.
> Maybe it's just a syntax issue, but I'd have thought this should work
> :-(
>
> Nicolas
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>
More information about the Kst
mailing list