When outside the 'let form, there is no more possibility to access the buffer variable, and if the object it referenced has not been made available elsewhere, it's eligible to garbage collection.
What do you expect when you want to "set the value of buffer object to nil" ? 2010/1/12 Manish <manish.zed...@gmail.com>: > Hi, > > I am new to clojure, A small help is needed regarding the "let". > > (defn objectTest [ ] > (let [buffer (StringBuilder.)] > (do > (.append buffer "manish") > (println "After adding first word: " (.substring buffer 0)) > > ; --------------------------> Setting the value of the buffer to > nil here > > (println "After setting the value of buffer object to nil: " (= > buffer nil)) > ))) > > > At the end of this function, I want to set the value of buffer object > to the nil, Please help.... > > Thanx > Regards > Manish Zedwal > > -- > 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 > Note that posts from new members are moderated - please be patient with your > first post. > 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 >
-- 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 Note that posts from new members are moderated - please be patient with your first post. 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