Hi Ivar,
> ;; Do things such as hash-map comprehensions exist? Should they? ;-)
> (defn some-eqn3 [obj]
> (let [{:a a :b b :c c} obj]
> (/ (+ (- b) (sqrt (- (* b b) (* 4 a c))))
> (* 2 a))))
At least a partial stab at some of your questions...
(def myhash {:a 1 :b 5 :c 6 :x nil})
(defn some-eqn3 [obj]
(let [{:keys [a b c]} obj]
(/ (+ (- b) (Math/sqrt (- (* b b)
(* 4 a c)))) (* 2 a))))
(some-eqn3 myhash)
-2.0
Have a look at http://clojure.org/special_forms, regarding
destructured binding with let.
Still pondering the rest of your post :-).
-Rgds, Adrian.
--
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