[Top][All Lists]

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

Issue 1320: Scheme bar line interface (issue 6305115)

From: mtsolo
Subject: Issue 1320: Scheme bar line interface (issue 6305115)
Date: Wed, 20 Jun 2012 19:13:01 +0000

Good work - two overall things.

1) In Scheme, try to avoid `do'.  Use map and reduce.
2) Have you tested performance hits on large scores?  It may be worth it
to leave as the default and have your script as a Scheme
implementation, not unlike the way we do bezier curves.

File lily/ (right):
lily/ #include <set>
Is it worth it to keep this file?  I'd just move what's left over to
Scheme at that point.
File lily/ (right):
lily/ Pointer_group_interface::add_grob (me,
ly_symbol2scm ("elements"), b);
Ditto - you can likely get rid of this as well.
File scm/bar-line.scm (right):
scm/bar-line.scm:80: (cons (- height half-staff) (+ height half-staff))
(interval-widen half-staff height)
scm/bar-line.scm:94: (stencil empty-stencil))
As you use let*, you can move all the set! to redefinitions of stencil
in the let*. It seems slightly more in keeping w/ coding practice (could
be wrong, though).
To be more scheme-ic, try a map to get an array of stencils w/ the
correct offsets and then using reduce on the list of stencils to smoosh
them together via ly:stencil-add.
scm/bar-line.scm:150: stencil)
Ditto - as a general rule, avoid `do'. Map and reduce.
scm/bar-line.scm:214: X RIGHT colon-stil kern))
Can you turn the above into the result of a call to a recursive function
that uses ly:stencil-combine-at-edge?
scm/bar-line.scm:495: ;; bulky side. Rewritten by Han-Wen. Ported from
c++ to Scheme by Marc Hohl.
Can you get this down to the 80 character line width?

reply via email to

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