Permalink
Browse files

Document function docstrings

  • Loading branch information...
Kodiologist committed Jul 11, 2018
1 parent 9859b00 commit e05af9d7e0605b986e813cc36f06340773a17726
Showing with 7 additions and 4 deletions.
  1. +7 −4 docs/language/api.rst
@@ -449,13 +449,16 @@ below:
defn
----
``defn`` macro is used to define functions. It takes three
parameters: the *name* of the function to define, a vector of *parameters*,
and the *body* of the function:
``defn`` is used to define functions. It requires two arguments: a name (given
as a symbol) and a list of parameters (also given as symbols). Any remaining
arguments constitute the body of the function.
.. code-block:: clj
(defn name [params] body)
(defn name [params] bodyform1 bodyform2...)
If there at least two body forms, and the first of them is a string literal,
this string becomes the :ref:`docstring <py:docstring>` of the function.
Parameters may be prefixed with the following special symbols. If you use more
than one, they can only appear in the given order (so all `&optional`

0 comments on commit e05af9d

Please sign in to comment.