If Clojure was interpreted this behavior would be simple to support. It seems like you'd have to complicate the compiler for little benefit.
On Tuesday, June 21, 2011, Jonathan Fischer Friberg <[email protected]> wrote: > Thanks, but I think I'll simply input the let in the string, i.e > > (load-string "(let [a (fn [] "inside fn")] (a))") > > But I still think it's odd behavior. I've always thought of eval as equal to > putting that code there. > > (eval '(a)) is equal to (a) > > Which I think would be much more intuitive. > > Jonathan > > On Tue, Jun 21, 2011 at 2:49 AM, David Nolen <[email protected]> wrote: > On Mon, Jun 20, 2011 at 7:45 PM, Jonathan Fischer Friberg > <[email protected]> wrote: > > I got a very nasty bug from this behavior today > > user=> (def a (fn [] "outside a")) > #'user/a > user=> (let [a (fn [] "inside a")] (load-string "(a)")) > "outside a" > user=> (let [a (fn [] "inside a")] (eval '(a))) > "outside a" > > Is this really how these functions should behave? > > Jonathan > > Relevant previous threads: > > > http://groups.google.com/group/clojure/browse_thread/thread/e1226810b6ac7bfc/8e0f53c141c26fcc > > http://groups.google.com/group/clojure/browse_thread/thread/ead8a3a8ff009a8f/17bb00a546724435 > > David > > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
