lilypond-user
[Top][All Lists]
Advanced

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

Re: reduce unbound within \context lambda


From: Aaron Hill
Subject: Re: reduce unbound within \context lambda
Date: Fri, 01 Mar 2019 18:44:40 -0800
User-agent: Roundcube Webmail/1.3.8

On 2019-03-01 6:40 pm, Aaron Hill wrote:
I encountered an unexpected error where reduce is unbound when
specifying a lambda within a \context block:

%%%%
\version "2.19.82"
\layout { \context { \Voice
  \override NoteHead.color = #(lambda (grob)
    (display (reduce + 0 '(1 2 3 4))) red)
} }
{ b'4 }
%%%%

Compare to the following snippets that work:

%%%%
\version "2.19.82"
{ \override NoteHead.color = #(lambda (grob)
    (display (reduce + 0 '(1 2 3 4))) red)
  b'4 }
%%%%
\version "2.19.82"
#(define (foo grob)
  (display (reduce + 0 '(1 2 3 4))) red)
\layout { \context { \Voice
  \override NoteHead.color = #foo
} }
{ b'4 }
%%%%

fold is also unbound, although map works fine.

Am I missing a subtlety here, or is this a bug?

I just tried another permutation and it appears to be the \layout block, not the \context block, that is affecting things. The following fails with the same error about reduce being unbound:

%%%%
\version "2.19.82"
\layout {
  #(define (foo grob)
    (display (reduce + 0 '(1 2 3 4))) red)
  \context { \Voice
    \override NoteHead.color = #foo
  }
}
{ b'4 }
%%%%

-- Aaron Hill



reply via email to

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