emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: make maphash return a list


From: Davis Herring
Subject: Re: RFC: make maphash return a list
Date: Tue, 18 Jun 2013 09:11:20 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110717 Lanikai/3.1.11

>   (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 via email to

[Prev in Thread] Current Thread [Next in Thread]