lilypond-devel
[Top][All Lists]
Advanced

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

Re: Allow quoted strings as Scheme arguments to markup commands (issue 3


From: dak
Subject: Re: Allow quoted strings as Scheme arguments to markup commands (issue 331820043 by address@hidden)
Date: Sat, 07 Oct 2017 01:05:20 -0700

On 2017/10/06 22:28:38, thomasmorley651 wrote:

One could probably do something at the lines of:

Accordion registers missing.  Should we consider them a separate name
space?

(pretty-print
   (sort
     (map car
       (filter
         (lambda (x)
           (let* ((predicates (markup-command-signature (cdr x))))
             (and predicates
                  (pair? predicates)
                (eq?
                  (procedure-name string?)
                  (car (map procedure-name predicates))))))

Seriously?

For one thing, (car (map procedure-name predicates)) is costly,
calculating all names and throwing away all but the first one.  You
could have written (procedure-name (car predicates)) instead.  For
another, why not just compare (eq? string? (car predicates)) instead of
trying to look up the name?  It isn't needed, is it?  I mean, ok ok,
this is a run-once piece of code.

         (ly:module->alist (resolve-module '(lily)))))
     symbol<?))

->
  (fret-diagram-markup
   fret-diagram-terse-markup
   harp-pedal-markup
   justify-string-markup
   lookup-markup
   musicglyph-markup
   postscript-markup
   rest-markup
   simple-markup
   tied-lyric-markup
   verbatim-file-markup
   with-url-markup
   wordwrap-string-markup)

Well, yeah.  That looks like a reasonable list.  I think I'll leave out
rest-markup here since there is some impetus to change it akin to \note
and it's not clear how this will go yet.  And \rest can occur outside of
markup, so the #" is a pretty obvious marker that we are dealing with
the markup.

https://codereview.appspot.com/331820043/



reply via email to

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