https://codereview.appspot.com/8647044/diff/5001/scm/music-functions.scm
File scm/music-functions.scm (right):

https://codereview.appspot.com/8647044/diff/5001/scm/music-functions.scm#newcode2103
scm/music-functions.scm:2103: ; head of the alist.  We reverse the alist
so our search will return
On 2013/04/23 22:09:04, dak wrote:
On 2013/04/23 20:24:57, dak wrote:


"If our search returns an anonymous procedure" is quite strained.  We
don't need
to _speculate_ about the identity of the anonymous procesure.  If we
want to be
sure, we can just remember it:

(define (offsetter property offsets)
   (define (self grob)

In view of the way offsetter is called, the first line of the above
would still need to be
(define ((offsetter property offsets) grob)

I see the value of the procedure recognizing itself, but I'm afraid I
don't understand how to implement this from the start you've given me.
Could you give me a further hint as to what

(define (self grob) ...

would contain?


and we can now check through both mutable and immutable grob
properties, find
self, and look behind self in the aliast to see whether we find
another
occurence of the property which, if found, we duly evaluate
recursively.  That
should allow multiple offsetter calls to work recursively.

Huh.  Maybe not the best idea since
\offset Y-offset ... Grob
\offset Y-offset ... Grob
would not accumulate while
\offset Y-offset ... Grob
\temporary\offset Y-offset ... Grob
or even
\offset Y-offset ... Grob
\once\offset Y-offset ... Grob
would.

But still seems better than forgetting all overrides except the first
one
(likely in the grob definition).

Accumulation of offsets, while nice in theory, does not seem to me to
have practical application.  (And its usage would lead to rather
confusing documentation, judging by the above.)

Here's an example of remembering which is already possible:
\relative c'' {
  c8 d e f
  \offset #'positions #'(-1 . -3) Beam
  c d e f
  \temporary \offset #'positions #'(-5 . -5) Beam
  c d e f
  \revert Beam.positions
  c d e f
}

In view of this, I could simply look for "self" at the head of the
properties alist and use that for comparison, rather than my opaque use
of procedure-name.

https://codereview.appspot.com/8647044/

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to