guile-devel
[Top][All Lists]
Advanced

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

Re: Anything better for delayed lexical evaluation than (lambda () ...)?


From: Andy Wingo
Subject: Re: Anything better for delayed lexical evaluation than (lambda () ...)?
Date: Tue, 13 Dec 2011 19:58:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

On Tue 13 Dec 2011 17:54, David Kastrup <address@hidden> writes:

>> Am I missing something?
>
> Performance, space, simplicity, robustness.  Compiling five closures
> that do nothing except accessing a single variable each is a bit
> wasteful.

Sure.

Let me see if I finally understand the issue here:

You have a function:

  (define-music-function (foo bar)
    (ly:something? bar)
    #{ /la /la /la
       $bar $bar $bar
       #(scheme-expression!)
       /ok }#)

Before, you could turn the #{}# into a lambda and get at the $vars and
evaluate the #(expressions) in the procedure-environment of the lambda.
Now, you have to munge around in the expression and, in this case,
produce 4 closures:  (lambda () bar), 3 times, and (lambda ()
(scheme-expression!)).

Is that right?

Andy
-- 
http://wingolog.org/



reply via email to

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