lilypond-user
[Top][All Lists]
Advanced

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

Re: Lilypond structure / implicit - explicit / with statement


From: Bernard
Subject: Re: Lilypond structure / implicit - explicit / with statement
Date: Mon, 04 Apr 2016 12:46:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 03-04-16 22:56, David Kastrup wrote:
Bernard <address@hidden> writes:


Hi Paul,

That does help. I found out \with is a very special statement.
Not really.  \with can be part of other constructs, just like "else" can
be part of other constructs in many programming languages (including
Scheme).  It is not a "statement" at all.
That does help a lot. Now I understand why there can not be anything before /with.

It influence what happens before the statement, it must be executed
just after \new . That is the reason why my examples 4 and 5 did not
work.
And it influence what happens after the statement. If within the Staff
not a additional Staff property can be set.

No wonder it confuses me.
\with introduces "context modifications".  They are basic expressions in
that they can be stored in variables and passed to functions, but to
take effect, they need to be applied to an actually created context, and
there are various syntactic constructs for doing that.

They "influence what happens after the statement" like any modification
to anything.  Their influence is restricted to contexts they are applied
to (possibly via layout or context definitions or wrapped into other
context modifications).


I still do not get it all. By the way, I am my self a Python programmer and object orientation in known to me.

The example of Thomas Morly with his house with rooms is all in line with object orientation and setting values of properties.

But still I am missing something.

I have attached some more real live code using /with and and example I tried to skip the /with section and assign properties directly, which fails.

Thanks very much for all your good work.

With regards,

Bernard


Attachment: with_context.ly
Description: Text Data


reply via email to

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