From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Re: RFC: make maphash return a list Date: Tue, 18 Jun 2013 09:11:20 -0600 Organization: XCP-1 Message-ID: <51C07898.6030409@lanl.gov> References: <87txmjcnz5.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1371568308 7784 80.91.229.3 (18 Jun 2013 15:11:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Jun 2013 15:11:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Klaus-Dieter Bauer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 18 17:11:44 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UoxZI-0008Lo-PJ for ged-emacs-devel@m.gmane.org; Tue, 18 Jun 2013 17:11:36 +0200 Original-Received: from localhost ([::1]:49825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoxZI-0003G9-AW for ged-emacs-devel@m.gmane.org; Tue, 18 Jun 2013 11:11:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoxZD-0003A3-1j for emacs-devel@gnu.org; Tue, 18 Jun 2013 11:11:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoxZ6-0006Vf-JI for emacs-devel@gnu.org; Tue, 18 Jun 2013 11:11:30 -0400 Original-Received: from proofpoint5.lanl.gov ([204.121.3.53]:34591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoxZ6-0006VI-AJ for emacs-devel@gnu.org; Tue, 18 Jun 2013 11:11:24 -0400 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by proofpoint5.lanl.gov (8.14.4/8.14.4) with ESMTP id r5IFBL3B031499; Tue, 18 Jun 2013 09:11:21 -0600 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 4AD54D23D8A; Tue, 18 Jun 2013 09:11:21 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from [128.165.123.183] (xray-r06.lanl.gov [128.165.123.183]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 8A868D23D84; Tue, 18 Jun 2013 09:11:20 -0600 (MDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110717 Lanikai/3.1.11 In-Reply-To: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-06-18_05:2013-06-18, 2013-06-18, 1970-01-01 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 204.121.3.53 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160578 Archived-At: > (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.