[Top][All Lists]

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

Re: seq-thread-first/last

From: Bozhidar Batsov
Subject: Re: seq-thread-first/last
Date: Fri, 30 Jan 2015 14:58:18 +0200

thread-first and thread-last have nothing to do with sequences, so I think there's nothing to do about them in regards to seq.el.

On 30 January 2015 at 14:33, Michael Heerdegen <address@hidden> wrote:
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.


(seq-thread-first (number-sequence 1 3)
  (* 10) (+ 1))

==> (11 21 31)

Or was your critique about use cases?



reply via email to

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