mirror of
https://github.com/jbranchaud/til
synced 2026-01-09 10:08:01 +00:00
Add Argument Requirements For A Function as a clojure til.
This commit is contained in:
@@ -29,6 +29,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
|||||||
### clojure
|
### clojure
|
||||||
|
|
||||||
- [Aggregation Using merge-with](clojure/aggregation-using-merge-with.md)
|
- [Aggregation Using merge-with](clojure/aggregation-using-merge-with.md)
|
||||||
|
- [Argument Requirements For A Function](clojure/argument-requirements-for-a-function.md)
|
||||||
- [Evaluate One Liners With lein-exec](clojure/evaluate-one-liners-with-lein-exec.md)
|
- [Evaluate One Liners With lein-exec](clojure/evaluate-one-liners-with-lein-exec.md)
|
||||||
- [Expanding Macros](clojure/expanding-macros.md)
|
- [Expanding Macros](clojure/expanding-macros.md)
|
||||||
- [Get The Value Of An Environment Variable](clojure/get-the-value-of-an-environment-variable.md)
|
- [Get The Value Of An Environment Variable](clojure/get-the-value-of-an-environment-variable.md)
|
||||||
|
|||||||
14
clojure/argument-requirements-for-a-function.md
Normal file
14
clojure/argument-requirements-for-a-function.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Argument Requirements For A Function
|
||||||
|
|
||||||
|
When defining a function, you must declare one or more function definitions,
|
||||||
|
each of which will require a different set of arguments. These argument
|
||||||
|
lists are stored as metadata for the function. So, if you are trying to
|
||||||
|
figure out what arity a function is or what variations of arguments it
|
||||||
|
takes, you can check the metadata like so:
|
||||||
|
|
||||||
|
```
|
||||||
|
> (:arglists (meta #'str))
|
||||||
|
([] [x] [x & ys])
|
||||||
|
```
|
||||||
|
|
||||||
|
[source](http://stackoverflow.com/questions/1696693/clojure-how-to-find-out-the-arity-of-function-at-runtime)
|
||||||
Reference in New Issue
Block a user