From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Hash tables Date: Thu, 11 Sep 2003 18:42:17 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030911224217.GA26720@fencepost> References: <16224.62294.152189.23291@nick.uklinux.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1063322055 12129 80.91.224.253 (11 Sep 2003 23:14:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2003 23:14:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Sep 12 01:14:13 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19xadh-0004mz-00 for ; Fri, 12 Sep 2003 01:14:13 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 19xaei-0006Sw-00 for ; Fri, 12 Sep 2003 01:15:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19xaEh-00077N-EF for emacs-devel@quimby.gnus.org; Thu, 11 Sep 2003 18:48:23 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 19xaEE-0006z5-Di for emacs-devel@gnu.org; Thu, 11 Sep 2003 18:47:54 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 19xaEC-0006yN-9i for emacs-devel@gnu.org; Thu, 11 Sep 2003 18:47:52 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19xaEB-0006yE-Pm for emacs-devel@gnu.org; Thu, 11 Sep 2003 18:47:51 -0400 Original-Received: from miles by fencepost.gnu.org with local (Exim 4.20) id 19xa8n-000740-BF; Thu, 11 Sep 2003 18:42:17 -0400 Original-To: Nick Roberts Content-Disposition: inline In-Reply-To: <16224.62294.152189.23291@nick.uklinux.net> User-Agent: Mutt/1.3.28i Blat: Foop X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16313 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16313 On Thu, Sep 11, 2003 at 11:12:38PM +0100, Nick Roberts wrote: > but I want to pass some arguments to gdb-var-operation. I plan to change > maphash to: > > (maphash FUNCTION TABLE &optional ARGS) > > so that FUNCTION gets called with KEY, VALUE and ARGS. > > This won't be an easy task for me so I'd like some reassurance that its > a) desirable and b) do-able. The traditional way of doing this sort of thing in lisp is to bind variables around the call to maphash, which your function can read (or write), e.g.: (let ((extra-info ...) (total sum 0)) (maphash (lambda (key val) (setq total (+ total (calculate-stuff key val extra-info)))) some-hash-table)) -Miles -- We have met the enemy, and he is us. -- Pogo