From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 387e1e1: New version of `seq-let' based on a pcase pattern Date: Mon, 11 May 2015 23:13:14 +0200 Message-ID: <871times2d.fsf@petton.fr> References: <20150510182502.23307.63648@vcs.savannah.gnu.org> <874mnjdycw.fsf@petton.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1431379371 28490 80.91.229.3 (11 May 2015 21:22:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 May 2015 21:22:51 +0000 (UTC) Cc: Nicolas Petton , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 11 23:22:41 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 1Yrv9s-0004nQ-P2 for ged-emacs-devel@m.gmane.org; Mon, 11 May 2015 23:22:40 +0200 Original-Received: from localhost ([::1]:39754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrv9s-0006M5-0P for ged-emacs-devel@m.gmane.org; Mon, 11 May 2015 17:22:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrv9c-0006Lm-GI for emacs-devel@gnu.org; Mon, 11 May 2015 17:22:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrv9Y-0004dR-FS for emacs-devel@gnu.org; Mon, 11 May 2015 17:22:24 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:57851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrv9Y-0004dE-C0 for emacs-devel@gnu.org; Mon, 11 May 2015 17:22:20 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 17BE220AB7 for ; Mon, 11 May 2015 17:13:16 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Mon, 11 May 2015 17:13:16 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=Kncuag1SY4lmP4lE/R51764ct+A=; b=OVbzx tNFCFdwHx7U3S9rhTnunf+YRBVZh5aQY+LwPXr7+TfperDKL1NChPCinKoPHj7Re GcQwasg0DJLd0u7+CxwKY4Ap+vYMqpa9XtRBU25Yj4oF2+0ED3Ae9WUJDv7I+/ZQ tbHOIj3y7dPrqQpzea1YWVAzRdgssJ+UsbLqPA= X-Sasl-enc: sWQ+c4OAEsOVJtTizklpXcRUxt/91HGShaLnLD/nz57J 1431378795 Original-Received: from blueberry (unknown [92.139.225.158]) by mail.messagingengine.com (Postfix) with ESMTPA id 65776680175; Mon, 11 May 2015 17:13:15 -0400 (EDT) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.111.4.28 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:186439 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Stefan Monnier writes: >> Yes. My idea of it was that you bind a sequence like the following: >> (seq [a b [c d]]) > > I was thinking of (seq a b (seq c d)). > > You could add support for (seq a b [c d]), if you want since that > currently wouldn't collide with any pcase pattern, tho I'm not sure it's > worth the added complexity for the user. > >> But then how can I have `seq-let' work the way it did until now? For >> instance: >> (seq-let [a [b [c]]] my-vector >> ...) > > You expand [a [b [c]]] to (seq a (seq b (seq c))) before passing it to > pcase-let. > >>>> + (push `(app (seq--reverse-args #'seq--nested-elt >>>> + (reverse (cons ,index ',nes= ted-indexes))) >>>> + ,name) >>> This reverse plus seq--reverse-args business seems >>> hideously inefficient. Why do you need that? >> because of the way the `app' pattern works. Or maybe I'm missing >> something? > > Why wouldn't > > `(app (seq--nested-elt ',(reverse (cons index nested-indexes))) ,name) > > work as well? Or, once you get rid of the nested case, > > `(app (seq-elt ,index) ,name) I understand what you meant now. It indeed makes sense, and the pcase pattern would be much more consistent. I'll push another commit. Cheers, Nico > > > -- Stefan =2D-=20 Nicolas Petton http://nicolas-petton.fr --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJVURtqAAoJECM1h6R8IHkQynEIAIHO8cSgwpJdx2S+odAZOmRC e5Y2hZe96+gV4JnzqdrfWo6u/VkzUGdKSlwzhxIoNN6/D4oHQi22xTA9n6sBQgf3 V/S+as1qtjPo0KYpVk5GUWUHO81I5AhuAwVXeb+wHI5rtBjTG6DhTJL9t1n7pJl9 A3N1HlG+zHABty0Fxf2XTMd/0BHqQpzsbStkLTenaU0RsucG/y/KS11zwGykw/IP EfujXoP/fjCWX+XuAEMH9jzPj1s3fksKAfJjPJG+48WV4QPPjrEUGv/U98hd2iLF KKnU1+3oMNPO09vDH7qHWwmnuPX42wzUSd06ALmcPo30057l9Qhu9BH1gIAOOL8= =y9El -----END PGP SIGNATURE----- --=-=-=--