summaryrefslogtreecommitdiff
path: root/lily/context-mod-scheme.cc
Commit message (Collapse)AuthorAgeFilesLines
* Issue 4365: non-member unsmob<T> replaces T::unsmob and T::is_smobDan Eble2015-05-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Hide Smob_base<>::is_smob() to prevent the misleading situation of D::is_smob(S) returning true when S represents an ancestor of D rather than a D. This issue was previously worked around by overriding is_smob in several derived smob classes; that is no longer needed. LY_ASSERT_SMOB() now returns a smob pointer. This is not used yet, but is available for future use to avoid unsmobbing twice. Smob_base<>::smob_p() is hidden because there doesn't seem to be a need for it to be public. Files in lily/include were edited by hand. Files in lily itself were processed with the following sed script. s/\([A-Za-z_]\+\)::derived_unsmob/unsmob<\1>/g s/derived_unsmob *<\([A-Za-z_]\+\)>/unsmob<\1>/g s/\([A-Za-z_]\+\)::unsmob/unsmob<\1>/g s/\([A-Za-z_]\+\)::is_smob/unsmob<\1>/g s/Input \*\([A-Za-z_]\+\) = unsmob /Input *\1 = unsmob<Input> /g s/LY_ASSERT_SMOB (\([^)]*\))$/LY_ASSERT_SMOB (\1);/g
* Replace C++ (in)equality checks with proper SCM syntaxValentin Villenave2015-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit replaces the most straightforward situations where two SCM objects are compared. Here are the basic replacements used: x == y -------> scm_is_eq (x,y) x == SCM_BOOL_T -------> to_boolean (x) x == SCM_BOOL_F -------> scm_is_false (x) x != SCM_BOOL_T -------> scm_is_true (x) x == SCM_UNDEFINED -------> SCM_UNBNDP (x) x == SCM_EOL -------> scm_is_null (x) (scm_exact_p (x) == SCM_BOOL_T) -------> ly_is_rational (x) (scm_integer_p (x) == SCM_BOOL_T) -------> scm_is_integer (x) (scm_list_p (x) == SCM_BOOL_T) -------> ly_is_list (x) (scm_port_p (x) == SCM_BOOL_T) -------> ly_is_port (x) (scm_equal_p (x, y) == SCM_BOOL_T) -------> ly_is_equal (x,y) Finally, I replaced (!cached) with (!SCM_UNPACK (cached)) in lily-guile-macros.hh, as has been suggested once by David. Please note that this commit does not handle some situations I’m less comfortable with (namely those involving scm_c_memq, scm_assq or scm_hashq_get_handle), and some scm_*_p checks for which there isn’t a ly_is_* replacement yet (to wit, scm_hash_table_p, scm_promise_p, and scm_variable_bound_p). Those should be dealt with later (another patch is in the works).
* Run grand replace for 2015.Werner Lemberg2015-01-041-1/+1
|
* unsmob_pitch -> Pitch::unsmob and relatedDavid Kastrup2014-08-021-4/+4
| | | | | | | | | | | | | | This is part of moving away from implementing LilyPond infrastructure via the C preprocessor rather than C++ features since C++ features tend to be more transparent to IDEs, debuggers, editors, and newcomers. sed -i "$(git grep -h DECLARE_UNSMOB|sed 's/.*(\(.*\), \(.*\)).*/s\/unsmob_\2\\b\/\1::unsmob\/g/')" $(git grep -l unsmob_) sed -i '/^DECLARE_UNSMOB/d' `git grep -l DECLARE_UNSMOB` git checkout Documentation/misc/CHANGES-1.3 (the changes to the CHANGES file are not useful). The definition of DECLARE_UNSMOB is removed in a separate commit.
* Run grand-replace (issue 3765)Carl Sorensen2014-01-111-1/+1
| | | | Run make grand-replace to update all coopyright statements
* Run fixcc.py with astyle 2.02.Graham Percival2012-08-101-3/+3
|
* Issue 2688: Add ly:context-mod-apply! function.David Kastrup2012-07-251-0/+13
|
* Run grand-replace for 2012Graham Percival2012-01-091-1/+1
|
* Implement ly:make-context-modNeil Puttock2011-11-281-4/+15
|
* Grand fixcc.py run on all .hh .cc files.Graham Percival2011-08-011-8/+8
| | | | | | | | | | | Apologies for the inconvenience in patch handling, but getting this done at once will cause less long-term problems than trying to do this piecemeal. Note for future git historians: this patch was created by running scripts/auxiliar/fixcc.py \ $(find flower lily -name '*cc' -o -name '*hh' | grep -v /out) with astyle 2.02 installed. No manual changes were made.
* Admin: run yearly grand-replace.Graham Percival2011-01-131-1/+1
|
* Whitespace, minor formatting.Werner Lemberg2010-08-041-2/+4
|
* Context mods stored in variable, can be inserted into \with or \contextReinhold Kainhofer2010-04-031-0/+44
-) Context-Modifications: create C++ class to store them -) context modifications lists are stored in a dedicated simple scheme object (C++ class Context_mod) -) Changes to the parser: -) \with blocks no longer return a simple list, but a Context_mod object -) context_modifications objects (stored in variables) are now also allowed with \with clauses -) context_modifications objects are also allowed inside \context -) this allows us to rewrite \RemoveEmptyStaffContext (unfortunately with a little different syntax, since we no longer store \Staff inside the \RESC command) so that it no longer erases previous settings to the Staff context. Now, instead of \context { \RemoveEmptyStaffContext } one can do \context { \Staff \RemoveEmptyStaves } with the same effect and preserve previous changes to the Staff context. (The same applies of course to \DrumStaff, \RhythmicStaff, etc. as well) -) Adjusted engraver-init.ly and the regtests accordingly; Also added regtest that checks for RESC not discarding previous settings to the Staff context -) Add convert-ly rule (\RemoveEmpty*StaffContext -> \*Staff \RemoveEmptyStaves) -) Add scheme interface to extract context mods and add context mods with Scheme -) Add changelog entry