Csound Csound-dev Csound-tekno Search About

[Csnd] Parser behavior

Date2012-09-16 15:03
FromLouis Cohen
Subject[Csnd] Parser behavior
Hi, everyone,

I just began using a current version of Csound (5.17), hence the new  
parser. Of course I'm getting some syntax errors with code that worked  
OK with the old parser, and it's actually helping me to clean up my  
code.

But I was wondering about this:

if()then
	;remark
endif

The parser treats this as a fatal error - "nonexistent statement in  
conditional" or something similar. I'm grateful to have the parser  
show me some inefficient code, but I wonder whether this code should  
be treated as a fatal error. Isn't this a legal construct?

-Lou Cohen


Date2012-09-16 15:27
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Parser behavior
I suspect that there is no definition of an empty statement.  I suspect it
could be changed in this case, but I rather expected it to indicate an
error, or at least very odd behaviour

I am open to discussion.

btw the latest version is 5.18.02

==John
> Hi, everyone,
>
> I just began using a current version of Csound (5.17), hence the new
> parser. Of course I'm getting some syntax errors with code that worked
> OK with the old parser, and it's actually helping me to clean up my
> code.
>
> But I was wondering about this:
>
> if()then
> 	;remark
> endif
>
> The parser treats this as a fatal error - "nonexistent statement in
> conditional" or something similar. I'm grateful to have the parser
> show me some inefficient code, but I wonder whether this code should
> be treated as a fatal error. Isn't this a legal construct?
>
> -Lou Cohen
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>
>



Date2012-09-16 19:22
FromLouis Cohen
SubjectRe: [Csnd] Parser behavior
John,

Thanks for your response. Based on my experience with Java and the  
Netbeans compiler, the only other language I use these days, an empty  
statement gets a warning but is not fatal.

I think I prefer that empty statements not be fatal. I often comment  
out a line of code when I'm trying a new idea. By commenting it out, I  
can conveniently bring it back just deleting the semicolon. Then I  
don't have to reconstruct the statement, which could invite an error.

I'm guessing that in the case of Csound not all empty statements are  
fatal; just the ones that cause the inside of an if statement to be  
empty? If so, I can easily live with it even though I prefer  
otherwise. The way I dealt with the problem today was simply to  
comment out all the lines from "if...." to "endif". In that way I can  
easily revive the statement if I need to.

-Lou

PS: about the latest version of Csound, I just made the jump from OSX  
10.5.8 to OSX 10.8. I downloaded what was the latest version of Csound  
at the time and then promptly took ill. As I slowly recover, my first  
project is to simply get my important csd's running in the new  
environment. I figured that Csound 5.17 would be good enough for that.  
If you think it's important for me to upgrade to 5.18 right away,  
please let me know.



On Sep 16, 2012, at 10:27 AM, jpff@cs.bath.ac.uk wrote:

> I suspect that there is no definition of an empty statement.  I  
> suspect it
> could be changed in this case, but I rather expected it to indicate an
> error, or at least very odd behaviour
>
> I am open to discussion.
>
> btw the latest version is 5.18.02
>
> ==John
>> Hi, everyone,
>>
>> I just began using a current version of Csound (5.17), hence the new
>> parser. Of course I'm getting some syntax errors with code that  
>> worked
>> OK with the old parser, and it's actually helping me to clean up my
>> code.
>>
>> But I was wondering about this:
>>
>> if()then
>> 	;remark
>> endif
>>
>> The parser treats this as a fatal error - "nonexistent statement in
>> conditional" or something similar. I'm grateful to have the parser
>> show me some inefficient code, but I wonder whether this code should
>> be treated as a fatal error. Isn't this a legal construct?
>>
>> -Lou Cohen
>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/? 
>> group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe
>> csound"
>>
>>
>>
>>
>
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"
>


Date2012-09-16 19:51
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Parser behavior
Code very easy to change; need to check with the author of that section to
see if there is something I have missed
==John

>
> Thanks for your response. Based on my experience with Java and the
> Netbeans compiler, the only other language I use these days, an empty
> statement gets a warning but is not fatal.
>
> I think I prefer that empty statements not be fatal. I often comment
> out a line of code when I'm trying a new idea. By commenting it out, I
> can conveniently bring it back just deleting the semicolon. Then I
> don't have to reconstruct the statement, which could invite an error.
>
> I'm guessing that in the case of Csound not all empty statements are
> fatal; just the ones that cause the inside of an if statement to be
> empty? If so, I can easily live with it even though I prefer
> otherwise. The way I dealt with the problem today was simply to
> comment out all the lines from "if...." to "endif". In that way I can
> easily revive the statement if I need to.
>
> -Lou
>
> PS: about the latest version of Csound, I just made the jump from OSX
> 10.5.8 to OSX 10.8. I downloaded what was the latest version of Csound
> at the time and then promptly took ill. As I slowly recover, my first
> project is to simply get my important csd's running in the new
> environment. I figured that Csound 5.17 would be good enough for that.
> If you think it's important for me to upgrade to 5.18 right away,
> please let me know.
>
>
>
> On Sep 16, 2012, at 10:27 AM, jpff@cs.bath.ac.uk wrote:
>
>> I suspect that there is no definition of an empty statement.  I
>> suspect it
>> could be changed in this case, but I rather expected it to indicate an
>> error, or at least very odd behaviour
>>
>> I am open to discussion.
>>
>> btw the latest version is 5.18.02
>>
>> ==John
>>> Hi, everyone,
>>>
>>> I just began using a current version of Csound (5.17), hence the new
>>> parser. Of course I'm getting some syntax errors with code that
>>> worked
>>> OK with the old parser, and it's actually helping me to clean up my
>>> code.
>>>
>>> But I was wondering about this:
>>>
>>> if()then
>>> 	;remark
>>> endif
>>>
>>> The parser treats this as a fatal error - "nonexistent statement in
>>> conditional" or something similar. I'm grateful to have the parser
>>> show me some inefficient code, but I wonder whether this code should
>>> be treated as a fatal error. Isn't this a legal construct?
>>>
>>> -Lou Cohen
>>>



Date2012-09-17 09:14
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Parser behavior
Checked into git.  Still needs a little more testing


> Code very easy to change; need to check with the author of that section to
> see if there is something I have missed
> ==John
>
>>
>> Thanks for your response. Based on my experience with Java and the
>> Netbeans compiler, the only other language I use these days, an empty
>> statement gets a warning but is not fatal.
>>
>> I think I prefer that empty statements not be fatal. I often comment
>> out a line of code when I'm trying a new idea. By commenting it out, I
>> can conveniently bring it back just deleting the semicolon. Then I
>> don't have to reconstruct the statement, which could invite an error.
>>
>> I'm guessing that in the case of Csound not all empty statements are
>> fatal; just the ones that cause the inside of an if statement to be
>> empty? If so, I can easily live with it even though I prefer
>> otherwise. The way I dealt with the problem today was simply to
>> comment out all the lines from "if...." to "endif". In that way I can
>> easily revive the statement if I need to.
>>
>> -Lou
>>
>> PS: about the latest version of Csound, I just made the jump from OSX
>> 10.5.8 to OSX 10.8. I downloaded what was the latest version of Csound
>> at the time and then promptly took ill. As I slowly recover, my first
>> project is to simply get my important csd's running in the new
>> environment. I figured that Csound 5.17 would be good enough for that.
>> If you think it's important for me to upgrade to 5.18 right away,
>> please let me know.
>>
>>
>>
>> On Sep 16, 2012, at 10:27 AM, jpff@cs.bath.ac.uk wrote:
>>
>>> I suspect that there is no definition of an empty statement.  I
>>> suspect it
>>> could be changed in this case, but I rather expected it to indicate an
>>> error, or at least very odd behaviour
>>>
>>> I am open to discussion.
>>>
>>> btw the latest version is 5.18.02
>>>
>>> ==John
>>>> Hi, everyone,
>>>>
>>>> I just began using a current version of Csound (5.17), hence the new
>>>> parser. Of course I'm getting some syntax errors with code that
>>>> worked
>>>> OK with the old parser, and it's actually helping me to clean up my
>>>> code.
>>>>
>>>> But I was wondering about this:
>>>>
>>>> if()then
>>>> 	;remark
>>>> endif
>>>>
>>>> The parser treats this as a fatal error - "nonexistent statement in
>>>> conditional" or something similar. I'm grateful to have the parser
>>>> show me some inefficient code, but I wonder whether this code should
>>>> be treated as a fatal error. Isn't this a legal construct?
>>>>
>>>> -Lou Cohen
>>>>
>
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>
>



Date2012-09-17 14:15
FromLouis Cohen
SubjectRe: [Csnd] Parser behavior
Thanks, John!

best,
Lou Cohen

On Sep 17, 2012, at 4:14 AM, jpff@cs.bath.ac.uk wrote:

> Checked into git.  Still needs a little more testing
>
>
>> Code very easy to change; need to check with the author of that  
>> section to
>> see if there is something I have missed
>> ==John
>>
>>>
>>> Thanks for your response. Based on my experience with Java and the
>>> Netbeans compiler, the only other language I use these days, an  
>>> empty
>>> statement gets a warning but is not fatal.
>>>
>>> I think I prefer that empty statements not be fatal. I often comment
>>> out a line of code when I'm trying a new idea. By commenting it  
>>> out, I
>>> can conveniently bring it back just deleting the semicolon. Then I
>>> don't have to reconstruct the statement, which could invite an  
>>> error.
>>>
>>> I'm guessing that in the case of Csound not all empty statements are
>>> fatal; just the ones that cause the inside of an if statement to be
>>> empty? If so, I can easily live with it even though I prefer
>>> otherwise. The way I dealt with the problem today was simply to
>>> comment out all the lines from "if...." to "endif". In that way I  
>>> can
>>> easily revive the statement if I need to.
>>>
>>> -Lou
>>>
>>> PS: about the latest version of Csound, I just made the jump from  
>>> OSX
>>> 10.5.8 to OSX 10.8. I downloaded what was the latest version of  
>>> Csound
>>> at the time and then promptly took ill. As I slowly recover, my  
>>> first
>>> project is to simply get my important csd's running in the new
>>> environment. I figured that Csound 5.17 would be good enough for  
>>> that.
>>> If you think it's important for me to upgrade to 5.18 right away,
>>> please let me know.
>>>
>>>
>>>
>>> On Sep 16, 2012, at 10:27 AM, jpff@cs.bath.ac.uk wrote:
>>>
>>>> I suspect that there is no definition of an empty statement.  I
>>>> suspect it
>>>> could be changed in this case, but I rather expected it to  
>>>> indicate an
>>>> error, or at least very odd behaviour
>>>>
>>>> I am open to discussion.
>>>>
>>>> btw the latest version is 5.18.02
>>>>
>>>> ==John
>>>>> Hi, everyone,
>>>>>
>>>>> I just began using a current version of Csound (5.17), hence the  
>>>>> new
>>>>> parser. Of course I'm getting some syntax errors with code that
>>>>> worked
>>>>> OK with the old parser, and it's actually helping me to clean up  
>>>>> my
>>>>> code.
>>>>>
>>>>> But I was wondering about this:
>>>>>
>>>>> if()then
>>>>> 	;remark
>>>>> endif
>>>>>
>>>>> The parser treats this as a fatal error - "nonexistent statement  
>>>>> in
>>>>> conditional" or something similar. I'm grateful to have the parser
>>>>> show me some inefficient code, but I wonder whether this code  
>>>>> should
>>>>> be treated as a fatal error. Isn't this a legal construct?
>>>>>
>>>>> -Lou Cohen
>>>>>
>>
>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/? 
>> group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe
>> csound"
>>
>>
>>
>>
>
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"
>