]> git.donarmstrong.com Git - lilypond.git/commit - scm/output-lib.scm
Removes pure-print-callbacks list.
authorMike Solomon <mike@apollinemike.com>
Wed, 20 Feb 2013 05:58:02 +0000 (06:58 +0100)
committerMike Solomon <mike@apollinemike.com>
Wed, 20 Feb 2013 05:58:02 +0000 (06:58 +0100)
commit3222fb83fafa4c760ad76e10e2b602a854906a6e
tree4db82d8a6e3cf27c5be160006a075566dde3d2a7
parentf88a78e145a26da1aaaf42eff75b42fc2271a589
Removes pure-print-callbacks list.

LilyPond currently hardcodes certain print functions as being able
to be evaluated as 'pure', meaning that they should not result in calls
to set_property, set_object, translate_axis or suicide.  This means that,
for example, if one uses a custom stencil function, the Y-extent function
for the grob must be wrapped in an unpure-pure-container in order
to return a non-empty pure_height.

The reading of these hardcoded lists results in difficult-to-maintain code.
For example, several (but not all) flag modification functions are part of
this list, causing spacing inconsistencies in certain regtests.
Using unpure-pure-containers to signify all relationships between unpure and
pure functions and eliminating the lists of pure functions in
define-grobs.scm allows the code base to be more extensible, demanding the
elaboration of unpure-pure relationships in the property-setting phase
(either in define-grobs.scm or in an override) and not using hardcoded lists.

Inversely, this also prevents deep that can creep up when a function
signified as pure turns out not to be.  For example, ly:note-head::print,
marked as pure, can be made unpure if its lookup of the style,
duration-log or glyph-name properties trigger vertical alignment
(which results in a call to translate_axis). Thus, users who wish to use
this function as an unpure function now can because it is no longer
hardcoded as pure.
scm/define-grobs.scm
scm/output-lib.scm