[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: seq-thread-first/last
From: |
Michael Heerdegen |
Subject: |
Re: seq-thread-first/last |
Date: |
Fri, 30 Jan 2015 13:33:42 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
> Hard to corroborate if the people mentioning their wishes don't bother
> mentioning what their desired functions are supposed to do.
Do you mean me? I thought my explanation was clear. Anyway, the
semantic would be like this:
--8<---------------cut here---------------start------------->8---
(defmacro seq-thread-first (seq &rest forms)
(declare (indent 1))
(let ((x (make-symbol "x")))
`(seq-map (lambda (,x) (thread-first ,x ,@forms)) ,seq)))
--8<---------------cut here---------------end--------------->8---
though that's probably not the most efficient implementation.
seq-thread-last analog.
Example:
(seq-thread-first (number-sequence 1 3)
(* 10) (+ 1))
==> (11 21 31)
Or was your critique about use cases?
Thanks,
Michael.
- Re: Would seq-range and seq-mapcat be useful?, (continued)
- What about seq-slice? (Was: Would seq-range and seq-mapcat be useful?), Mark Oteiza, 2015/01/30
- Re: What about seq-slice? (Was: Would seq-range and seq-mapcat be useful?), Nicolas Petton, 2015/01/30
- Re: seq-thread-first/last, David Kastrup, 2015/01/30
- Re: seq-thread-first/last, Nicolas Petton, 2015/01/30
- Re: seq-thread-first/last,
Michael Heerdegen <=
- Re: seq-thread-first/last, Bozhidar Batsov, 2015/01/30
- Re: seq-thread-first/last, Artur Malabarba, 2015/01/30
- Re: seq-thread-first/last, Michael Heerdegen, 2015/01/30
- Re: What about seq-slice?, Mark Oteiza, 2015/01/30