On 10-11-14 11:59 PM, Joe Neeman wrote:

    Any specific reason why not just filter on the is-live? predicate?



Doesn't filter just work on plain scheme lists? elements is a grob-array object. Of course, if filter doesn't work on such objects it might be better to write a version of filter rather than replicating it many times.

filter works on things that understand car and cdr; which elements clearly doesn't, because it's just a "boxing" wrapper around Grob_array*. What I am doing is go to a list first, and then filtering:

(define (live-elements-list me)
  (filter grob::is-live? (grob-array->list (ly:grob-object me 'elements))))

where grob-array->list is a function which I just made.

The reason I am asking, is because even after spending 10 minutes looking at the procedural-style code in the current live-elements-list, I am still not sure what the answer is to the question, "what does this function do?" Does it just filter the elements according to grob::is-live?? Or does it do something more / less / different? Quite seriously, it's just hard to be sure.
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to