lilypond-user
[Top][All Lists]

## Re: simple scheme in lilypond

 From: Gianmaria Lari Subject: Re: simple scheme in lilypond Date: Wed, 28 Nov 2018 09:11:56 +0100

On Tue, 27 Nov 2018 at 12:12, David Kastrup <address@hidden> wrote:

> Probably these are very trivial things. Sorry to ask them but would like to
> understand.
>
> If I write (1):
>
>
> \version "2.19.82"
> \$(object->string (+ 3 2))
>
>
> Lilypond is happy and compile to a pdf file showing "5".
>
> Even this simpler code works... (2)
>
> \version "2.19.82"
> \$"Hello"
>
>
> and generate a pdf file showing "Hello".
>
> It is clear to me that \$ introduce a scheme _expression_ that is evaluated.
> And in the previous two examples the scheme code is evaluated to strings.
> But I don't understand why lilypond outputs them. If I write (3):
>
> \version "2.19.82"
> "Test"

blabla = "Test"
##f
\blabla

will compile again (sorry for the ##f : it is necessary to defeat

blabla = \markup "Test"
##f
\blabla

in output and in its effect on the variable.  Basically, \$x and \x are
the same (apart from the characters allowed in and after x).  The
logical thing would be to permit "Test" on its own but it appears rather
error-prone.

"... but it appears rather error prone" then lilypond forbid it. Is that right?
Wouldn't be better just a warning like when you make an assignment inside a conditional statement?

Thank you, g.