Adding documentation for flatten

This commit is contained in:
Bob Tolbert 2013-12-30 15:09:17 -07:00 committed by Abhishek L
parent 0a80b87b7f
commit d7956d03c3

View File

@ -575,6 +575,26 @@ See also :ref:`remove-fn`.
=> (list (filter even? [1 2 3 -4 5 -7]))
[2, -4]
.. _flatten-fn:
flatten
-------
.. versionadded:: 0.9.12
Usage: ``(flatten coll)``
Return a single list of all the items in ``coll``, by flattening all
contained lists and/or tuples.
.. code-block:: clojure
=> (flatten [1 2 [3 4] 5])
[1, 2, 3, 4, 5]
=> (flatten ["foo" (, 1 2) [1 [2 3] 4] "bar"])
['foo', 1, 2, 1, 2, 3, 4, 'bar']
.. _iterate-fn: