LEFT | RIGHT |
1 @c -*- coding: utf-8; mode: texinfo; -*- | 1 @c -*- coding: utf-8; mode: texinfo; -*- |
2 @node Programming work | 2 @node Programming work |
3 @chapter Programming work | 3 @chapter Programming work |
4 | 4 |
5 @menu | 5 @menu |
6 * Overview of LilyPond architecture:: | 6 * Overview of LilyPond architecture:: |
7 * LilyPond programming languages:: | 7 * LilyPond programming languages:: |
8 * Programming without compiling:: | 8 * Programming without compiling:: |
9 * Finding functions:: | 9 * Finding functions:: |
10 * Code style:: | 10 * Code style:: |
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 | 1799 |
1800 | 1800 |
1801 @node Purity in LilyPond | 1801 @node Purity in LilyPond |
1802 @subsection Purity in LilyPond | 1802 @subsection Purity in LilyPond |
1803 Pure properties in LilyPond that do not have any @q{side effects}. | 1803 Pure properties in LilyPond that do not have any @q{side effects}. |
1804 That is, looking up a pure property should never result in calls to the | 1804 That is, looking up a pure property should never result in calls to the |
1805 following functions: | 1805 following functions: |
1806 @itemize | 1806 @itemize |
1807 @item @code{set_property} | 1807 @item @code{set_property} |
1808 @item @code{set_object} | 1808 @item @code{set_object} |
1809 @item @code{suicide} | 1809 @item @code{suicide} |
| 1810 @end itemize |
1810 This means that, if the property is calculated via a callback, this callback | 1811 This means that, if the property is calculated via a callback, this callback |
1811 must not only avoid the functions above but make sure that any functions | 1812 must not only avoid the functions above but make sure that any functions |
1812 it calls also avoid the functions above. Also, to date in LilyPond, a pure | 1813 it calls also avoid the functions above. Also, to date in LilyPond, a pure |
1813 function will always return the same value before line breaking (or, more | 1814 function will always return the same value before line breaking (or, more |
1814 precisely, before any version of @code{break_into_pieces} is called). This | 1815 precisely, before any version of @code{break_into_pieces} is called). This |
1815 convention makes it possible to cache pure functions and be more flexible | 1816 convention makes it possible to cache pure functions and be more flexible |
1816 about the order in which functions are called. For example; Stem #'length has | 1817 about the order in which functions are called. For example; Stem #'length has |
1817 a pure property that will @emph{never} trigger one of the functions listed | 1818 a pure property that will @emph{never} trigger one of the functions listed |
1818 above and will @emph{always} return the same value before line breaking, | 1819 above and will @emph{always} return the same value before line breaking, |
1819 independent of where it is called. Sometimes, this will be the actual length | 1820 independent of where it is called. Sometimes, this will be the actual length |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2645 #(display conditionalMark) | 2646 #(display conditionalMark) |
2646 @end example | 2647 @end example |
2647 | 2648 |
2648 noindent | 2649 noindent |
2649 inside the @file{.ly} file. | 2650 inside the @file{.ly} file. |
2650 | 2651 |
2651 The breakpoint failing may have to do with the call sequence. See | 2652 The breakpoint failing may have to do with the call sequence. See |
2652 @file{parser.yy}, run_music_function(). The function is called directly from | 2653 @file{parser.yy}, run_music_function(). The function is called directly from |
2653 C++, without going through the GUILE evaluator, so I think that is why | 2654 C++, without going through the GUILE evaluator, so I think that is why |
2654 there is no debugger trap. | 2655 there is no debugger trap. |
LEFT | RIGHT |