Urs Liska <address@hidden> writes:
Hi all,
after completing most of the work of reviewing the scholarly.annotate
module I realize that it (presumably one small change) is a total
performance killer, and I need some help tracking it down.
Well, one thing just jumping out at me is
((process-acknowledged translator)
(for-each
(lambda (grob)
[...]
;; reset list to prevent multiple processing.
;
; TODO: I don't understand why I can kill *all* the list
; after having processed *one* grob.
; What happens to any other annotated grobs (at the same
time)?
; I know it is possible to annotate multiple post-events,
for example.
(set! all-grobs '())))))))
all-grobs))
That's just garbage. If you want to stop processing the list in spite
of having started it with for-each, you need a non-local jump
(catch/throw).
The list processed by for-each has no connection at all with what you
store in all-grobs inside of the loop. And it does not appear like you
even bother resetting all-grobs at all when you don't reach the
conditional passage inside, letting it grow at will.