Csound Csound-dev Csound-tekno Search About

Re: [Csnd] errors in macro with underscore

Date2018-10-25 08:07
FromAndreas Bergsland
SubjectRe: [Csnd] errors in macro with underscore

This code, however, gave a parsing error:

#define TEST(V)

#

i$Va = 2

print i$Va

#

 

instr       1

$TEST(1)

endin

 

It seems like the parser doesn’t like when macro arguments are followed by something other than space. Is this intended behavior of the parser?

Best,

Andreas

 

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Andreas Bergsland <andreas.bergsland@NTNU.NO>
Reply-To: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE>
Date: Thursday, 25 October 2018 at 08:49
To: "CSOUND@LISTSERV.HEANET.IE" <CSOUND@LISTSERV.HEANET.IE>
Subject: [Csnd] errors in macro with underscore

 

Hi

I had problems when revisiting a csd that used to run on 5.10. It turned out the errors were due to underscores in some of the macros, so that this code

 

#define TEST(V)

#

prints    "$V_"

#

 

instr       1

$TEST(1)

endin

 

would print

$error

 

 

When the underscore was replaced by other signs, it behaved as expected, e.g.

#define TEST(V)

#

prints    "$V-"

#

 

instr       1

$TEST(1)

endin

 

would print

1-

 

as expected

 

Best,

Andreas

 

-- 

Andreas Bergsland

 

Associate professor - førsteamanuensis

Study Programme Leader - studieprogramleder

Music Technology Programme - Musikkteknologiseksjonen

Department of Music - Institutt for musikk

Olavskvartalet

NTNU (Norwegian University of Science and Technology)

7491 Trondheim, NORWAY

 

Visiting address/besøksadresse: Fjordgt.1 (3.etg.)

e-mail: andreas.bergsland@ntnu.no

Office phone (Skype for business):7359 0096

Mobil: 4566 3316

http://folk.ntnu.no/andbe

https://www.vibra.no/

https://www.ntnu.edu/artec

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2018-10-25 08:12
FromAndreas Bergsland
SubjectRe: [Csnd] errors in macro with underscore

Sorry, forgot to inform that I’m on 6.12 (BTW congrats!!!) with OSX10.12.6

Andreas

 

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Andreas Bergsland <andreas.bergsland@NTNU.NO>
Reply-To: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE>
Date: Thursday, 25 October 2018 at 09:08
To: "CSOUND@LISTSERV.HEANET.IE" <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] errors in macro with underscore

 

This code, however, gave a parsing error:

#define TEST(V)

#

i$Va = 2

print i$Va

#

 

instr       1

$TEST(1)

endin

 

It seems like the parser doesn’t like when macro arguments are followed by something other than space. Is this intended behavior of the parser?

Best,

Andreas

 

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Andreas Bergsland <andreas.bergsland@NTNU.NO>
Reply-To: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE>
Date: Thursday, 25 October 2018 at 08:49
To: "CSOUND@LISTSERV.HEANET.IE" <CSOUND@LISTSERV.HEANET.IE>
Subject: [Csnd] errors in macro with underscore

 

Hi

I had problems when revisiting a csd that used to run on 5.10. It turned out the errors were due to underscores in some of the macros, so that this code

 

#define TEST(V)

#

prints    "$V_"

#

 

instr       1

$TEST(1)

endin

 

would print

$error

 

 

When the underscore was replaced by other signs, it behaved as expected, e.g.

#define TEST(V)

#

prints    "$V-"

#

 

instr       1

$TEST(1)

endin

 

would print

1-

 

as expected

 

Best,

Andreas

 

-- 

Andreas Bergsland

 

Associate professor - førsteamanuensis

Study Programme Leader - studieprogramleder

Music Technology Programme - Musikkteknologiseksjonen

Department of Music - Institutt for musikk

Olavskvartalet

NTNU (Norwegian University of Science and Technology)

7491 Trondheim, NORWAY

 

Visiting address/besøksadresse: Fjordgt.1 (3.etg.)

e-mail: andreas.bergsland@ntnu.no

Office phone (Skype for business):7359 0096

Mobil: 4566 3316

http://folk.ntnu.no/andbe

https://www.vibra.no/

https://www.ntnu.edu/artec

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here