Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] one issue with variable names not allowed to meet opcode names in CS7

Victor Lazzarini <[email protected]>
Newsgroups gmane.comp.audio.csound.devel
Message-ID <[email protected]>
That's not exactly a rule, but a side effect of having all opcode names as read-only variables. 

When we introduced the opcode ref type, we thought it was a good idea to make all relevant opcodes variables so they can be used without any extra annotation.

The downside is that variables cannot be redefined and so if you try to use them for anything else you will get a syntax error.

It may be possible to look at supporting redefinition - not sure how hard that is or if it is possible without breaking stuff.

The other alternative is not to have these opcode variables in the system. The result is that to use an opcode ref we would need to declare a variable first.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 18 Aug 2025, at 14:44, joachim heintz <[email protected]> wrote:
> 
> *Warning*
> 
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 
> it is really big fun to work in CS7 --- great work done by victor and
> the others!!!
> 
> i would like to mention here one minor and one major issue for the
> current rule in CS7 that variable and instrument names are not allowed
> to use names of opcodes.
> 
> the minor issue: we have more than 1500 opcodes so it is a pity that
> many useful names like "start" and "play" are not possible.
> 
> but the major issue is this: when in future new opcodes are introduced,
> they will break existing code.  (e.g. i used the variable name "max_rec"
> and an opcode is introduced with this name.)
> 
> how do others look at this subject?
> 
> best -
>       joachim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.