Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!usc!bbn.com!sboisen From: sboisen@bbn.com (Sean Boisen) Newsgroups: comp.lang.lisp Subject: scope/extent interaction with flet and load Message-ID: <60375@bbn.BBN.COM> Date: 26 Oct 90 15:54:24 GMT Sender: news@bbn.com Distribution: comp Lines: 36 Scenario: assume a file foo.lisp which contains the following single form. (print (+ 1 2)) What i expected to see when executing the following > (flet ((+ (a b) (cons a b))) (load "foo")) was something like (1 . 2) Instead (at least under Lucid and Allegro on a Sun) i see 3 In other words, my flet "redefinition" of + wasn't in effect when the file got loaded, even though it seems to me the loading is inside the scope of the flet, according to the rules in CLtL. Can somebody explain to me why this behavior is correct (assuming it is)? (This is of course a silly example, for illustrative purposes: what i *really* want to work like this is a macrolet, because i have a big file containing macro forms, and i want to load this file with a slightly altered macro definition, without trashing the existing macro definition. That seems to me like just what macrolet was designed for, but i'm frustrated that it doesn't work: i get the existing macro definition, not the new one i've created with macrolet. Then i discovered that flet has the same property, which makes it look like that's the way things are supposed to work. Extra credit if you can tell me how to accomplish my original intent!) -- Sean