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

Issue 102760044: Clean up code for sorting grob-properties. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 11 months ago by Mark Polesky
Modified:
9 years, 10 months ago
Reviewers:
dak
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

WAS: Automatically sort alist grob-properties in IR. David's logic has convinced me to retract the alist-sorting of the previous patch. What remains is just a minor cleanup of the sorting code, which is hopefully now easier to understand. http://code.google.com/p/lilypond/issues/detail?id=3932

Patch Set 1 #

Total comments: 4

Patch Set 2 : Clean up code for sorting grob-properties. #

Total comments: 1

Patch Set 3 : Use `map!' instead of `for-each'. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -17 lines) Patch
M scm/document-backend.scm View 1 2 1 chunk +20 lines, -17 lines 0 comments Download

Messages

Total messages: 7
dak
https://codereview.appspot.com/102760044/diff/1/scm/document-backend.scm File scm/document-backend.scm (right): https://codereview.appspot.com/102760044/diff/1/scm/document-backend.scm#newcode22 scm/document-backend.scm:22: (apply eq? #t (map pair? x)))) (apply eq? #t ...
9 years, 11 months ago (2014-05-28 00:00:59 UTC) #1
Mark Polesky
https://codereview.appspot.com/102760044/diff/1/scm/document-backend.scm File scm/document-backend.scm (right): https://codereview.appspot.com/102760044/diff/1/scm/document-backend.scm#newcode22 scm/document-backend.scm:22: (apply eq? #t (map pair? x)))) On 2014/05/28 00:00:58, ...
9 years, 11 months ago (2014-05-28 06:07:28 UTC) #2
dak
On 2014/05/28 06:07:28, Mark Polesky wrote: > https://codereview.appspot.com/102760044/diff/1/scm/document-backend.scm > File scm/document-backend.scm (right): > > https://codereview.appspot.com/102760044/diff/1/scm/document-backend.scm#newcode22 ...
9 years, 11 months ago (2014-05-28 07:37:48 UTC) #3
Mark Polesky
David's logic has convinced me to retract the alist-sorting of the previous patch. What remains ...
9 years, 11 months ago (2014-05-28 21:32:53 UTC) #4
dak
https://codereview.appspot.com/102760044/diff/90001/scm/document-backend.scm File scm/document-backend.scm (right): https://codereview.appspot.com/102760044/diff/90001/scm/document-backend.scm#newcode37 scm/document-backend.scm:37: (set! all-grob-descriptions Doing an assoc-set! here is inefficient inside ...
9 years, 11 months ago (2014-05-28 21:46:55 UTC) #5
Mark Polesky
On 2014/05/28 21:46:55, dak wrote: > Doing an assoc-set! here is inefficient inside of the ...
9 years, 11 months ago (2014-05-28 22:01:20 UTC) #6
dak
9 years, 11 months ago (2014-05-29 06:01:42 UTC) #7
On 2014/05/28 22:01:20, Mark Polesky wrote:
> On 2014/05/28 21:46:55, dak wrote:
> > Doing an assoc-set! here is inefficient inside of the loop.  Instead of
> > (for-each
> >    (lambda (grob-description)
> >       ...
> >       (set! all-grob-descriptions (assoc-set! ...
> > 
> > one should use
> > (set! all-grob-descriptions
> >   (map!
> >      (lambda (grob-description)
> >         ;replacement for grob description)
> >      all-grob-descriptions))
> 
> Like this?

Yup, looks good.  Of course, it wasn't your fault in the first place, but it
would be strange not to use an opportunity for cleaning this up.  Actually
thinking about it, map! isn't the hottest idea since it modifies a constant in
the code (undefined behavior, might be flagged at one point of time).  But so do
all of the assoc-set! calls: this would have to be rewritten as a whole, and
while this is not done, one might as well use map! here.
Sign in to reply to this message.

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