emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Clojure-like syntactic sugar for an anonymous function liter


From: David Kastrup
Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal
Date: Thu, 22 Jan 2015 11:20:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

"Stephen J. Turnbull" <address@hidden> writes:

> 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,

They are useful for calculated bindings.  Context-sensitive mouse-overs
or active links, regular bindings (I am currently working on some
private project involving keybindings to keys on an accordion keyboard,
and little surprisingly those are all different but all of the same
kind).

Stuff like that.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]