unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: emacs-devel@gnu.org
Subject: Re: maphash
Date: Thu, 24 Apr 2003 16:46:33 +0900	[thread overview]
Message-ID: <87sms88hie.fsf@tleepslib.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <E198VtY-0000uc-00@fencepost.gnu.org> (Richard Stallman's message of "Wed, 23 Apr 2003 21:51:28 -0400")

>>>>> "rms" == Richard Stallman <rms@gnu.org> 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.

  reply	other threads:[~2003-04-24  7:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <p04310100bac9ebec6275@[198.17.100.22]>
2003-04-24  1:51 ` maphash Richard Stallman
2003-04-24  7:46   ` Stephen J. Turnbull [this message]
2003-04-24 21:58     ` maphash Greg Hill
2003-04-26  2:32       ` maphash Richard Stallman
2024-09-10 15:52 maphash Helmut Eller
2024-09-11 14:23 ` maphash Mattias Engdegård
2024-09-11 22:45   ` maphash Andrea Corallo
2024-09-28  8:42     ` maphash Eli Zaretskii
2024-09-30 14:29       ` maphash Andrea Corallo
2024-10-01 16:31         ` maphash Andrea Corallo
2024-10-01 16:59           ` maphash Mattias Engdegård
2024-10-01 18:36             ` maphash Andrea Corallo
2024-10-02  8:43               ` maphash Mattias Engdegård
2024-10-03 11:18                 ` maphash Andrea Corallo
2024-10-04  8:30                   ` maphash Mattias Engdegård

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