Skip to content

Commit

Permalink
Tweak the zipwith doc a bit and add @kirbyfan64 to AUTHORS.
Browse files Browse the repository at this point in the history
  • Loading branch information
berkerpeksag committed Feb 22, 2014
1 parent d282d65 commit 6829d6f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@
* Halit Alptekin <[email protected]>
* Richard Parsons <[email protected]>
* han semaj <[email protected]>
* kirbyfan64 <[email protected]>
12 changes: 8 additions & 4 deletions docs/language/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

`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.
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]
1 change: 0 additions & 1 deletion hy/core/macros.hy
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,3 @@
(.append ret
`(setv ~name ~main)))
ret))

1 change: 0 additions & 1 deletion tests/native_tests/core.hy
Original file line number Diff line number Diff line change
Expand Up @@ -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]))

0 comments on commit 6829d6f

Please sign in to comment.