From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: maphash Date: Thu, 24 Apr 2003 16:46:33 +0900 Organization: The XEmacs Project Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87sms88hie.fsf@tleepslib.sk.tsukuba.ac.jp> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1051170550 3113 80.91.224.249 (24 Apr 2003 07:49:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 24 Apr 2003 07:49:10 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Apr 24 09:49:08 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 198bTg-0000nw-00 for ; Thu, 24 Apr 2003 09:49:08 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 198bZo-00081J-00 for ; Thu, 24 Apr 2003 09:55:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 198bSY-0003a8-09 for emacs-devel@quimby.gnus.org; Thu, 24 Apr 2003 03:47:58 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 198bS7-0002oc-00 for emacs-devel@gnu.org; Thu, 24 Apr 2003 03:47:31 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 198bS0-0002P5-00 for emacs-devel@gnu.org; Thu, 24 Apr 2003 03:47:24 -0400 Original-Received: from tleepslib.sk.tsukuba.ac.jp ([130.158.98.109]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 198bRv-0002C8-00; Thu, 24 Apr 2003 03:47:19 -0400 Original-Received: from steve by tleepslib.sk.tsukuba.ac.jp with local (Exim 3.36 #1 (Debian)) id 198bRB-0006O6-00; Thu, 24 Apr 2003 16:46:33 +0900 Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Wed, 23 Apr 2003 21:51:28 -0400") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) XEmacs/21.5 (cabbage) Original-cc: Greg Hill X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13418 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13418 >>>>> "rms" == Richard Stallman writes: I have discovered by experimentation that maphash actually does what I hoped it would, which is to pass key/value pairs to the mapping function in the same order in which they were added to the table. rms> An small anount of experimentation doesn't show you it will rms> always to do that. It would be necessary to study the code rms> and construct a proof, before we could promise this to the rms> users. If I understand the OP's description correctly, I can already promise you that code depending on such a feature won't be portable to XEmacs: (let ((my-hash (make-hash-table)) result) (puthash "key1" "val1" my-hash) (puthash "key2" "val2" my-hash) (puthash "key3" "val3" my-hash) (maphash (lambda (k v) (setq result (cons k result))) my-hash) (reverse result)) => ("key2" "key3" "key1") -- Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.