(arg-check f num)
(arg-check f num message)
counts the number of non-varidic argument types
(arg-check (fn [x]) 1) => true
(arg-check (fn [x & xs]) 1) => true
(arg-check (fn [x & xs]) 0) => (throws Exception "Function must accomodate 0 arguments")
counts the number of non-varidic argument types (arg-check (fn [x]) 1) => true (arg-check (fn [x & xs]) 1) => true (arg-check (fn [x & xs]) 0) => (throws Exception "Function must accomodate 0 arguments")
(arg-count f)
counts the number of non-varidic argument types
(arg-count (fn [x])) => [1]
(arg-count (fn [x & xs])) => []
(arg-count (fn ([x]) ([x y]))) => [1 2]
counts the number of non-varidic argument types (arg-count (fn [x])) => [1] (arg-count (fn [x & xs])) => [] (arg-count (fn ([x]) ([x y]))) => [1 2]
(varg-count f)
counts the number of arguments types before variable arguments
(varg-count (fn [x y & xs])) => 2
(varg-count (fn [x])) => nil
counts the number of arguments types before variable arguments (varg-count (fn [x y & xs])) => 2 (varg-count (fn [x])) => nil
(vargs? f)
checks that function contain variable arguments
(vargs? (fn [x])) => false
(vargs? (fn [x & xs])) => true
checks that function contain variable arguments (vargs? (fn [x])) => false (vargs? (fn [x & xs])) => true
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close