lilypond-user
[Top][All Lists]
Advanced

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

Re: Define variable only if it doesn't exist / is unbound


From: Simon Albrecht
Subject: Re: Define variable only if it doesn't exist / is unbound
Date: Sat, 30 Mar 2019 19:05:44 +0100

On 29.03.19 12:11, David Kastrup wrote:
Pedro Pessoa <address@hidden> writes:

Hello,
I want to init a variable only if it isn't bound. This seems a simple
matter, I was surpised I couldn't do it.
The thing is that it throws an 'unbound variable error' with anything I try.
I imagined something like:

%%% pseudo
#(define var
     (not (is-bound? var) 0))
%%%
var = 0

Does it need to be in Scheme?

The difference is that
var = 0
overwrites any previous binding, and I guess that’s what Pedro wanted to avoid. (?)

Best, Simon




reply via email to

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