lilypond-user
[Top][All Lists]
Advanced

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

Re: Mutable and immutable


From: David Kastrup
Subject: Re: Mutable and immutable
Date: Wed, 19 Aug 2015 06:38:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Andrew Bernard <address@hidden> writes:

> Greetings All,
>
> Since immutable as an adjective applied to an object in most
> programming languages, and in normal English usage means unchanging
> over time, or unable to be changed, how is it that the value of
> immutable objects can then be changed with \override and \revert? From
> the Technical Glossary:
>
> An immutable object is one whose state cannot be modified after
> creation, in contrast to a mutable object, which can be modified after
> creation.
>
> In LilyPond, immutable or shared properties define the default style
> and behavior of grobs. They are shared between many objects. In
> apparent contradiction to the name, they can be changed using
> \override and \revert.

LilyPond does not have immutable or mutable properties for grobs and
other entitities.  It has an immutable property list, and a mutable
property list.  Overrides work in the mutable property list, and the
mutable property list generally is consulted before the immutable one.

That being said, stuff like the grob type are not overridable with
consistent results: some functions working with it are only consulting
the immutable property list.

> In some Scheme code I am writing I am trying to change the line style
> of a TextSpanner:
>
> (ly:grob-set-property! grob 'style 'dotted-line)
>
> But the value remains unchanged after the call, with no error.

Unlikely.

-- 
David Kastrup



reply via email to

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