[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]
From: |
Joost Kremers |
Subject: |
Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs] |
Date: |
Sun, 10 May 2020 02:02:42 +0200 |
User-agent: |
mu4e 1.4.4; emacs 27.0.91 |
On Sun, May 10 2020, Alfred M. Szmidt wrote:
[threading macros]
In these cases, I see absolutley no benefit of using ->, it just
makes
it more "magical" for no particular reason.
For sure, whether to use a threading macro is a large part
personal preference, but IMHO they *can* make code more readable.
Basically, you can convert:
(print (eval (read)))
into:
(-> (read)
eval
print)
The first form is backwards, in a way: `print` is written first,
but it's what happens last. With `->` you can write the functions
in the order in which they're executed.
For a longer discussion with more examples, see here:
<https://yoo2080.wordpress.com/2014/02/23/threading-macros-from-dash-for-emacs-lisp/>
And I don't think it's been pointed out yet (though I may have
missed some messages in this thread), that `->` and `->>` are part
of Elisp since Emacs 25, except that they are called
`thread-first` and `thread-last` (somewhat unfortunately, I
believe, because they have nothing to do with CPU threads and are
therefore unrelated to the other Elisp functions whose names start
with `thread-`.)
--
Joost Kremers
Life has its moments
- discoveribility [Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]], (continued)
- discoveribility [Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]], Alfred M. Szmidt, 2020/05/09
- Re: discoveribility [Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]], Yuri Khan, 2020/05/09
- Re: discoveribility [Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]], Philippe Vaucher, 2020/05/09
- Re: discoveribility [Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]], Philippe Vaucher, 2020/05/09
- Re: discoveribility [Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]], Alfred M. Szmidt, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Richard Stallman, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Philippe Vaucher, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Alfred M. Szmidt, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Philippe Vaucher, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Alfred M. Szmidt, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs],
Joost Kremers <=
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Alfred M. Szmidt, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Dmitry Gutov, 2020/05/09
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Richard Stallman, 2020/05/10
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Joost Kremers, 2020/05/11
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], tomas, 2020/05/11
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Philippe Vaucher, 2020/05/11
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], tomas, 2020/05/11
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Philippe Vaucher, 2020/05/11
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], 조성빈, 2020/05/11
- Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs], Joost Kremers, 2020/05/11