[Top][All Lists]

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

Re: eval - environment

From: Thien-Thi Nguyen
Subject: Re: eval - environment
Date: Thu, 06 Sep 2001 14:14:03 -0700

   From: David Pirotte <address@hidden>
   Date: Sat, 01 Sep 2001 19:06:06 +0200

   (define-method (load-tuples&build-inst-1 (db-tb-cl-mt <db-tb-cl-mt>) args)
     (let* ((cl-name (cl-nme db-tb-cl-mt))
            (make-form (eval `(make ,cl-name ,@args)
   ==>                    ???

   i would like eval to use the environment of the caller, here
   load-tuples&build-inst-1, because it contains (it should) everything
   needed and also will 'put' the evaluated forms in the right
   environment, no? so, how can i tell eval to do that?

(approach A): looks like you mine `cl-name' out of `db-tb-cl-mt' (egad,
these names invoke in my mind country codes and some wandering salesman
visiting each one of them!).  you could bundle environment information
in the same manner.

(approach B): rewrite `load-tuples&build-inst-1' as a macro, eliminating
explicit use of `eval' entirely.

probably approach B is more elegant.


reply via email to

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