From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Re: seq-thread-first/last Date: Fri, 30 Jan 2015 14:58:18 +0200 Message-ID: References: <878uglwmra.fsf@petton.fr> <87iofoof2j.fsf@udel.edu> <87k304ef9k.fsf@petton.fr> <87iofozfry.fsf_-_@web.de> <87fvaseaxe.fsf@petton.fr> <87wq44a2f3.fsf@fencepost.gnu.org> <87pp9wwiqh.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b10cb2d9e1b62050dde28fd X-Trace: ger.gmane.org 1422622727 6365 80.91.229.3 (30 Jan 2015 12:58:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Jan 2015 12:58:47 +0000 (UTC) Cc: Nicolas Petton , David Kastrup , emacs-devel To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 30 13:58:42 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YHB9l-0000w8-Jc for ged-emacs-devel@m.gmane.org; Fri, 30 Jan 2015 13:58:41 +0100 Original-Received: from localhost ([::1]:36480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHB9j-0004bS-J3 for ged-emacs-devel@m.gmane.org; Fri, 30 Jan 2015 07:58:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHB9V-0004bK-Hj for emacs-devel@gnu.org; Fri, 30 Jan 2015 07:58:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHB9U-0006d9-Ev for emacs-devel@gnu.org; Fri, 30 Jan 2015 07:58:25 -0500 Original-Received: from mail-ig0-x22f.google.com ([2607:f8b0:4001:c05::22f]:49515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHB9Q-0006cR-3I; Fri, 30 Jan 2015 07:58:20 -0500 Original-Received: by mail-ig0-f175.google.com with SMTP id hn18so2907834igb.2; Fri, 30 Jan 2015 04:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+1ZDlDDZVrN/0bTkBHBPXKeBZUwlPUlemFs96R/BlZg=; b=vUcyd9OrDWJyKCjbbfjaRl2rEulMDA4KTAD9+QXUj1TAmdk5Nwz741NRHMcMiSmoCT Li80StA5VWKJxtpNtTILhUiZVKnNhNJD1YE5PPHdcGOAbAiGoDaCBvWzyFavQHDfC5zL T/jqE9vAjFw65ZsU4VSSfJ8y20/+/POkpXRB5NAjdRiQzAwLdRrANKN0I1XO5rru3NXS ZMi4KstRWjmXGQ7K6eMU0HdmEcRopJbqaki7epWJnTpnpUBmhJF0UqIT2Z+zeAtcKQ1W bOrc/ceiSv0qw1vPGnNXnumwOPGnM8A+YD4y40A4IybroHvY009E747olN+TPVy3WdS7 U4Vw== X-Received: by 10.50.32.71 with SMTP id g7mr2552733igi.4.1422622698902; Fri, 30 Jan 2015 04:58:18 -0800 (PST) Original-Received: by 10.36.9.18 with HTTP; Fri, 30 Jan 2015 04:58:18 -0800 (PST) In-Reply-To: <87pp9wwiqh.fsf@web.de> X-Google-Sender-Auth: 5vI4KrFhsvKt64xq2YswJX_FXqw X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182053 Archived-At: --047d7b10cb2d9e1b62050dde28fd Content-Type: text/plain; charset=UTF-8 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 wrote: > David Kastrup 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. > > --047d7b10cb2d9e1b62050dde28fd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
thread-first and thread-last have nothing to do with seque= nces, so I think there's nothing to do about them in regards to seq.el.=

On 30 Janua= ry 2015 at 14:33, Michael Heerdegen <michael_heerdegen@web.de&g= t; wrote:
David K= astrup <dak@gnu.org> writes:

> Hard to corroborate if the people mentioning their wishes don't bo= ther
> mentioning what their desired functions are supposed to do.

Do you mean me?=C2=A0 I thought my explanation was clear.=C2=A0 Anyw= ay, the
semantic would be like this:

--8<---------------cut here---------------start------------->8---

(defmacro seq-thread-first (seq &rest forms)
=C2=A0 (declare (indent 1))
=C2=A0 (let ((x (make-symbol "x")))
=C2=A0 =C2=A0 `(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)
=C2=A0 (* 10) (+ 1))

=3D=3D> (11 21 31)


Or was your critique about use cases?


Thanks,

Michael.


--047d7b10cb2d9e1b62050dde28fd--