Tweak the zipwith doc a bit and add @kirbyfan64 to AUTHORS.

This commit is contained in:
Berker Peksag 2014-02-22 02:21:34 +02:00
parent d282d65cde
commit 6829d6fb3a
4 changed files with 9 additions and 6 deletions

View File

@ -42,3 +42,4 @@
* Halit Alptekin <info@halitalptekin.com> * Halit Alptekin <info@halitalptekin.com>
* Richard Parsons <richard.lee.parsons@gmail.com> * Richard Parsons <richard.lee.parsons@gmail.com>
* han semaj <sangho.nah@gmail.com> * han semaj <sangho.nah@gmail.com>
* kirbyfan64 <kirbyfan64@users.noreply.github.com>

View File

@ -1251,19 +1251,23 @@ infinite series without consuming infinite amount of memory.
=> (list-comp x [x (take 15 (random-numbers 1 50))])]) => (list-comp x [x (take 15 (random-numbers 1 50))])])
[7, 41, 6, 22, 32, 17, 5, 38, 18, 38, 17, 14, 23, 23, 19] [7, 41, 6, 22, 32, 17, 5, 38, 18, 38, 17, 14, 23, 23, 19]
.. _zipwith:
zipwith zipwith
------- -------
`zipwith` zips multiple lists and maps the given function over the result. It is equilavent to calling `zip`, followed by calling `map` on the result. .. versionadded:: 0.9.13
In the following example, `zipwith` is used to add the contents of two lists together. The equilavent `map` and `zip` calls follow. `zipwith` zips multiple lists and maps the given function over the result. It is
equilavent to calling ``zip``, followed by calling ``map`` on the result.
In the following example, `zipwith` is used to add the contents of two lists
together. The equilavent ``map`` and ``zip`` calls follow.
.. code-block:: clj .. code-block:: clj
=> (import operator.add) => (import operator.add)
=> (zipwith operator.add [1 2 3] [4 5 6]) ; using zipwith => (zipwith operator.add [1 2 3] [4 5 6]) ; using zipwith
[5, 7, 9] [5, 7, 9]
=> (map operator.add (zip [1 2 3] [4 5 6])) ; using map+zip => (map operator.add (zip [1 2 3] [4 5 6])) ; using map+zip
[5, 7, 9] [5, 7, 9]

View File

@ -199,4 +199,3 @@
(.append ret (.append ret
`(setv ~name ~main))) `(setv ~name ~main)))
ret)) ret))

View File

@ -478,4 +478,3 @@
(assert-equal (list res) [4 4 4]) (assert-equal (list res) [4 4 4])
(setv res (zipwith operator.sub [3 7 9] [1 2 4])) (setv res (zipwith operator.sub [3 7 9] [1 2 4]))
(assert-equal (list res) [2 5 5])) (assert-equal (list res) [2 5 5]))