unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: 29489@debbugs.gnu.org
Subject: bug#29489: Obsolete gnus-remove-if and gnus-remove-if-not
Date: Tue, 28 Nov 2017 16:07:03 -0800	[thread overview]
Message-ID: <87a7z6c5i0.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87o9nmgwue.fsf@ericabrahamsen.net>

Noam Postavsky <npostavs@users.sourceforge.net> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Here's another one of these.
>>
>> I've replaced these with `seq-remove' and `seq-filter', and I suppose
>> someone might object to that -- the other option would be `cl-remove-if'
>> and `cl-remove-if-not'. I don't believe there's much practical difference.
>
> Neither the seq nor cl functions handle hash tables right?
>
>> -             (gnus-remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb t)
>> +             (seq-filter 'gnus-valid-move-group-p gnus-active-hashtb)
>>               nil prefix nil default))
>>             ((= 1 (length split-name))
>>              (gnus-group-completing-read
>>               prom
>> -	     (gnus-remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb t)
>> +	     (seq-filter 'gnus-valid-move-group-p gnus-active-hashtb)
>>               nil prefix 'gnus-group-history (car split-name)))
>
>> -(defun gnus-remove-if (predicate sequence &optional hash-table-p)
>> -  "Return a copy of SEQUENCE with all items satisfying PREDICATE removed.
>> -SEQUENCE should be a list, a vector, or a string.  Returns always a list.
>> -If HASH-TABLE-P is non-nil, regards SEQUENCE as a hash table."
>
> Although the docstring claims "hash table", while the code says...
>
>> -    (if hash-table-p
>> -	(mapatoms (lambda (symbol)
>> -		    (unless (funcall predicate symbol)
>> -		      (push symbol out)))
>> -		  sequence)
>
> obarray?

Shhh, that's my next patch to Gnus! Turning its "hash tables" into
actual hash tables. The obarrays are an impressive and horrible hack.

For this version of the patch, `seq-filter' works on vectors. In the
next patch, it's replaced by seq-filter->map-keys.

Eric






  reply	other threads:[~2017-11-29  0:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 17:02 bug#29489: Obsolete gnus-remove-if and gnus-remove-if-not Eric Abrahamsen
2017-11-28 17:23 ` John Wiegley
2017-11-28 18:01   ` Eric Abrahamsen
2017-11-28 23:44 ` Noam Postavsky
2017-11-29  0:07   ` Eric Abrahamsen [this message]
2017-11-29  0:40     ` Noam Postavsky
2017-11-29  1:42       ` Eric Abrahamsen
2017-11-29  2:36         ` Noam Postavsky
2017-11-29  3:31           ` Eric Abrahamsen
2017-11-30 18:29             ` Eric Abrahamsen
2017-12-02  2:38               ` Noam Postavsky
2017-12-02 18:50                 ` Eric Abrahamsen
2017-12-02 18:54                   ` Noam Postavsky
2017-12-02 18:53                     ` Eric Abrahamsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87a7z6c5i0.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=29489@debbugs.gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).