From 6829d6fb3a417c6d184dcbdcb3b3e3bf7a06ba59 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sat, 22 Feb 2014 02:21:34 +0200 Subject: [PATCH] Tweak the zipwith doc a bit and add @kirbyfan64 to AUTHORS. --- AUTHORS | 1 + docs/language/api.rst | 12 ++++++++---- hy/core/macros.hy | 1 - tests/native_tests/core.hy | 1 - 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/AUTHORS b/AUTHORS index fc94b27..fe17b8c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -42,3 +42,4 @@ * Halit Alptekin * Richard Parsons * han semaj +* kirbyfan64 diff --git a/docs/language/api.rst b/docs/language/api.rst index ff301ae..2e30ab4 100644 --- a/docs/language/api.rst +++ b/docs/language/api.rst @@ -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] diff --git a/hy/core/macros.hy b/hy/core/macros.hy index 8e3c21a..ff497b4 100644 --- a/hy/core/macros.hy +++ b/hy/core/macros.hy @@ -199,4 +199,3 @@ (.append ret `(setv ~name ~main))) ret)) - diff --git a/tests/native_tests/core.hy b/tests/native_tests/core.hy index 1a6ea61..15debf4 100644 --- a/tests/native_tests/core.hy +++ b/tests/native_tests/core.hy @@ -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])) -