emacs-devel
[Top][All Lists]
Advanced

[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.



reply via email to

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