| A bit of background on my considerable use of the conditional expression: my
main platform still being CsoundAV, CsoundAV lacks an if...then! It (and
event) were relatively recent additions (by Matt) to Csound4 that never made
it into AV (or at least hadn't the last time I looked).
Also, the conditional expression nicely suits simple situations; for these,
if...goto is cumbersome and overkill (as others have mentioned). One of my
coding goals is economy (as well as performability on as many varieties and
generations of Csound as possible).
Art Hunkins
----- Original Message -----
From: "David Akbari"
To:
Sent: Tuesday, October 25, 2005 10:33 AM
Subject: Re: [Csnd] Question Mark operator
>
> On Oct 25, 2005, at 9:22 AM, Dave Seidel wrote:
>
> > where the conditional statement is a boolean (i.e., evaluated to true
> > or false), and the other statements are executed based on how the
> > conditional statement is evaluated.
>
> I find this very interesting. I am not a programmer so I have not
> become acquainted with this until recently.
>
> What advantages (or disadvantages) does this technique (question mark
> as a conditional boolean expression) offer as opposed to:
>
> ex1
> ** if (gkoff == 1) kgoto somecode
> kgoto bypasscode
>
> ex2
> ** if (gkoff == 1) then
> somecode = something
> else
> somecode = 0
> endif
>
> ex3
> ** if (gkoff == 1) then
> somecode = something
> elseif (gkoff == 2) then
> othercode = otherthing
> elseif ...
> ... etc
> endif
>
> and also, how (if at all) is the question mark boolean expression
> implementation different in Csound5 than in previous versions?
>
>
> -David
>
> --
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk |