From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: Re: Symbol's function definition is void: remove-if-not
Date: Tue, 05 Oct 2010 16:32:41 +0900 [thread overview]
Message-ID: <b4msk0lnlgm.fsf@jpl.org> (raw)
In-Reply-To: <8762xhewzl.fsf@lifelogs.com>
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)
next prev parent reply other threads:[~2010-10-05 7:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-03 15:13 Stephen Berman
2010-10-03 15:23 ` Julien Danjou
2010-10-04 3:49 ` Ted Zlatanov
2010-10-04 7:15 ` Katsumi Yamaoka
2010-10-04 16:36 ` Ted Zlatanov
2010-10-04 16:42 ` Lars Magne Ingebrigtsen
2010-10-05 7:32 ` Katsumi Yamaoka [this message]
2010-10-08 16:35 ` Ted Zlatanov
2010-10-04 16:30 ` Ted Zlatanov
2010-10-04 16:42 ` Lars Magne Ingebrigtsen
2010-10-08 16:36 ` Ted Zlatanov
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=b4msk0lnlgm.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).