From: Daniel Colascione <dancol@dancol.org>
To: Oleh <ohwoeowho@gmail.com>, David Kastrup <dak@gnu.org>
Cc: "René Kyllingstad" <listmailemacs@kyllingstad.com>,
"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal
Date: Thu, 22 Jan 2015 01:38:28 -0800 [thread overview]
Message-ID: <54C0C514.8020606@dancol.org> (raw)
In-Reply-To: <CAA01p3p7Vrcf9oxOUe-aTG6PUWTKfJpvZ3jQB8H--tdq9MXQBA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
On 01/22/2015 01:27 AM, Oleh wrote:
>> Anonymous lambdas become considerably more useful once you have lexical
>> scoping. The latter has not been around long enough to have had a major
>> impact on Elisp programming styles yet.
>>
>> That does not mean that I am convinced we want or need short-lambda.
>
> 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)
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-01-22 9:38 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-21 21:38 [PATCH] Clojure-like syntactic sugar for an anonymous function literal Oleh
2015-01-21 22:28 ` samer
2015-01-21 22:37 ` Oleh
2015-01-21 23:36 ` Artur Malabarba
2015-01-21 23:46 ` Oleh
2015-01-22 0:54 ` Artur Malabarba
2015-01-22 0:57 ` Artur Malabarba
2015-01-22 1:29 ` Daniel Colascione
2015-01-22 2:21 ` Drew Adams
2015-01-22 13:35 ` Lars Brinkhoff
2015-01-22 7:20 ` Stephen J. Turnbull
2015-01-22 8:04 ` Oleh
2015-01-22 8:16 ` David Kastrup
2015-01-22 9:07 ` Andreas Schwab
2015-01-22 9:19 ` Oleh
2015-01-22 8:52 ` René Kyllingstad
2015-01-22 9:17 ` David Kastrup
2015-01-22 9:27 ` Oleh
2015-01-22 9:38 ` Daniel Colascione [this message]
2015-01-22 9:45 ` Oleh
2015-01-22 9:50 ` Daniel Colascione
2015-01-22 9:52 ` Oleh
2015-01-22 9:57 ` Daniel Colascione
2015-01-22 10:05 ` Oleh
2015-01-22 16:57 ` Ivan Andrus
2015-01-23 0:54 ` Leo Liu
2015-01-24 23:33 ` Lars Ingebrigtsen
2015-01-22 10:15 ` Stephen J. Turnbull
2015-01-22 10:20 ` David Kastrup
2015-01-22 14:21 ` Stephen J. Turnbull
2015-01-22 14:31 ` Oleh
2015-01-23 1:03 ` Stephen J. Turnbull
2015-01-22 10:22 ` Oleh
2015-01-22 10:32 ` David Kastrup
2015-01-22 10:40 ` Oleh
2015-01-22 10:56 ` Tassilo Horn
2015-01-22 11:03 ` Oleh
2015-01-22 14:35 ` Stephen J. Turnbull
2015-01-22 14:44 ` Oleh
2015-01-23 1:11 ` Stephen J. Turnbull
2015-01-22 14:48 ` Artur Malabarba
2015-01-23 1:17 ` Stephen J. Turnbull
2015-01-22 11:03 ` Phillip Lord
2015-01-22 9:35 ` René Kyllingstad
2015-01-22 9:45 ` Daniel Colascione
2015-01-22 9:49 ` David Kastrup
2015-01-22 9:53 ` Daniel Colascione
2015-01-22 10:22 ` David Kastrup
2015-01-22 12:37 ` Artur Malabarba
2015-01-22 12:46 ` Phillip Lord
2015-01-22 12:49 ` Daniel Colascione
2015-01-22 13:07 ` Oleh
2015-01-22 22:10 ` Richard Stallman
2015-01-23 9:28 ` David Kastrup
2015-01-24 1:09 ` Richard Stallman
2015-01-24 8:29 ` Thien-Thi Nguyen
2015-01-23 10:33 ` Eli Zaretskii
2015-01-22 16:44 ` Stefan Monnier
2015-01-22 17:22 ` Oleh
2015-01-22 20:34 ` Daniel Colascione
2015-01-22 23:36 ` Stefan Monnier
2015-01-22 23:38 ` Reader macros (Was: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal) Daniel Colascione
2015-01-23 9:33 ` Reader macros David Kastrup
2015-01-23 11:45 ` Daniel Colascione
2015-01-23 12:27 ` David Kastrup
2015-01-23 10:34 ` [PATCH] Clojure-like syntactic sugar for an anonymous function literal Phillip Lord
2015-01-23 10:47 ` Oleh
2015-01-23 11:53 ` Phillip Lord
2015-01-23 12:02 ` Daniel Colascione
2015-01-23 11:50 ` Daniel Colascione
2015-01-23 13:18 ` Phillip Lord
2015-01-23 20:24 ` Stefan Monnier
2015-01-23 20:52 ` Stefan Monnier
2015-01-23 22:25 ` Phillip Lord
2015-01-23 7:44 ` Oleh
2015-01-22 23:28 ` Stefan Monnier
2015-01-22 18:30 ` Artur Malabarba
-- strict thread matches above, loose matches on Subject: below --
2015-01-26 22:22 Barry OReilly
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=54C0C514.8020606@dancol.org \
--to=dancol@dancol.org \
--cc=dak@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=listmailemacs@kyllingstad.com \
--cc=ohwoeowho@gmail.com \
/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.