[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Clojure-like syntactic sugar for an anonymous function liter
From: |
Stephen J. Turnbull |
Subject: |
Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal |
Date: |
Thu, 22 Jan 2015 19:15:12 +0900 |
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.
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, (continued)
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Oleh, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Daniel Colascione, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Oleh, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Daniel Colascione, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Oleh, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Daniel Colascione, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Oleh, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Ivan Andrus, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Leo Liu, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Lars Ingebrigtsen, 2015/01/24
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal,
Stephen J. Turnbull <=
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, David Kastrup, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Stephen J. Turnbull, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Oleh, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Stephen J. Turnbull, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Oleh, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, David Kastrup, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Oleh, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Tassilo Horn, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Oleh, 2015/01/22
- Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal, Stephen J. Turnbull, 2015/01/22