(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-info {:required 0 :actual [() 1]})
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-info {:required 0 :actual [() 1]})(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 builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |