This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: local-eval



scheme-report-environment, according to the R5RS is supposed to be 
immutable... though they don't necessarily mean that you can't define 
new variables, but only that you can't change the value of the 
pre-defined ones...

Specifically, they say:

Implementations may extend eval to allow non-expression programs 
(definitions) as the first argument and to allow other values as 
environments, with the restriction that eval is not allowed to create 
new bindings in the environment assocated with null-environment or 
scheme-report-environment.


which suggests to me that R5RS explicitly is not going to say anything 
about the right way to do generalized eval...

Also, I saw a bug in my code:

> (define make-eval-closure
>  (lambda ()
>   (lambda (ls)
>    (let ((local-environment (new-environment)))
>      (eval `(apply ,(car ls) ,(cdr ls)) local-environment)))))

should be:

 (define make-eval-closure
  (lambda ()
    (let ((local-environment (new-environment)))
     (lambda (ls)
      (eval `(apply ,(car ls) ,(cdr ls)) local-environment)))))

(i don't know whether the parens balance...




______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com