Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: `reduce', a cl function, used in shr.el
Date: Fri, 08 Oct 2010 10:02:49 +0900	[thread overview]
Message-ID: <b4mlj69ebt2.fsf@jpl.org> (raw)

Is this ok?

--- shr.el~	2010-10-07 22:00:24 +0000
+++ shr.el	2010-10-08 01:01:35 +0000
@@ -548,8 +548,8 @@
 	  (aset natural-widths i (max (aref natural-widths i)
 				      (cadr column)))
 	  (setq i (1+ i)))))
-    (let ((extra (- (reduce '+ suggested-widths)
-		    (reduce '+ widths)))
+    (let ((extra (- (apply '+ (append suggested-widths nil))
+		    (apply '+ (append widths nil))))
 	  (expanded-columns 0))
       (when (> extra 0)
 	(dotimes (i length)

The following is `reduce' from which the cl keywords feature is
removed; same as `(apply FUNCTION (append SEQ nil))':

(defun shr-reduce (function seq)
  "Reduce two-argument FUNCTION across SEQ."
  (or (listp seq) (setq seq (append seq nil)))
  (let ((accum (pop seq)))
    (while seq
      (setq accum (funcall function accum (pop seq))))
    accum))



             reply	other threads:[~2010-10-08  1:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-08  1:02 Katsumi Yamaoka [this message]
2010-10-08  1:15 ` Lars Magne Ingebrigtsen
2010-10-08  1:26   ` Katsumi Yamaoka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mlj69ebt2.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).