[Kst] if then else in equations?

Truch, Matthew - 0775 - MITLL matthew.truch at ll.mit.edu
Thu Sep 20 16:21:41 UTC 2012


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.

http://en.wikipedia.org/wiki/%3F:

Matthew Truch
Group 75
MIT Lincoln Lab
781-981-2773
matthew.truch at ll.mit.edu

From: kst-bounces at kde.org [mailto:kst-bounces at kde.org] On Behalf Of Barth Netterfield
Sent: Thursday, September 20, 2012 11:35 AM
To: kst at kde.org
Subject: Re: [Kst] if then else in equations?

We don't have if/else/elseif and I don't currently have plans for it - mostly since I've never come up with a situation in equations where you couldn't do it with the comparison operators.

You can submit a wishlist, of course :-)

As to how hard it would be to add it?  Well - George replaced my hand-rolled parser years and years ago with a yacc parser, so I would have to learn yacc/bison whatever, and then see how hard it would be to add it.

cbn


On Thu, Sep 20, 2012 at 11:11 AM, Brisset, Nicolas <Nicolas.Brisset at eurocopter.com> wrote:
Hi Barth,

OK, you’re right. That would do it.
Now, don’t misunderstand my previous message: this was just an example ☺ There are many cases and they can probably not always be handled like that. Plus, it’s not very “discoverable”. And doesn’t handle if / elseif / else constructs…
So, do we have if / then / else (or even better if / elseif / else /), or plans to add that in any non-geeky way?

Nicolas

Von: kst-bounces at kde.org [mailto:kst-bounces at kde.org] Im Auftrag von Barth Netterfield
Gesendet: Donnerstag, 20. September 2012 16:57
An: kst at kde.org
Betreff: Re: [Kst] if then else in equations?

([V1]>180)*([(V1)]-360) + ([V1]<=180)*[(V1)]
On Thu, Sep 20, 2012 at 10:45 AM, Brisset, Nicolas <Nicolas.Brisset at eurocopter.com> wrote:
Hi,

one stupid little question: is there a possibility to use an if / then / else construct in equations?
I’d like to do something like if ([Vector1 (V1)] > 180) then [Vector1 (V1)]-360 else [Vector1 (V1)]

Thanks for any hints. If there’s no way to do that, we should consider adding it to the parser. No idea how difficult that would be though.

Nicolas

EUROCOPTER DEUTSCHLAND GmbH
Sitz der Gesellschaft / Registered Office: Donauwörth
Registergericht / Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates / Chairman of the Supervisory Board: Dr. Lutz Bertling
Geschäftsführung / Board of Management:
Dr. Wolfgang Schoder, Vorsitzender / CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt



CONFIDENTIALITY NOTICE

This communication and the information it contains is intended for the addressee ( s ) named above and for no other persons or organizations.
It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication
or any part of it is prohibited and may be unlawful.
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication.
Thank you very much.
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses
or other material which might be introduced with this message.

_______________________________________________
Kst mailing list
Kst at kde.org
https://mail.kde.org/mailman/listinfo/kst




--
C. Barth Netterfield
University of Toronto
416-845-0946




More information about the Kst mailing list