[Top][All Lists]

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

Re: Abstract Grob property storage into Mutable_properties. (issue 56164

From: nine . fierce . ballads
Subject: Re: Abstract Grob property storage into Mutable_properties. (issue 561640043 by address@hidden)
Date: Mon, 13 Apr 2020 10:15:19 -0700
File lily/include/mutable-properties.hh (right):
lily/include/mutable-properties.hh:31: class Iterator {
This is useful, but instead of choosing your own method names, why not
give it an interface consistent with standard iterators (where the
semantics match)?

I'd leave out the key() and value() methods and let it dealing with just
a generic list of SCM values.

If you implemented enough of the iterator interface, and a class to wrap
the raw SCM list into an object addressable with begin() and end(), I
think you would be able to write range-for statements something like

for (SCM assoc : ly_list(my_alist))
    SCM key = scm_car(assoc);
    SCM val = scm_cdr(assoc);

If you're not interested in doing this, I might try it myself.
lily/include/mutable-properties.hh:54: Iterator iter() const {
Does const serve a purpose here?  The iterator doesn't carry through
with any kind of enforcement.  The same question applies to
try_retrieve() and to_alist().
lily/include/mutable-properties.hh:60: void swap(Mutable_properties*);
Please: void swap(Mutable_properties&) like everything in the STL.

reply via email to

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