Noted that args are optional with apply

This commit is contained in:
Clinton N. Dreisbach 2014-01-10 16:14:20 -05:00
parent c03e798356
commit 977b47d3b4

View File

@ -100,14 +100,19 @@ appends it as the last argument. The following code demonstrates this:
apply
-----
`apply` is used to apply a list of arguments and an optional dictionary of
kwargs to a function.
`apply` is used to apply an optional list of arguments and an optional
dictionary of kwargs to a function.
Usage: `(apply fn-name args [kwargs])`
Usage: `(apply fn-name [args] [kwargs])`
Examples:
.. code-block:: clj
(defn thunk []
"hy there")
(apply thunk)
;=> "hy there"
(defn total-purchase [price amount &optional [fees 1.05] [vat 1.1]]
(* price amount fees vat))