Add 2-arity semantic to sets

Description

As per documentation:

Sets are functions of their members, using get

but whereas get supports a 2-arity flavor, sets do not:

1 2 3 4 5 6 7 8 9 10 11 12 ;; using get with 2-arity: user=> (get #{:a} :b :not-found) :not-found ;; sets with 2-arity throws exception: user=> (#{:a} :b :not-found) Execution error (ArityException) at user/eval142 (REPL:1). Wrong number of args (2) passed to: clojure.lang.PersistentHashSet ;; interestingly, transient sets actually work: user=> ((transient #{:a}) :b :not-found) :not-found

Note that ClojureScript sets already provide such a 2-arity semantic

Environment

None

Status

Assignee

Unassigned

Reporter

Carlo Sciolla

Labels

None

Approval

None

Patch

Code and Test

Affects versions

Release 1.10

Priority

Major