Clojure documentation only talks about :or followed by a map (from http://clojure.org/special_forms ):
> Also optionally, an *:or* key in the binding form followed by another > map may be used to supply default values for some or all of the keys if > they are not found in the init-expr: > > (let [{a :a, b :b, c :c, :as m :or {a 2 b 3}} {:a 5 :c 6}] > [a b c m]) > ->[5 3 6 {:c 6, :a 5}] > > On Friday, April 12, 2013 6:00:27 PM UTC-4, henry clifford wrote: > > I'm trying to use the :or destructuring syntax as seen here applied to a > map > > (def point {:y 7}) > (let [{:keys [x y] :or {x 0 y 0}} point] > (println "x:" x "y:" y)) > x: 0 y: 7 > > but I can't get this to work with vectors: > > (def point [7]) > (let [[x y :or [0 0]] point] > (println "x:" x "y:" y)) > > what' I'm expecting is x:7 y:0 > > but I'm getting Exception Unsupported binding form: :or > > Any thoughts on this? > Thanks! > -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.