On Dec 15, 2010, at 10:22 AM, Poojan wrote: > I was trying to print out a list of symbols and I was wondering if I > could remove the quotes.
(name 'symbol) ; gives the string name of a symbol (map name '(a b c))) ; will give you a list of string names of symbols. (println (map name '(a b c))) ; will print them, output looks like "(a b c)" If you do this: (map (fn [symbol] (println (name symbol))) '(a b c)) You'll probably find the results confusing because map is lazy (doesn't produce results until it needs to). The printing of the symbol names will be intermixed with the printing of the list-of-results from map (which will be three nils because #'println returns nil). One way around that is to use #'doall. It forces all the results to be calculated before it returns: (doall (map (fn [symbol] (println (name symbol))) '(a b c))) That will produce this output: a b c (nil nil nil) (See also #'dorun.) ----- Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://bit.ly/hfdf9T) www.exampler.com, www.exampler.com/blog, www.twitter.com/marick -- 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