[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: function help
From: |
Thomas Morley |
Subject: |
Re: function help |
Date: |
Tue, 21 Jun 2016 21:28:41 +0200 |
2016-06-21 20:44 GMT+02:00 David Kastrup <address@hidden>:
> No Body <address@hidden> writes:
>
>> Wow! Works great, thanks Thomas. I like the second version using the
>> lilypond #{#} ---- I can easily add markup for font, etc. Added a
>> string-reverse to get correct order. I read "extending" several times,
>> skimmed thru "internals", guile manual and R5RS and have been working on
>> this in my spare time for a week --- thanks.
>>
>> I realize that make-circle-markup is part of lilypond and not Guile, but is
>> there a way I could have known about that and possibly other useful funcs?
>> I realized from the error messages that I needed markup, but just couldn't
>> figure out how to get it.
>>
>> Also, is the "#:" in "#:circle" a naming convention or dereferencer or
>> what? Is there somewhere to look that up? I don't have much of an
>> understanding about this.
>
> There is a Scheme macro in LilyPond called "markup" and it uses these
> "keywords" for making a sort-of markup-similar pseudo-syntax in Scheme.
> It predates the existence of the #{ \markup ... #} construct and is
> likely marginally faster. Historically, the use of Scheme variables,
> particularly let-bound variables, inside of #{ ... #} also was sort-of
> shaky.
>
> These days there is very little point in learning to juggle with the
> markup macro. The also existing make-...-markup functions work
> perfectly well and without all the macro quirks in Scheme, and
> #{ \markup ... #} is not merely so-so similar to markup syntax but
> identical. Between the two, there is just no reasonable amount of
> ground covered by the markup macro. And #{ \markup ... #} works well
> enough to really just forget about Scheme syntax altogether.
>
> --
> David Kastrup
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.
$(markup #:column ("a" "b"))
works, but feels strange:
("a" "b") looks like a function call without procedure what to do.
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")
?
Thanks,
Harm