3 ms·
Nice. Or you can use the procedural representation. E.g. in Clojure: (defn pcons [x y] (fn [m] (m x y))) (defn pcar [z] (z (fn [p q] p))) (defn pcd
by markc 11y ago
Nice. Or you can use the procedural representation. E.g. in Clojure:
(defn pcons [x y] (fn [m] (m x y)))
(defn pcar [z] (z (fn [p q] p)))
(defn pcdr [z] (z (fn [p q] q)))
(pcar (pcons 2 3)) ==> 2
(pcdr (pcons 2 3)) ==> 3