From 4b28bb0685cbfec8f0804f6bf136b1a19d41a7c3 Mon Sep 17 00:00:00 2001 From: Henrikh Kantuni Date: Fri, 3 Apr 2020 16:02:24 +0400 Subject: [PATCH] "symmetrize -body-parts" to "symmetrize-body-parts" --- content/cftbat/do-things.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/cftbat/do-things.html b/content/cftbat/do-things.html index f027ae3b..7845ce06 100644 --- a/content/cftbat/do-things.html +++ b/content/cftbat/do-things.html @@ -1070,7 +1070,7 @@

Better Symmetrizer with reduce

If you provide an initial value, reduce starts by applying the given function to the initial value and the first element of the sequence rather than the first two elements of the sequence.

-

One detail to note is that, in these examples, reduce takes a collection of elements, [1 2 3 4], and returns a single number. Although programmers often use reduce this way, you can also use reduce to return an even larger collection than the one you started with, as we’re trying to do with symmetrize-body-parts. reduce abstracts the task “process a collection and build a result,” which is agnostic about the type of result returned. To further understand how reduce works, here’s one way that you could implement it:

+

One detail to note is that, in these examples, reduce takes a collection of elements, [1 2 3 4], and returns a single number. Although programmers often use reduce this way, you can also use reduce to return an even larger collection than the one you started with, as we’re trying to do with symmetrize-body-parts. reduce abstracts the task “process a collection and build a result,” which is agnostic about the type of result returned. To further understand how reduce works, here’s one way that you could implement it:

(defn my-reduce
   ([f initial coll]
    (loop [result initial