lilypond-devel
[Top][All Lists]
Advanced

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

Re: Issue 3720: Built-in templates for SATB vocal scores (issue 41990043


From: David Kastrup
Subject: Re: Issue 3720: Built-in templates for SATB vocal scores (issue 41990043)
Date: Tue, 07 Jan 2014 00:44:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

David Kastrup <address@hidden> writes:

> And I am not really convinced that if we move to local-eval at some
> point of time that we'll be able to get `#{ ... #,... #} to work in a
> reasonable time frame.  Maybe that will be considered a show stopper
> anyway, so we'll stay with the lambda implementation which manages to
> survive this rather brutal mixture of Scheme and LilyPond.

As a note aside: I had played in Guile-1 with the rather brutal
the-environment / local-eval implementation

(define (local-eval form env)
  (call-with-current-continuation
    (lambda (x) (env (list x form)))))

(define-macro (the-environment)
  (call-with-current-continuation identity))

Unsurprisingly, it does not work with GUILEv2.  Surprisingly, it _does_
work with GUILEv1.

The idea is that (the-environment) keeps a continuation into the macro
expander, and local-eval feeds the macro expander/evaluator with
something looking like a function call, the function being the
continuation of the local-eval, and the function argument the form to be
evaluated in the local environment.  When the continuation arrives
somewhere where evaluation happens, it will jump out again.

Getting messier than that would seem challenging.  It would be
interesting to see how this code would hold up to the `#{ ... #, ... #}
challenge.  But as it won't work in GUILEv2, the interest is more of
theoretical nature.

-- 
David Kastrup



reply via email to

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