Sets/Vectors vs Maps/Keywords default value when used as functions

66 views
Skip to first unread message

Khalid Jebbari

unread,
Dec 13, 2017, 8:56:58 AM12/13/17
to Clojure
Any reason we can't provide default value for sets and vectors when using them as functions, whereas it works just fine for maps and keywords ?

Examples :

boot.user=> (["first" "second"] 2 :nope)
clojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector

boot.user=> (#{1 2} 3 :nope)
clojure.lang.ArityException: Wrong number of args (2) passed to: PersistentHashSet

boot.user=> ({1 1 2 2} 3 :nope)
:nope

boot.user=> (:exist? {:a 1} :nope)
:nope

boot.user=> (:exist? #{:a 1} :nope)
:nope


Alex Miller

unread,
Dec 13, 2017, 9:15:18 AM12/13/17
to Clojure
There's a ticket for this at https://dev.clojure.org/jira/browse/CLJ-1305 if you'd like to vote for it.

Khalid Jebbari

unread,
Dec 13, 2017, 9:33:31 AM12/13/17
to Clojure
Voted ! Thanks, I expected it to be a known problem.
Reply all
Reply to author
Forward
0 new messages