Hi Peter, On Jan 16, 5:37 pm, Peter Wolf <opus...@gmail.com> wrote: > Hi and thanks for all the feedback > > How does SLIME handle this case? > > user=> (def foo 1) > #'user/foo > user=> (defn bah [] (let [foo 2] foo)) > #'user/bah > user=> (bah) > 2
SLIME doesn't handle it at all; it just sends strings to the Lisp process (Clojure, in this case) and gets strings back. > If I select the "foo" inside the let, I want the local one. > > How does the running image figure that out? What does the API to the > LISP process look like? > > Also what happens if you have the following in a file? How does the > image figure out which (def...) maps to which reference? > > (def foo 1) > foo > > (def foo 2) > foo Try it! To answer your question, the Lisp process just evaluates forms in order as it encounters them. So first "foo" is defined to be 1, then it's redefined to be 2. Remember, Clojure is a compiler, not an interpreter. The compiler doesn't remember syntax. There is no "running image" in the Smalltalk sense. So the 100% perfect refactoring you have in mind may not be possible without reimplementing a large portion of Clojure itself. -Stuart Sierra --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---