Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1459)

Issue 291190043: Admit lists starting with UNSIGNED as music function arguments

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years ago by dak
Modified:
8 years ago
Reviewers:
lemzwerg, carl.d.sorensen
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Admit lists starting with UNSIGNED as music function arguments This builds upon a variety of other commits: Use key-list? for several music command predicates This is sort of arbitrary currently but matches the kind of syntax accepted by \override/\revert due to their definition in the parser. Parser work for key lists including numbers This admits key lists containing non-negative numbers into various syntactic constructs previously using symbol lists. Define key?, key-list?, key-list-or-music?, key-list-or-symbol? A key (previously a symbol) can be either a non-negative integer (obeying the predicate index?) or a symbol. When used for overrides/reverts, the first elements of a path may not actually be numbers but they are flagged as an error by other means: since a full override path can be the concatenation of several key lists, the leading elements are not treated differently by the list predicates. Strictly speaking this should not be the case for key-list-or-music? or key-list-or-symbol? predicates, but making them behave differently seems unwarranted. Arguably key-list-or-symbol? should possibly be key-list-or-key? instead. Prepare override/revert to deal with numeric subkeys Those are fairly cosmetic changes (partly comments) to prepare for the possibility of using override/revert with numeric subkeys while retaining the necessity of using a symbol as the main property in a Context.Grob.property.subproperties... n-tuple since the organization of an "nalist" (an alist stack containing reversible subproperty overrides) relies on a few special key values: currently pairs and booleans are specially interpreted while the current implementation requires an eq?-comparable first index for efficiency reasons. Make alist routines use equal? key comparisons This affects evict_from_alist and nested_property_alist Optimize assoc_tail for various key types Add assv_tail function

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -19 lines) Patch
M lily/context-property.cc View 1 chunk +2 lines, -1 line 0 comments Download
M lily/include/context.hh View 1 chunk +1 line, -0 lines 0 comments Download
M lily/include/lily-imports.hh View 1 chunk +2 lines, -0 lines 0 comments Download
M lily/lily-imports.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M lily/nested-property.cc View 5 chunks +26 lines, -7 lines 0 comments Download
M lily/parser.yy View 6 chunks +10 lines, -3 lines 0 comments Download
M ly/music-functions-init.ly View 8 chunks +8 lines, -8 lines 0 comments Download
M scm/c++.scm View 1 chunk +16 lines, -0 lines 0 comments Download
M scm/lily.scm View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 2
lemzwerg
LGTM.
8 years ago (2016-03-14 19:02:04 UTC) #1
Carl
8 years ago (2016-03-15 02:14:59 UTC) #2
Looks good to me.  Very clear.  Easy to understand, and powerful.

A few years ago I was messing around in the override / revert space, and it was
driving me crazy.  You have rationalized the behavior.  Thanks!


Thanks,

Carl
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b