documentation for doto

relates #567
This commit is contained in:
Tuukka Turto 2014-04-21 13:28:08 +03:00
parent 8a5a1eea27
commit f4b67e8bd8

View File

@ -560,6 +560,27 @@ del
=> dic
{}
doto
----
`doto` macro is used to make repetitive calls to an object easy. Following
example demonstrates this.
.. code-block:: clj
=> (setv collection [])
=> (doto collection (.append 1) (.append 2))
=> collection
[1 2]
.. code-block:: clj
=> (setv collection [])
=> (.append 1 collection)
=> (.append 2 collection)
=> collection
[1 2]
eval
----