all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Davis Herring <herring@lanl.gov>
To: Klaus-Dieter Bauer <bauer.klaus.dieter@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: RFC: make maphash return a list
Date: Tue, 18 Jun 2013 09:11:20 -0600	[thread overview]
Message-ID: <51C07898.6030409@lanl.gov> (raw)
In-Reply-To: <loom.20130618T101446-868@post.gmane.org>

>   (let (mapped-hash) (maphash (lambda (k v) (push (return-something k
>     v) mapped-hash))) (mapcar 'modification-2 (mapcar 'modification-1
>     mapped-hash)))

For what it's worth, you can at least here write

(let (mapped-hash)
  (maphash
   (lambda (k v)
     (push (modification-2 (modification-1 (return-something k v)))
	   mapped-hash))
   hash)
  mapped-hash)

(so long as the various functions are pure enough to allow the
reordering).  Indentation makes it longer than

(let (mapped-hash)
  (maphash (lambda (k v) (push (return-something k v) mapped-hash))
	   hash)
  (mapcar 'modification-2 (mapcar 'modification-1 mapped-hash)))

(which in 80 columns can even have the tiny line appended to the
previous), but I think it is conceptually simpler.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.



  reply	other threads:[~2013-06-18 15:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-03 17:59 RFC: make maphash return a list Wilfred Hughes
2013-05-03 23:12 ` Pascal J. Bourguignon
2013-05-04  5:29 ` Stephen J. Turnbull
2013-05-05  0:06   ` Wilfred Hughes
2013-06-18  8:17     ` Klaus-Dieter Bauer
2013-06-18 15:11       ` Davis Herring [this message]
2013-06-18 20:06         ` Klaus-Dieter Bauer

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51C07898.6030409@lanl.gov \
    --to=herring@lanl.gov \
    --cc=bauer.klaus.dieter@gmail.com \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.