From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Add procedures to convert alists into hash tables Date: Sun, 17 Nov 2013 22:22:32 -0500 Message-ID: <87bo1i75s7.fsf@netris.org> References: <5263E55A.6040307@worcester.edu> <87txg0p805.fsf@gnu.org> <87iow6pqox.fsf@netris.org> <87mwlhlmgr.fsf@gnu.org> <5289726B.6030302@worcester.edu> <52897E7B.6000602@worcester.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384745007 8378 80.91.229.3 (18 Nov 2013 03:23:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Nov 2013 03:23:27 +0000 (UTC) Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , guile-devel To: David Thompson Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Nov 18 04:23:31 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ViFQx-0002Ny-2T for guile-devel@m.gmane.org; Mon, 18 Nov 2013 04:23:31 +0100 Original-Received: from localhost ([::1]:41081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViFQw-0004eY-4F for guile-devel@m.gmane.org; Sun, 17 Nov 2013 22:23:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViFQl-0004dX-6V for guile-devel@gnu.org; Sun, 17 Nov 2013 22:23:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViFQf-0004Qi-7h for guile-devel@gnu.org; Sun, 17 Nov 2013 22:23:19 -0500 Original-Received: from world.peace.net ([96.39.62.75]:47607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViFQf-0004Q6-4S; Sun, 17 Nov 2013 22:23:13 -0500 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1ViFQN-00053N-65; Sun, 17 Nov 2013 22:22:55 -0500 In-Reply-To: <52897E7B.6000602@worcester.edu> (David Thompson's message of "Sun, 17 Nov 2013 21:42:03 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16747 Archived-At: Hi David, David Thompson writes: > +@deffn {Scheme Procedure} alist->hash-table alist > +@deffnx {Scheme Procedure} alist->hashq-table alist > +@deffnx {Scheme Procedure} alist->hashv-table alist > +@deffnx {Scheme Procedure} alist->hashx-table hash assoc alist > +Convert @var{alist} into a hash table. When keys are repeated in > +@var{alist}, the leftmost association takes precedence. > + > +@example > +(use-modules (ice-9 hash-table)) > +(alist->hash-table '((foo . 1) (bar . 2))) > +@end example > + > +When converting to an extended hash table, custom @var{hash} and > +@var{assoc} procedures must be provided. > + > +@example > +(alist->hash-table hash assoc '((foo . 1) (bar . 2))) This should be 'alist->hashx-table'. Other than that, the patch looks good to me! Mark