Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!icdoc!sot-ecs!sra From: sra@ecs.soton.ac.uk (Stephen Adams) Newsgroups: comp.lang.lisp Subject: Re: scope/extent interaction with flet and load Message-ID: Date: 30 Oct 90 09:25:56 GMT References: <60375@bbn.BBN.COM> <1990Oct26.133156@cs.yale.edu> <1990Oct26.122108.27095@hellgate.utah.edu> Sender: sra@ecs.soton.ac.uk Distribution: comp Organization: Southampton University Computer Science Lines: 26 In-reply-to: moore%cdr.utah.edu@cs.utah.edu's message of 26 Oct 90 18:21:08 GMT In article <1990Oct26.122108.27095@hellgate.utah.edu> moore%cdr.utah.edu@cs.utah.edu (Tim Moore) writes: > In article <1990Oct26.133156@cs.yale.edu> engelson-sean@cs.yale.edu (Wisp Lizard) writes: > >In article <60375@bbn.BBN.COM>, sboisen@bbn.com (Sean Boisen) writes: > > > >|>[rebinding macros and functions doesn't work as expected when loading] A solution to this is to use the `evaluate form' read macro. Instead of (flet ((+ (a b) (cons a b))) (load "foo")) Try this: (flet ((+ (a b) (cons a b))) #.(with-open-file (f "foo.lisp") (read f))) The #. macro evaluates the form at the time that the *flet* form is read in and splices in a copy of the file. Of course, this only works with source files containing one form (it could be a progn). -- Stephen Adams S.R.Adams@ecs.soton.ac.uk Computer Science S.R.Adams@sot-ecs.uucp Southampton University Southampton SO9 5NH, UK