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

2019-03-30 Thread Pedro Pessoa
Yes, precisely. I'm sticking with the following for now: #(if (not (defined? 'foo)) (ly:parser-define! 'foo 47)) - Cheers, -- Pedro Pessoa -- Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html ___ lilypond-user mailing list

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

2019-03-30 Thread Simon Albrecht
On 29.03.19 12:11, David Kastrup wrote: Pedro Pessoa 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: %%%

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

2019-03-30 Thread Vaughan McAlley
> > Probably better get used to below: > > #(if (not (defined? 'foo)) (ly:parser-define! 'foo 47)) > > Cheers, > Harm > Thanks Harm, I gave up on being able to do that long ago. Vaughan ___ lilypond-user mailing list lilypond-user@gnu.org

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

2019-03-29 Thread David Kastrup
Pedro Pessoa 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

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

2019-03-29 Thread Thomas Morley
Am Fr., 29. März 2019 um 11:48 Uhr schrieb Aaron Hill : > > On 2019-03-29 3:37 am, Thomas Morley wrote: > > Am Fr., 29. März 2019 um 10:00 Uhr schrieb Richard Shann > > : > >> This sounds like a problem I had when Denemo started running under > >> Guile 2 - I asked on the guile mailing list and

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

2019-03-29 Thread Aaron Hill
On 2019-03-29 3:37 am, Thomas Morley wrote: Am Fr., 29. März 2019 um 10:00 Uhr schrieb Richard Shann : This sounds like a problem I had when Denemo started running under Guile 2 - I asked on the guile mailing list and got fixed up with this: ;;; for guile 2.0 compatibility define the

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

2019-03-29 Thread Thomas Morley
Am Fr., 29. März 2019 um 10:00 Uhr schrieb Richard Shann : > > On Thu, 2019-03-28 at 18:22 -0700, Aaron Hill wrote: > > On 2019-03-28 3:14 pm, Thomas Morley wrote: > > > Am Do., 28. März 2019 um 22:22 Uhr schrieb Aaron Hill > > > : > > > > > > > > On 2019-03-28 2:18 pm, Valentin Villenave wrote: >

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

2019-03-29 Thread Thomas Morley
Am Fr., 29. März 2019 um 02:23 Uhr schrieb Aaron Hill : > > On 2019-03-28 3:14 pm, Thomas Morley wrote: > > Am Do., 28. März 2019 um 22:22 Uhr schrieb Aaron Hill > > : > >> > >> On 2019-03-28 2:18 pm, Valentin Villenave wrote: > >> > On 3/28/19, Pedro Pessoa wrote: > >> >> I imagined something

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

2019-03-29 Thread Richard Shann
On Thu, 2019-03-28 at 18:22 -0700, Aaron Hill wrote: > On 2019-03-28 3:14 pm, Thomas Morley wrote: > > Am Do., 28. März 2019 um 22:22 Uhr schrieb Aaron Hill > > : > > > > > > On 2019-03-28 2:18 pm, Valentin Villenave wrote: > > > > On 3/28/19, Pedro Pessoa wrote: > > > > > I imagined something

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

2019-03-28 Thread Aaron Hill
On 2019-03-28 3:14 pm, Thomas Morley wrote: Am Do., 28. März 2019 um 22:22 Uhr schrieb Aaron Hill : On 2019-03-28 2:18 pm, Valentin Villenave wrote: > On 3/28/19, Pedro Pessoa wrote: >> I imagined something like: >> >> %%% pseudo >> #(define var >> (not (is-bound? var) 0)) >> %%% > > I’d

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

2019-03-28 Thread Pedro Pessoa
Thanks, this is it. -- Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user

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

2019-03-28 Thread Thomas Morley
Am Do., 28. März 2019 um 22:22 Uhr schrieb Aaron Hill : > > On 2019-03-28 2:18 pm, Valentin Villenave wrote: > > On 3/28/19, Pedro Pessoa wrote: > >> I imagined something like: > >> > >> %%% pseudo > >> #(define var > >> (not (is-bound? var) 0)) > >> %%% > > > > I’d probably probably do

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

2019-03-28 Thread Aaron Hill
On 2019-03-28 2:18 pm, Valentin Villenave wrote: On 3/28/19, Pedro Pessoa wrote: I imagined something like: %%% pseudo #(define var (not (is-bound? var) 0)) %%% I’d probably probably do something like (null? (ly:parser-lookup 'var)) But I’m sure there are better ways :-) (if

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

2019-03-28 Thread Valentin Villenave
On 3/28/19, Pedro Pessoa wrote: > I imagined something like: > > %%% pseudo > #(define var > (not (is-bound? var) 0)) > %%% I’d probably probably do something like (null? (ly:parser-lookup 'var)) But I’m sure there are better ways :-) Cheers, V.

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

2019-03-28 Thread Pedro Pessoa
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)) %%% Cheers, Pedro