From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/54970 Path: main.gmane.org!not-for-mail From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de> Newsgroups: gmane.emacs.gnus.general Subject: Re: Using CL in Gnus Date: Thu, 27 Nov 2003 23:41:31 +0100 Organization: Dept. of Theoretical Physics, University of Ulm Sender: ding-owner@lists.math.uh.edu Message-ID: References: <87oev1uyzw.fsf@zip.com.au> <87k75oktn7.fsf@zip.com.au> Reply-To: reiner.steib@gmx.de NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1069972992 30835 80.91.224.253 (27 Nov 2003 22:43:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 Nov 2003 22:43:12 +0000 (UTC) Original-X-From: ding-owner+M3510@lists.math.uh.edu Thu Nov 27 23:43:07 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1APUqp-0000ZJ-00 for ; Thu, 27 Nov 2003 23:43:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1APUq4-00048u-00; Thu, 27 Nov 2003 16:42:20 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1APUpu-00048m-00 for ding@lists.math.uh.edu; Thu, 27 Nov 2003 16:42:10 -0600 Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by justine.libertine.org (Postfix) with ESMTP id A02EF3A0051 for ; Thu, 27 Nov 2003 16:42:09 -0600 (CST) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1APUps-0002Oz-00 for ; Thu, 27 Nov 2003 23:42:08 +0100 Mail-Followup-To: ding@gnus.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1APUpr-0002Or-00 for ; Thu, 27 Nov 2003 23:42:07 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1APUpq-0007zn-00 for ; Thu, 27 Nov 2003 23:42:06 +0100 Original-Lines: 66 Original-X-Complaints-To: usenet@sea.gmane.org X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l;3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2;n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 On 26 Nov 2003, Reiner Steib <- 4.uce.03.r.s@nurfuerspam.de wrote: > >> Do I understand the docs correctly, that mapc and mapcar _only_ differ >> in the result they give, but not in the side effects? > > No they differ more. `mapc' can take an arbitrary number of sequences > as arguments `mapcar' only one. I don't doubt your explanations, but I don't understand it from the doc-strings (GNU Emacs 21.3): ,----[ C-h f mapc RET ] | mapc is a built-in function. | (mapc FUNCTION SEQUENCE) |=20 | Apply FUNCTION to each element of SEQUENCE for side effects only. | Unlike `mapcar', don't accumulate the results. Return SEQUENCE. | SEQUENCE may be a list, a vector, a bool-vector, or a string. `---- ,----[ C-h f mapcar RET ] | mapcar is a built-in function. | (mapcar FUNCTION SEQUENCE) |=20 | Apply FUNCTION to each element of SEQUENCE, and make a list of the result= s. | The result is a list just as long as SEQUENCE. | SEQUENCE may be a list, a vector, a bool-vector, or a string. `---- > Furthermore IMO if you read `mapc' you know a function is used only > for the side effects it has; on the other hand `mapcar' shouldn't be > used for side effects IMO. Thanks for your explanations. Is this the case in the examples of mapc from gnus.el and gnus-agent.el? >> check if we could use mapcar instead of mapc in gnus.el and >> gnus-agent? IMHO we should replace them, if there's no disadvantage. > > Better check for the Emacs version and provide a macro. People have to > read code and the meaning of mapc is different from the one of mapcar. > > [...] >> To make clear that the code in Gnus 5.10 _should_ not use mapc (beside > > I don't understand your point here.=20 Well, if programmers see mapc at many places in Gnus code, they might be tempted to use it without thinking about possible alternatives (alternatives w/o using CL functions). But -as we are in feature freeze- we will not have a significant amount of _new_ code. Thus _if_ there is no disadvantage in using mapcar in gnus.el and gnus-agent.el (only 4 occurrences in total, see above) we _may_ replace them instead of providing a "compatibility hack". Maybe it's better if I cease this thread, because I'm sure you and Katsumi know much more about this (not being ironic at all here!) and he did the right thing. Bye, Reiner. --=20 ,,, (o o) ---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/