I am new at Clojure. I have a map like
{:title "The Little Schemer"
:authors [friedman , felleisen]}
I want to transform it to:
{:title "The Little Schemer"
:authors #{friedman , felleisen}}
I attempted like:
(def friedman {:name "Daniel Friedman" :birth-year 1944})
(def felleisen {:name "Matthias Felleisen"})
(defn old-book->new-book [book]
(set (:authors book)
)
)
(println (old-book->new-book {:title "The Little Schemer"
:authors [friedman , felleisen]}))
; => Output: #{{:name Daniel Friedman, :birth-year 1944} {:name Matthias Felleisen}}
; => Expected-Output: #{friedman , felleisen}
Here the defs
friedman
and felleisen
gets executed and there results are getting transformed to set. But, I want the function names to be converted to set instead of their results.