lilypond-user
[Top][All Lists]
Advanced

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

Re: Detecting null markup in Scheme


From: Graham King
Subject: Re: Detecting null markup in Scheme
Date: Mon, 04 Sep 2017 14:51:08 +0100

On Fri, 2017-09-01 at 20:35 +0200, David Kastrup wrote: 
> Graham King <address@hidden> writes:
> 
> > On Fri, 2017-09-01 at 19:06 +0200, David Kastrup wrote:
> >> 
> >> I'd just try (equal? markupContents "") here.  equal? can compare any
> >> objects for "equality", and at least "" as input should compare equal
> >> then.
> >> 
> > thanks David.  I'm getting "Missing or extra expression in (if (equal?
> > markupContents ""))"
> 
> Well, missing.  You have a condition but no expression to be evaluated
> depending on it.
> 
Thanks again David.  After a long struggle, I've got somewhere.  The 
result is probably inelegant enough to cause some sucking of teeth 
among the congnoscenti, but it works for me:

( if ( equal? #{ \markup #markupContents #}
                  #{ \markup { \concat { "" "" "" } } #} )
          #{ <> #}
          (case whereMarkup
             ((system) #{ \mark #markupContents #})
             ((staff)  #{ <>^   #markupContents #})
             (else     #{ \mark \markup \color #red #markupContents #})
    ))



reply via email to

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