unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: wsnyder@wsnyder.org (Wilson Snyder)
Cc: emacs-devel@gnu.org
Subject: Re: Suggestions to remove one alist's members from another
Date: Sat, 10 Apr 2010 02:31:02 +0900	[thread overview]
Message-ID: <87vdc04jop.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <20100409141649.833BD18838C@wsnyder.org>

Wilson Snyder writes:

 > >Why not build a hash table (of the cars of the elements) from not-alist
 > >instead?  Then you can just walk in-alist, skipping elements that are in
 > >the hash (that is, whose cars are in it) and adding the rest to out-alist
 > >and (their cars to) the hash.
 > 
 > Thanks, that's a good improvement. I also would add each
 > in-list element after each test for hash membership, as I
 > want to eliminate duplicates.

Note that Davis's algorithm already does this, IIUC.  Elements that
are just skipped don't need to be added because they are in the hash
already, while elements that are added to the out-alist get added to
the hash, too.

 > It still seems like this should already exist somewhere...

The Common Lisp emulation has such operations, but I think they're not
stable.




  parent reply	other threads:[~2010-04-09 17:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 13:02 Suggestions to remove one alist's members from another Wilson Snyder
2010-04-09 14:11 ` Davis Herring
2010-04-09 14:16   ` Wilson Snyder
2010-04-09 14:45     ` Drew Adams
2010-04-09 14:48     ` Davis Herring
2010-04-09 15:05     ` David Kastrup
2010-04-09 17:31     ` Stephen J. Turnbull [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-04-09 12:27 Wilson Snyder
2010-04-09 15:12 ` David Kastrup

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=87vdc04jop.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=emacs-devel@gnu.org \
    --cc=wsnyder@wsnyder.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).