GNU bug report logs - #24014
24.5; doc string of `cl-reduce'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 17 Jul 2016 14:56:01 UTC

Severity: minor

Found in version 24.5

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: 24014 <at> debbugs.gnu.org
Subject: bug#24014: 24.5; doc string of `cl-reduce'
Date: Mon, 18 Jul 2016 10:54:21 +0200
[Message part 1 (text/plain, inline)]
On 2016-07-18 06:41, Drew Adams wrote:
> Even providing a functional-programming definition of `reduce' is
> better than just describing it in abstract terms, if we can't come
> up with a more down-to-earth description.

What about adding a few examples? Something like this maybe?

    (cl-reduce f '(1 2 3 4 5))
      ↔ (f (f (f (f 1 2) 3) 4) 5)

    (cl-reduce f '(1 2 3 4 5) :initial-value 0)
      ↔ (f (f (f (f (f 0 1) 2) 3) 4) 5)

    (cl-reduce f '(1 2 3 4 5) :from-end t)
      ↔ (f 1 (f 2 (f 3 (f 4 5))))

    (cl-reduce f '(1 2 3 4 5) :from-end t :initial-value 0)
      ↔ (f 1 (f 2 (f 3 (f 4 (f 5 0)))))

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 3 years and 212 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.