lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remove ly:grob-properties (issue 549840044 by address@hidden)


From: hanwenn
Subject: Re: Remove ly:grob-properties (issue 549840044 by address@hidden)
Date: Sat, 11 Apr 2020 09:38:28 -0700

Reviewers: dak, thomasmorley651,

Message:
On 2020/04/11 16:02:31, dak wrote:
> The description says "[ly:grob-properties] will not return the
properties that
> were \overridden."
> 
> Aren't you confusing this with ly:grob-basic-properties ?  I think
> ly:grob-properties will actually _only_ return the properties that
were
> overriden.

\override pushes data onto the immutable list (or at least, it used to
be like that). So if you do \override Stem.length = #5 , you won't see
'length in the return value of ly:grob-properties

I thought of removing the other function too, and I agree in principle,
but it can only break more user files. As long as we're not considering
reorganizing the immutable lists, I think it can stay.

Description:
Remove ly:grob-properties

This function is hard to use correctly:

* one cannot set the head of the alist, so it cannot be used for
  modifications.

* it will not return the properties that were \overridden

Instead, ly:grob-property should be used. 

This paves the way to further work on (grob) property storage
mechanisms.

Fixes
Documentation/snippets/overriding-articulations-of-destinct-type,
which should be mirrored back into LSR.

NOSUBMIT: this is an incompatible change; where are the release notes?

Please review this at https://codereview.appspot.com/549840044/

Affected files (+1, -13 lines):
  M Documentation/snippets/overriding-articulations-of-destinct-type.ly
  M lily/grob-scheme.cc


Index: Documentation/snippets/overriding-articulations-of-destinct-type.ly
diff --git 
a/Documentation/snippets/overriding-articulations-of-destinct-type.ly 
b/Documentation/snippets/overriding-articulations-of-destinct-type.ly
index 
5053be73b1161970f5d7cc47baf729fa92c096bb..525840d718a5f32f0ba4b15b66dc72b550305fbf
 100644
--- a/Documentation/snippets/overriding-articulations-of-destinct-type.ly
+++ b/Documentation/snippets/overriding-articulations-of-destinct-type.ly
@@ -28,7 +28,7 @@ With 2.16.2 it is possible to put the proposed function,
 #(define (custom-script-tweaks ls)
   (lambda (grob)
     (let* ((type (ly:prob-property
-                    (assoc-ref (ly:grob-properties grob) 'cause)
+                    (ly:grob-property grob 'cause)
                     'articulation-type))
            (tweaks (assoc-ref ls type)))
       (if tweaks
Index: lily/grob-scheme.cc
diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc
index 
a078e7ac083d237169b39c15f8b39dc3293ee44b..22f89c87e8d48eb6e8db231a3066b2fcfeaddeca
 100644
--- a/lily/grob-scheme.cc
+++ b/lily/grob-scheme.cc
@@ -312,18 +312,6 @@ LY_DEFINE (ly_grob_set_parent_x, "ly:grob-set-parent!",
   return SCM_UNSPECIFIED;
 }
 
-LY_DEFINE (ly_grob_properties, "ly:grob-properties",
-           1, 0, 0, (SCM grob),
-           "Get the mutable properties of @var{grob}.")
-{
-  Grob *g = unsmob<Grob> (grob);
-
-  LY_ASSERT_SMOB (Grob, grob, 1);
-
-  /* FIXME: uhg? copy/read only? */
-  return g->mutable_property_alist_;
-}
-
 LY_DEFINE (ly_grob_basic_properties, "ly:grob-basic-properties",
            1, 0, 0, (SCM grob),
            "Get the immutable properties of @var{grob}.")





reply via email to

[Prev in Thread] Current Thread [Next in Thread]