[Top][All Lists]

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

Re: memoization and conditional defines

From: Lynn Winebarger
Subject: Re: memoization and conditional defines
Date: Thu, 7 Nov 2002 18:22:03 -0500

On Thursday 07 November 2002 14:08, Bruce Korb wrote:
> I don't care how memoization works.  I understand there are
> optimization issues.  Optimizing isn't important to me, or
> I would not use an interpretive language as my "extension
> language".
     It's really about correctness of macro expansion in a broader
sense than just the core macros ('lambda, 'define, etc).  The core
macros just transform the sexpression into a more explicit parse
tree.  If you didn't do that, you could never be sure whether your
function would actually be a function or not. The symbol 'lambda
can be redefined at will by code in R5RS.  There are no
reserved keywords.

> BTW, my guess is that memoizing Guile will make it go much slower.
      Guile has been memoizing since its creation (or rather, the creation
of SCM).
      If you're worried about (if <test> (define <foo> <bar>)), you
can always use
(if <test> (eval '(define <foo> <bar>)))
which will do what you want.  eval's always execute in a top-level environment,
no matter where the expression occurs in the code.  And that '(define <foo> 
would get re-expanded every time it got executed.


reply via email to

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