lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

set variable


From: Robert Kubosz
Subject: set variable
Date: Fri, 19 Feb 2021 21:21:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

Hello


The default way to override an existing variable in scheme is:

#(define foo 2)

#(set! foo 3)

#(display foo) %--> output is 3


I want to override the foo with use of another variable storing the foo's varname:


#(define foo 2)

#(define bar 'foo) %variable storing the foo's varname

#(set! `,bar 3)  %I want here to override the foo variable with use of bar

#(display foo) %---> the expected by me output is 3


How can I do this?

Robert





reply via email to

[Prev in Thread] Current Thread [Next in Thread]