[icon]

GNU LilyPond

Welcome to the home of the GNU Music Typesetter

What is LilyPond
General information
Simple examples
Complex examples
Download
GNU/Linux binaries
Windows
Source code
Documentation
Tutorial
Manual
Glossary
other ...

Support
Mailing lists
Search
WikiWiki
FAQs

External sites
lilypond.org/development
lilypond.org/stable
ftp.lilypond.org
Mutopia
Other music online

Node:Assignments, Next:, Previous:Manipulating music expressions, Up:Syntactic details



Assignments

Identifiers allow objects to be assigned to names during the parse stage. To assign an identifier, you use name=value and to refer to an identifier, you precede its name with a backslash: `\name'. value is any valid Scheme value or any of the input-types listed above. Identifier assignments can appear at top level in the LilyPond file, but also in \paper blocks.

An identifier can be created with any string for its name, but you will only be able to refer to identifiers whose names begin with a letter, being entirely alphabetical. It is impossible to refer to an identifier whose name is the same as the name of a keyword.

The right hand side of an identifier assignment is parsed completely before the assignment is done, so it is allowed to redefine an identifier in terms of its old value, e.g.

foo = \foo * 2.0

When an identifier is referenced, the information it points to is copied. For this reason, an identifier reference must always be the first item in a block.

\paper  {
  foo = 1.0
  \paperIdent % wrong and invalid
}

\paper {
  \paperIdent % correct
  foo = 1.0 }
Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to lilypond@packages.debian.org

Copyright (c) 1997--2001 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.4.12 (stable-branch) by

Anthony Fok <lilypond@packages.debian.org>, Tue Mar 12 01:35:39 2002 HKT.