Adding documentation for flatten
This commit is contained in:
parent
0a80b87b7f
commit
d7956d03c3
@ -575,6 +575,26 @@ See also :ref:`remove-fn`.
|
|||||||
=> (list (filter even? [1 2 3 -4 5 -7]))
|
=> (list (filter even? [1 2 3 -4 5 -7]))
|
||||||
[2, -4]
|
[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:
|
.. _iterate-fn:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user