Merge pull request #834 from farhaven/kwargs-doc

Expand doc for defn with &kwargs
This commit is contained in:
Morten Linderud 2015-07-01 15:30:20 +02:00
commit 0a2828cd0a

View File

@ -410,9 +410,14 @@ Parameters may have the following keywords in front of them:
=> (defn print-parameters [&kwargs kwargs]
... (for [(, k v) (.items kwargs)] (print k v)))
=> (print-parameters :parameter-1 1 :parameter-2 2)
parameter_1 1
parameter_2 2
; to avoid the mangling of '-' to '_', use apply:
=> (apply print-parameters [] {"parameter-1" 1 "parameter-2" 2})
parameter-2 2
parameter-1 1
parameter-2 2
&rest
Parameter will contain 0 or more positional arguments. No other positional