lilypond-user
[Top][All Lists]
Advanced

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

Re: Termination of variable definitions


From: Thomas Morley
Subject: Re: Termination of variable definitions
Date: Tue, 19 Apr 2016 22:46:44 +0200

2016-04-19 21:31 GMT+02:00 David Sumbler <address@hidden>:
> On Tue, 2016-04-19 at 20:51 +0200, David Kastrup wrote:
>> David Sumbler <address@hidden> writes:
>>
>> > In starting to experiment with selective compilation using includes
>> > and/or the $(if condition action) structure provided by David Kastrup, I
>> > found that there is something very, very basic that I have never really
>> > understood.
>> >
>> > So at the risk of embarrassing myself, I should be grateful if somebody
>> > would explain the following: how does Lilypond recognize the end of a
>> > variable definition?
>>
>> One expression.
[...]
> Also from the documentation we have:
>
> width = 4.5\cm

\cm is valid only _in_ \paper
cm is defined in paper.scm iirc.
Or look at the output of
#(write-me "cm: "
  (assoc-get 'cm (ly:module->alist (ly:output-def-scope $defaultpaper))))
Equivalent to #(define width (* 4.5 cm)) (explained in NR).
So _one_ expression.

> name = "Wendy"
"Wendy" is a string in the guile-sense of it.
One expression.
If you want to know more about strings refer to the guile-manual

> aFivePaper = \paper { paperheight = 21.0 \cm }
\paper is an #< Output_def> containing settings which can be made visible with
#(pretty-print (ly:module->alist (ly:output-def-scope $defaultpaper)))
The minimal content of a fresh \paper is an empty list (for your
custom-settings) thus \paper without anything is not a finished
expression.
But \paper {} is _one_ expression.

[...]
>
> Am I alone in finding the functioning of variable definition slightly
> less than obvious?
>
> David


I'm aware that my above wording disregards some aspects and as an
explanation, it is far from any completeness by any means. Furthermore
it will likely lead to more questions ...

Though, should we really go for explaining everything in detail? I
guess the length of our docs would explode by a factor of ten (at
least).

Yes, sometimes our docs could be better, if you can point to something
worth to be improved, please write a bug-report.
But in this case I don't think
"Please explain in the docs what 'one expression' for defining
variables is supposed to be "
will have a chance.
Imagine we would cover every single but slightly different case, how
should this work out?

I can already hear people complaining: "TMI"


I know it's not the way for all, but (you know I'm not a programmer?)
I learned all I know from reading (post/mails/source-code) and trying
out things and sometimes doing real exercises (defining this and that,
just to get practise).

Ok, sometimes I read the docs, I have to admit. ;)
More, because they _have_ improved over times.

Cheers,
  Harm



reply via email to

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