Tweak the zipwith doc a bit and add @kirbyfan64 to AUTHORS.
This commit is contained in:
parent
d282d65cde
commit
6829d6fb3a
1
AUTHORS
1
AUTHORS
@ -42,3 +42,4 @@
|
||||
* Halit Alptekin <info@halitalptekin.com>
|
||||
* Richard Parsons <richard.lee.parsons@gmail.com>
|
||||
* han semaj <sangho.nah@gmail.com>
|
||||
* kirbyfan64 <kirbyfan64@users.noreply.github.com>
|
||||
|
@ -1251,19 +1251,23 @@ infinite series without consuming infinite amount of memory.
|
||||
=> (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]
|
||||
|
||||
.. _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
|
||||
|
||||
=> (import operator.add)
|
||||
|
||||
=> (zipwith operator.add [1 2 3] [4 5 6]) ; using zipwith
|
||||
[5, 7, 9]
|
||||
|
||||
=> (map operator.add (zip [1 2 3] [4 5 6])) ; using map+zip
|
||||
[5, 7, 9]
|
||||
|
@ -199,4 +199,3 @@
|
||||
(.append ret
|
||||
`(setv ~name ~main)))
|
||||
ret))
|
||||
|
||||
|
@ -478,4 +478,3 @@
|
||||
(assert-equal (list res) [4 4 4])
|
||||
(setv res (zipwith operator.sub [3 7 9] [1 2 4]))
|
||||
(assert-equal (list res) [2 5 5]))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user