From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal Date: Thu, 22 Jan 2015 19:15:12 +0900 Message-ID: <877fwfunnz.fsf@uwakimon.sk.tsukuba.ac.jp> References: <54C05269.7050602@dancol.org> <87oaprfa3t.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1421921732 17905 80.91.229.3 (22 Jan 2015 10:15:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2015 10:15:32 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: Oleh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 22 11:15:28 2015 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 1YEEnO-0007bm-PH for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 11:15:26 +0100 Original-Received: from localhost ([::1]:52134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEEnN-0000e6-Ga for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 05:15:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEEnJ-0000e1-8E for emacs-devel@gnu.org; Thu, 22 Jan 2015 05:15:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEEnD-0006h3-CT for emacs-devel@gnu.org; Thu, 22 Jan 2015 05:15:21 -0500 Original-Received: from shako.sk.tsukuba.ac.jp ([130.158.97.161]:41864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEEnD-0006fh-2x for emacs-devel@gnu.org; Thu, 22 Jan 2015 05:15:15 -0500 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by shako.sk.tsukuba.ac.jp (Postfix) with ESMTPS id 6AD7D1C38B8; Thu, 22 Jan 2015 19:15:12 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 47C011A2D18; Thu, 22 Jan 2015 19:15:12 +0900 (JST) In-Reply-To: X-Mailer: VM undefined under 21.5 (beta34) "kale" acf1c26e3019 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 130.158.97.161 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:181577 Archived-At: Oleh writes: > The most popular library in MELPA, https://github.com/magnars/dash.el, > implements it (for a long time) like this: > > (--map (* it it) '(1 2 3)) > ;; => (1 4 9) > > With my approach, it's: > > (mapcar #(* % %) '(1 2 3)) > ;; => (1 4 9) That looks almost like Perl! Now I'm -2. Just require dash. Personally, I don't see a huge advantage to anonymous functions anyway, not even in an interactive repl, and would surely spell it either (defun square (x) (* x x)) (mapcar #'square '(1 2 3)) or (labels ((square (x) (* x x))) (mapcar #'square '(1 2 3))) in a library. (Does Emacs have `labels'? If not, `flet'.) Tastes vary, of course, but to me the existence of dash really looks like a good argument for those with your tastes to use dash, not to add this to Emacs.