[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to access the most current environment in T?
In article <email@example.com.UUCP>, Ram-Ashwin@cs (Ashwin Ram) writes:
>In article <firstname.lastname@example.org.UUCP>, email@example.com (allan yang) writes:
>> In T version 3.1, is there a way to access the most current environment?
>> More specifically, given
>> (let ((x 'y) (y 1)) (eval x *most-current-env*))
>> I want the body be evaluated to 1. User-env does not contain the most
>> recent binding of y.
> > (let ((x 'y) (y 1)) (eval x (the-environment)))
This doesn't seem to work in compiled code:
> (let ((x 'y) (y 5)) (eval x (the-environment)))
> (orbit '(let ((x 'y) (y 5)) (eval x (the-environment))))
;** Warning: unreferenced variable Y
; Location: in (LET ((X (QUOTE Y)) (Y 5)) (EVAL X (THE-ENVIRONMENT)))
** Error: variable Y is unbound
The same error occurs if stuff is added to refer to X and to make the EVAL
call non-tail recursive.