lilypond-user
[Top][All Lists]
Advanced

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

Re: function help


From: David Kastrup
Subject: Re: function help
Date: Tue, 21 Jun 2016 21:48:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Thomas Morley <address@hidden> writes:

> David,
>
> while we're on it, there is one thing I don't understand myself sufficiently.
>
> Why does the first example below _not_ throw an error?
>
> \markup \column #(list "a" "b")
> $(markup #:column (list "a" "b"))
>
> I wrote previously that
> (markup #:column ...)
> expects a markup-list not a simple list, but isn't it the same with
> \markup \column ...
> ?
>
> Well, obviously not. The explanation escapes me, though.

A list of markups _is_ a valid markup-list.

> $(markup #:column ("a" "b"))
> works, but feels strange:
> ("a" "b") looks like a function call without procedure what to do.

Well, what did I say about the markup macro being quirky?

>From "Markup construction in Scheme":

Known issues and warnings
.........................

The markup-list argument of commands such as ‘#:line’, ‘#:center’, and
‘#:column’ cannot be a variable or the result of a function call.

     (markup #:line (function-that-returns-markups))

is invalid.  One should use the ‘make-line-markup’,
‘make-center-markup’, or ‘make-column-markup’ functions instead,

     (markup (make-line-markup (function-that-returns-markups)))

> You wrote something about "a sort-of markup-similar pseudo-syntax in Scheme" 
> ...
> May I assume that ("a" "b") in (markup #:column ("a" "b")) is
> something like (caution, pseudo-pseudo-code following):
> markup (column "a" "b")
> ?

Honestly?  I never quite understood the markup macro.  Its code gives me
a headache.  Which is part of the reason I never analyzed it
sufficiently to work on its rather flimsy documentation.

LilyPond's parser does not employ it at all (nor does it use the
make-...-markup functions even though some might be used by the parser's
constructors in scm/ly-syntax-constructors.scm).

-- 
David Kastrup



reply via email to

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