Path: utzoo!attcan!uunet!jarthur!elroy.jpl.nasa.gov!decwrl!shelby!neon!news From: rit@killdeer.stanford.edu (Jean-Francois Rit) Newsgroups: comp.lang.lisp Subject: retarded evaluation question Message-ID: <1990Mar16.170540.20445@Neon.Stanford.EDU> Date: 16 Mar 90 17:05:40 GMT References: <1004@micropen> <8218@hubcap.clemson.edu> <1819@awdprime.UUCP> Sender: news@Neon.Stanford.EDU (USENET News System) Reply-To: rit@killdeer.stanford.edu (Jean-Francois Rit) Organization: Robotics Lab. Stanford University Lines: 15 What is an elegant solution to implement the following function: (defxxx with-bindings (b-list s-exprs) "evaluates the s-exprs in an implicit progn. If the argument s-exprs contains free variables, they are bound according to b-list. Example: (setq sub '((?x (1 2)) (?y (3 5))) clause '(+ (car ?x) (cadr ?y))) --> (+ (car ?x) (cadr ?y)) (with-bindings sub clause) --> 6") Note that a macro expanding to a let won't work, since sub, for instance, is a symbol, not a cons. JF Rit