From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal Date: Thu, 22 Jan 2015 01:38:28 -0800 Message-ID: <54C0C514.8020606@dancol.org> References: <54C05269.7050602@dancol.org> <87oaprfa3t.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JRcP1E4i1CrrCOBCPr5dAccNNb1t4GI0B" X-Trace: ger.gmane.org 1421919529 14051 80.91.229.3 (22 Jan 2015 09:38:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2015 09:38:49 +0000 (UTC) Cc: =?UTF-8?B?UmVuw6kgS3lsbGluZ3N0YWQ=?= , "emacs-devel@gnu.org" To: Oleh , David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 22 10:38:48 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 1YEEDw-0004yg-2S for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 10:38:48 +0100 Original-Received: from localhost ([::1]:52003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEEDv-0008Mu-G3 for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 04:38:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEEDg-0008Lh-5k for emacs-devel@gnu.org; Thu, 22 Jan 2015 04:38:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEEDf-0006Xz-2V for emacs-devel@gnu.org; Thu, 22 Jan 2015 04:38:32 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:60212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEEDe-0006Xs-Oq for emacs-devel@gnu.org; Thu, 22 Jan 2015 04:38:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=R/rjzYA7qNth3vrftHPBZzKQ+PnpJZyKJKrLNzE5WDI=; b=M6YThQ/tDk415Z2/6VwkEgQu2d/MMKsy3kzQ4/EXTK+nUcgY8EU/FTCGV4VWBUmMjQeccepAYbIBWJ7+KjSMfkrtgZysSYya/bSKfwpXzj8H5Btr1Exd56dHgRNvuVi3WLgRk5xZXfSzSUp/5ZGmq7uFkojpOfgduKGaTX4qd9lkrjzWmtAQFI8ysy+wHUFW3eVeKBqTi0EM/N3wzOP70aXxzUGIUT8oznXV0Shraw+JR9vDsVmbTmv21eSvBbgNZZCEnIcAAHPXyM0/v6W0qAXnL9ng51y0AVw0QI4o59/yW7DZ9VC6li/I6a9OGNecpyou+1YdyQAgTULMS2NTpw==; Original-Received: from [2601:8:b240:93::2b1] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YEEDd-0008Pr-Vn; Thu, 22 Jan 2015 01:38:30 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 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:181567 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JRcP1E4i1CrrCOBCPr5dAccNNb1t4GI0B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/22/2015 01:27 AM, Oleh wrote: >> Anonymous lambdas become considerably more useful once you have lexica= l >> scoping. The latter has not been around long enough to have had a maj= or >> impact on Elisp programming styles yet. >> >> That does not mean that I am convinced we want or need short-lambda. >=20 > The most popular library in MELPA, https://github.com/magnars/dash.el, > implements it (for a long time) like this: >=20 > (--map (* it it) '(1 2 3)) > ;; =3D> (1 4 9) >=20 > With my approach, it's: >=20 > (mapcar #(* % %) '(1 2 3)) > ;; =3D> (1 4 9) With idiomatic elisp, it's (mapcar (lambda (x) (* x x)) '(1 2 3)) Both alternatives above are more esoteric than the lambda form and are approximately as wrong. Note how the "lambda" is a prominent "I AM A FUNCTION" signal. I don't like the shorter forms, won't use them in my code, and wouldn't rely on calling packages. I don't want to change the Emacs reader to support this syntax. That said, I would like CL-style reader macros. I can't stop you from using reader macro support to implement your kind of function literal. The proliferation of overly-clever code like the above two snippets is a cost I am willing to bear for having reader macros macros. > I've grepped the useage of `--map' in all > 150 third party packages > that depend on `dash'. > I got 203 total results 60 different packages. This says a lot about > people wanting this feature for a long time. No it doesn't: you didn't provide a baseline. Allow me. ~/edev/trunk/lisp $ ppgrep -w '(lambda' | wc -l 6834 --JRcP1E4i1CrrCOBCPr5dAccNNb1t4GI0B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJUwMUUAAoJEN4WImmbpWBlzAoP/Ay0RlpLFnUvnIsr1Z32rNrf XimNmewsIw328ZOMfCxiCV1PqWCNA7AAX9tiCGpP9TLo/7B9P4DHAxW6MpNcL6qD gpDmzDeTY0H6jM/pa1tHDsYohu4IaGtafLe14ybQNGuXsaGOJKo3jRQLi0hJS5nb KOsqgTGexHN+Nf92aTYtlyHGVv75VRG3+QVinl6BiOhrDDELrDT/8RGISuFr00Sm VVyp+FUym+UYKt7Ka9Ho7FDtwG0WwjnljmBBKfdCd/SrceRCNHGYJAuMRYYbAUo3 k3fk0JDqOeMCzB/bdjEj43qyBCz0UEUe7y4vwv+aH/dVUnPmyGfEPBZY2RAvLYz3 TSBJEbiVWyx2BS3Vsr9FRQLDZy6gLBuLQRDxHaGEp/pjczdxmhaLPs5wxwhRHuYH culG+m6qUK4lOvx3DSsHnnFHRjpco6f0y/kHHekYG93Sp6F8/obPvKZevCesFY5u l8le2JRZWhXJveq3ieEW+np2Dzw0sV52xUa0tH1OqfBHEQiRT1fhnao1Yyz9n2ek xRuzqaczcXJeLEhf0E2UO3X/e5204v4+rkobcHntbmZVZc5uSMeXSpkuanWy91Pb T1k7LRGklE+AO1kw/T40n/I+C3s3s/dZwKneuVcz5N/qVqOg4epg/xwbpsSDmpx0 BSCqaEit7ipGPjLdpmJc =Wx5u -----END PGP SIGNATURE----- --JRcP1E4i1CrrCOBCPr5dAccNNb1t4GI0B--