lilypond-devel
[Top][All Lists]
Advanced

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

Re: hash/backslash confusion


From: Mark Polesky
Subject: Re: hash/backslash confusion
Date: Thu, 13 Aug 2009 09:37:14 -0700 (PDT)

Carl Sorensen wrote:

> Hope this helps.  It was instructional to me to write it.

Wow, thanks - that was a lot of info. I'm still trying to wrap my
brain around it. But in the meantime, I've noticed something else
confusing, and I'm wondering if you'd like to make any additional
comments on this.

I'm trying to figure it out, but it's still confusing. Any
elucidation would be helpful.
- Mark

\version "2.13.4"

%% procedure can be defined with "=" or scheme-style, and
%% scheme-defined procedure names can have non-alphabetic characters.

blanker =
#(lambda (grob grob-origin context)
   (if (and (memq 'note-head-interface (ly:grob-interfaces grob))
            (eq? (ly:grob-property grob 'staff-position) 0))
       (set! (ly:grob-property grob 'transparent) #t)))

#(define (blankerB grob grob-origin context)
   (if (and (memq 'note-head-interface (ly:grob-interfaces grob))
            (eq? (ly:grob-property grob 'staff-position) 0))
       (set! (ly:grob-property grob 'transparent) #t)))
       
#(define (blanker-2 grob grob-origin context)
   (if (and (memq 'note-head-interface (ly:grob-interfaces grob))
            (eq? (ly:grob-property grob 'staff-position) 0))
       (set! (ly:grob-property grob 'transparent) #t)))

% procedures can be dereferenced with either "#" or "\", but procedure
% names with non-alphabetic characters can only use "#".

\relative { e4 g8 \applyOutput #'Voice #blanker b d2 }
\relative { e4 g8 \applyOutput #'Voice \blanker b d2 }
\relative { e4 g8 \applyOutput #'Voice #blankerB b d2 }
\relative { e4 g8 \applyOutput #'Voice \blankerB b d2 }
\relative { e4 g8 \applyOutput #'Voice #blanker-2 b d2 }

% this won't work
% \relative { e4 g8 \applyOutput #'Voice \blanker-2 b d2 }


      




reply via email to

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