lilypond-devel
[Top][All Lists]
Advanced

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

Re: Simplify define-markup-[list-]command-internal, (issue 545590045 by


From: David Kastrup
Subject: Re: Simplify define-markup-[list-]command-internal, (issue 545590045 by address@hidden)
Date: Sun, 16 Feb 2020 22:40:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Han-Wen Nienhuys <address@hidden> writes:

> On Sun, Feb 16, 2020 at 9:57 PM <address@hidden> wrote:
>
>> > In this commit, extra support for the case where command-and-args is
>> empty was added, ie.
>>
>> That characterisation is completely wrong.  The support is not for the
>> cases "where command-and-args is empty" but rather where
>> command-and-args is not a list but a single symbol.  Just like
>>
>> (define symbol value)
>> and
>> (define (symbol arg1 arg2) body...)
>>
>
> I'm trying to get the markup macros working with GUILE 2.x compilation,
> which means that all calls to module-define! have to go.
>
> As a prelude to that, I'm trying to understand what this code is trying to
> do.
>
> I don't think supporting
>
>   (define-markup-command sym1 sym2)
>
> is very useful, but if you really want to have this, it should be
> documented and tested.

It is not as much (define-markup-command sym1 sym2) rather than

(define-markup-command sym1 (markup-lambda (...))

where the markup-lambda expression is independently created.

This was supposed to be the implementation used in parser.yy for things
like

\markup big-red = \markup \big \with-color #red \etc

where defined name and definition are separate entities.  It turned out
that calling macros from C did not work well, so I instead I had to call
the non-macro internals.  It still made no sense scrapping that
functionality since it is similarly useful from Scheme where it looks
decidedly more natural than using the internals.

It would appear I am not alone in considering that useful:

git blame d03a3486639de982cfb6c6c315d76039bc5a0ac5 ly/markup-init.ly

shows Nicolas Sceaux already implementing this ability independently in
2006.

-- 
David Kastrup



reply via email to

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