Else blocks

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Else blocks

Steven Yi
Hi All,

There seems to be an issue with else blocks, that they seem to get
called regardless of if they should or not.  I put together a
tieStatus UDO here:

http://www.kunstmusik.com/udo/displayOpcode.php?opcode_id=53

And in the example, if you change the last elseif statement to an
else, the UDO will always return -1.

Any chance to take a look would be appreciated!
steven


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: Else blocks

Istvan Varga
Steven Yi wrote:

> And in the example, if you change the last elseif statement to an
> else, the UDO will always return -1.
>
> Any chance to take a look would be appreciated!

The else branch is always executed at i-time, as a result of a fix by
Matt Ingalls that attempted to work around the problem of the else branch
sometimes not being called at i-time. For i-time only code, you can use
'ithen' instead of 'then': this will do what you expect at init time,
however, it will always execute the "else" branch at performance time
and never any of the "if" or "elseif" branches.


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: Else blocks

Steven Yi
Hi Istvan,

Thanks for that explanation.  That is incredibly strange behavior, but
at least the workaround is perfectly simple.  Thanks!

steven


On 8/4/05, Istvan Varga <[hidden email]> wrote:

> Steven Yi wrote:
>
> > And in the example, if you change the last elseif statement to an
> > else, the UDO will always return -1.
> >
> > Any chance to take a look would be appreciated!
>
> The else branch is always executed at i-time, as a result of a fix by
> Matt Ingalls that attempted to work around the problem of the else branch
> sometimes not being called at i-time. For i-time only code, you can use
> 'ithen' instead of 'then': this will do what you expect at init time,
> however, it will always execute the "else" branch at performance time
> and never any of the "if" or "elseif" branches.
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Csound-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: Else blocks

matt ingalls-3
In reply to this post by Istvan Varga
that does sound like a bug in the 'else' opcode
if the conditional uses all i-rate values,
  it is supposed to act like an 'ithen'

-m@
________________________
           matt  ingalls
http://sfsound.org/matt.html

On Aug 4, 2005, at 9:14 AM, Istvan Varga wrote:

> Steven Yi wrote:
>
>
>> And in the example, if you change the last elseif statement to an
>> else, the UDO will always return -1.
>> Any chance to take a look would be appreciated!
>>
>
> The else branch is always executed at i-time, as a result of a fix by
> Matt Ingalls that attempted to work around the problem of the else  
> branch
> sometimes not being called at i-time. For i-time only code, you can  
> use
> 'ithen' instead of 'then': this will do what you expect at init time,
> however, it will always execute the "else" branch at performance time
> and never any of the "if" or "elseif" branches.
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle  
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams *  
> Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/ 
> bsce5sf
> _______________________________________________
> Csound-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel
Reply | Threaded
Open this post in threaded view
|

Re: Else blocks

Matt Ingalls
In reply to this post by Steven Yi
hey steven,

i took a closer look at this and it is NOT a bug!

the unexpected result we are seeing is due to pfields
in the conditional.  if you take away the pfields,
it works as expected.  i guess it's because pfields cannot be "inlined"
or something, and so the conditional is not flagged as i-rate.

and so using 'ithen' is the proper thing to do in this instance.

Matt;
________________________
           matt  ingalls
http://sonomatics.com

On Aug 4, 2005, at 9:28 AM, Steven Yi wrote:

> Hi Istvan,
>
> Thanks for that explanation.  That is incredibly strange behavior, but
> at least the workaround is perfectly simple.  Thanks!
>
> steven
>
>
> On 8/4/05, Istvan Varga <[hidden email]> wrote:
>
>> Steven Yi wrote:
>>
>>
>>> And in the example, if you change the last elseif statement to an
>>> else, the UDO will always return -1.
>>>
>>> Any chance to take a look would be appreciated!
>>>
>>
>> The else branch is always executed at i-time, as a result of a fix by
>> Matt Ingalls that attempted to work around the problem of the else  
>> branch
>> sometimes not being called at i-time. For i-time only code, you  
>> can use
>> 'ithen' instead of 'then': this will do what you expect at init time,
>> however, it will always execute the "else" branch at performance time
>> and never any of the "if" or "elseif" branches.
>>
>>
>> -------------------------------------------------------
>> SF.Net email is Sponsored by the Better Software Conference & EXPO
>> September 19-22, 2005 * San Francisco, CA * Development Lifecycle  
>> Practices
>> Agile & Plan-Driven Development * Managing Projects & Teams *  
>> Testing & QA
>> Security * Process Improvement & Measurement * http://www.sqe.com/ 
>> bsce5sf
>> _______________________________________________
>> Csound-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle  
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams *  
> Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/ 
> bsce5sf
> _______________________________________________
> Csound-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Csound-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-devel