lilypond-user
[Top][All Lists]
Advanced

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

Re: helper function that should take a list argument doesn't do anything


From: Janek Warchoł
Subject: Re: helper function that should take a list argument doesn't do anything
Date: Fri, 9 Nov 2012 23:09:30 +0100

On Thu, Nov 8, 2012 at 9:21 AM, David Kastrup <address@hidden> wrote:
> First, let's assume 2.16 (the current development version will not
> accept the above syntax of \overrideProperty even in the first variant).

Yes.  I haven't made the switch yet.

> Then inside of # itself, like with #'((alignement-distances ..., # has
> only Scheme meanings, like #t, #f, #(2 3 4) (a literal vector), #{
> ... #} (embedded LilyPond), #\? (a character constant).  #' is not
> anything it recognizes I think.

Well, i don't quite understand why

manualBeam =
#(define-music-function
     (parser location beg-end)
     (pair?)
   #{
     \once \override Beam #'positions = #beg-end
   #})

works then.  But nevermind, you don't have to explain this.
I'd just want to say that from a user's perspective it's very
frustrating that i cannot simply copy-and-paste some valid lilypond
code into #{ #} and have it work, especially when some similar code
works without any problems.
I hope that you know how to improve this situation somewhere in the future.

> Then you are writing a quoted list here.  Inside of a quoted list, _all_
> symbols are quoted, not referenced for their value.  So you need either
> to use proper evaluated Scheme here, like
> #(list (cons 'alignment-distances distances))

indeed, this works:

staffdist =
#(define-music-function (parser location distances)
                        (list?)
                        #{
                          \overrideProperty #"Score.NonMusicalPaperColumn"
                          #'line-break-system-details
                          #(list (cons 'alignment-distances distances))
                        #})

thank you!

> or quasi-quoting (backtick at the start, evaluated stuff with , before
> it), like
> #`((alignment-distances . ,distances))
> I am not entirely sure that . , is accepted, but if it isn't,
> #`((alignment-distances ,@distances))
> should do the trick instead (,@ is the list splicing operator, basically
> stripping one level of parens when inserting).

looks like black magic to me.
But nevertheless, thanks for your explanations; i do appreciate them.
Sorry for being grumpy - i'm frustrated with some other things, for
example the fact that all my data got deleted because of a script bug,
and the fact that the behaviour of 'rm' makes it very difficult to
recover anything.

thanks again and please forgive my grumpiness,
janek



reply via email to

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