From 977b47d3b4009bae0198494658d40a65af82bfae Mon Sep 17 00:00:00 2001 From: "Clinton N. Dreisbach" Date: Fri, 10 Jan 2014 16:14:20 -0500 Subject: [PATCH] Noted that args are optional with apply --- docs/language/api.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/language/api.rst b/docs/language/api.rst index 30cfeb4..6c01d0a 100644 --- a/docs/language/api.rst +++ b/docs/language/api.rst @@ -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))