From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/72585 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Symbol's function definition is void: remove-if-not Date: Tue, 05 Oct 2010 16:32:41 +0900 Organization: Emacsen advocacy group Message-ID: References: <87sk0n9umn.fsf@escher.home> <8739sn2tch.fsf@keller.adm.naquadah.org> <87eic6hb2h.fsf@lifelogs.com> <8762xhewzl.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1286264075 14342 80.91.229.12 (5 Oct 2010 07:34:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 5 Oct 2010 07:34:35 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M20957@lists.math.uh.edu Tue Oct 05 09:34:34 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P321i-0005lw-4R for ding-account@gmane.org; Tue, 05 Oct 2010 09:33:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1P321a-00053A-Cs; Tue, 05 Oct 2010 02:33:22 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1P321Y-00052v-VM for ding@lists.math.uh.edu; Tue, 05 Oct 2010 02:33:20 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1P321X-0007Kj-Of for ding@lists.math.uh.edu; Tue, 05 Oct 2010 02:33:20 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1P321W-0002Xv-00 for ; Tue, 05 Oct 2010 09:33:18 +0200 Original-Received: from localhost ([127.0.0.1]:56636) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1P320z-0007Lv-GU for ding@gnus.org; Tue, 05 Oct 2010 02:32:45 -0500 X-Hashcash: 1:20:101005:ding@gnus.org::AHEJ65vb8T/gKSx8:00003rai X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:xHBPZyNK3V6a2k66Vj5RSgOChpk= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:72585 Archived-At: Ted Zlatanov wrote: [...] >>> It looks like `remove-if-not' is used in several places actually: >>> gnus-art.el: (remove-if-not pred (mailcap-mime-types)) >>> gnus-group.el: (remove-if-not 'symbolp collection))) >>> gnus-score.el: (remove-if-not > Those three should be able to use `gnus-remove-if' with the predicate > inverted, I think. No, gnus-group.el is not. `gnus-group-completing-read' takes a hash table as an argument, in addition to `gnus-read-move-group-name' in gnus-sum.el. >>> gnus-sum.el: (remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb) >>> gnus-sum.el: prom (remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb) KY> The use of `remove-if-not' in gnus-sum.el is a wrong approach since [...] > So it's potentially a bug. I am no expert on ELisp data types, > especially between Emacs and XEmacs. Should we take this to emacs-devel > or does someone know a good solution? > I think it's acceptable to simply provide `gnus-remove-hashtb-keys-if' > rather than try to reimplement CL. So maybe that's the right way. I'd like to try it (maybe tomorrow). BTW, as you know `mapatoms' is the only means to access elements of a hash table: ,---- (info "(elisp)Creating Symbols") ---- | there is no way to find all the symbols in an obarray except | using `mapatoms' (below). `---- It doesn't care of non-interned symbols in a hash table, so the code `(remove-if-not 'symbolp collection)' used in gnus-group.el is useless: (let ((hashtable (make-vector 4096 0))) hashtable) => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... (let ((hashtable (make-vector 4096 0)) rest) (intern "foo" hashtable) (intern "bar" hashtable) (mapatoms (lambda (symbol) (push symbol rest)) hashtable) rest) => (bar foo)