|
From: | Paolo Prete |
Subject: | Re: Question about Scheme's syntax |
Date: | Thu, 5 Sep 2024 13:37:18 +0200 |
Paolo Prete <paolopr976@gmail.com> writes:
> Hello,
>
> Given:
>
> floating-markup = #(define-scheme-function (parser location x y obj)
> (number? number? scheme?)
> #{
> \markup \with-dimensions #'(0 . 0) #'(0
> . 0){
> \override #'(baseline-skip . 0)
> \translate #(cons x y)
> #obj
> }
> #})
That makes no sense at all. Obviously #obj cannot be anything but a
markup here but you declare it as scheme? which just asks for obscure
runtime errors. Then there is no point in not using a markup command
here in the first place.
>
> I can invoke it with:
>
> \floating-markup 15 -60 "some string"
>
> But how can I pass to the same function the following _expression_: { \circle
> 5 } as #obj?
{ \circle 5 } is not a LilyPond _expression_. It is a fragment of markup.
You can turn it into a LilyPond _expression_ by writing
\markup { \circle 5 }
in which case you'll get out an actual markup. Outside of markup,
\circle is not defined.
> Something like (pseudo-syntax) :
>
> \floating-markup 15 -60 #{ \circle 5 #}
#{ ... #} is a Scheme construct, not a LilyPond _expression_. It is used
for using LilyPond syntax inside of a Scheme _expression_.
If you want to use it (in Scheme!) for writing in markup syntax, again
you need to enter markup mode by writing
#{ \markup ... #}
in a Scheme _expression_. If you are in LilyPond entry mode, you can just
write \markup ... instead.
--
David Kastrup
[Prev in Thread] | Current Thread | [Next in Thread] |