lilypond-user
[Top][All Lists]
Advanced

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

Re: Understanding Lilypond language


From: Harald Christiansen
Subject: Re: Understanding Lilypond language
Date: Mon, 07 Apr 2014 08:46:01 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Hello David,

Many thanks for your reply.  :-)

I was giving the variable example as a kind of difficulty I have. I
appreciate the "fish" you are giving to me but I want to learn "how to
fish" :-)

For example you say
"Because \layout { ... } is not a music expression but rather an output
definition. Different type. "

and then later on:

"There are no typed variables."

In my mind these two do not work together ... for me there is some
understanding missing.

And yes I found the Lilypond Extending manual but that still doesn't
explain properly the Lilypond language itself.

Regards.



On 04/06/2014 06:18 PM, David Kastrup wrote:
> Harald Christiansen <address@hidden> writes:
>
>> Hello,
>>
>> Is there a manual for the lilypond language itself ?
>>
>> I don't get it ... is it a programming language ... a macro expander ...
>> all of the above ?
> It is a dynamically typed language.  Not much programming in the
> language itself, but a Scheme layer caters for that and provides all the
> types.
>
> The command line processes an input file, and certain things like
> top-level music or scores cause actions.
>
>> I cannot build a mental model of how it works.
>>
>> For example, let's take variables. I take the notation reference, I look
>> at the index and I see several entries.
>>
>> One entry specifies:
>>
>> 3.1.5 File structure
>> [...]
>>
>> A variable, such as
>>
>>     foo = { c4 d e d }
>>
>> So far so good.
>>
>> Another entry:
>>
>> 3.3.2 Different editions from one source
>> [...]
>> Using variables
>>
>> allLyrics = \lyricmode {King of glo -- ry }
>>
>> Is this just a macro substitution ?
> No.  Neither is the above.  Both place a sequential music structure into
> the respective variables.  Use
>
> \void \displayMusic \allLyrics
> \void \displayMusic \foo
>
> to see what's in there.
>
>> But then in one of my own I have to declare
>>
>> myLayout = \layout { <bla bla bla }
>>
>> even if \myLayout is used inside of a \layout section
> Because \layout { ... } is not a music expression but rather an output
> definition.  Different type.
>
>> So it seems that there is more going on but what ? Are the variables
>> typed ? (i.e. myLayout is of type \layout and I have to cast it or
>> declare it ? I don't get it)
> There are no typed variables.  Types are associated with expressions
> rather than variables: that's what using a dynamically typed language
> like Scheme is about.  So there is no point in declaring a variable.
> Its type is determined by what you place in there.
>
>> I understand that at some level underneath lilypond uses Scheme
>> (Guile) but how specifically ?
>>
>> e.g. 
>> \set Staff.printPartCombineTexts = ##f
>>
>> The way I guess this is: '#f' is the false atom, the first # switches
>> to Guile interpretation ... but beyond this all is completely foggy.
> Check out the red manual.
>
> <URL:http://lilypond.org/doc/v2.19/Documentation/extending/scheme-in-lilypond>
>


-- 
Nihil verus. Omnia possibilia.




reply via email to

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