From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] seq-let c856843: New macro seq-let, providing destructuring support to seq.el Date: Sat, 02 May 2015 03:07:41 -0400 Message-ID: References: <20150501173408.20062.32100@vcs.savannah.gnu.org> <87wq0sf8pw.fsf@petton.fr> <87383gyo99.fsf@petton.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430550478 17460 80.91.229.3 (2 May 2015 07:07:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 May 2015 07:07:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Nicolas Petton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 02 09:07:49 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 1YoRWf-0005DM-3U for ged-emacs-devel@m.gmane.org; Sat, 02 May 2015 09:07:49 +0200 Original-Received: from localhost ([::1]:56268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoRWe-0006EY-AP for ged-emacs-devel@m.gmane.org; Sat, 02 May 2015 03:07:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoRWb-0006ET-O2 for emacs-devel@gnu.org; Sat, 02 May 2015 03:07:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoRWY-0003kD-Is for emacs-devel@gnu.org; Sat, 02 May 2015 03:07:45 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:3774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoRWY-0003k9-F0 for emacs-devel@gnu.org; Sat, 02 May 2015 03:07:42 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFAGvvdVS4rw4V/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDSSIE6IRjBsMPQkDAQKDPgODcASjY4RY X-IPAS-Result: AgUFAGvvdVS4rw4V/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDSSIE6IRjBsMPQkDAQKDPgODcASjY4RY X-IronPort-AV: E=Sophos;i="5.11,557,1422939600"; d="scan'208";a="118060401" Original-Received: from 184-175-14-21.dsl.teksavvy.com (HELO pastel.home) ([184.175.14.21]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 May 2015 03:07:42 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id E0AE51A75; Sat, 2 May 2015 03:07:41 -0400 (EDT) In-Reply-To: <87383gyo99.fsf@petton.fr> (Nicolas Petton's message of "Fri, 01 May 2015 23:35:46 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:186116 Archived-At: > I see, it would indeed makes sense to have it. I'll have a look at how > pcase works internally and how patterns can be defined. grep for pcase-defmacro: that should give you a good starting point. > I think having both would make sense though as `seq-let' is IMO simpler > to use. Maybe one could reuse code from the other. I don't think the `seq' pcase pattern can be defined using seq-let, but seq-let could easily be defined as a wrapper that expands to a pcase-let. BTW, another advantage of defining a pcase pattern is that you could then also do things like (pcase-dolist ((seq a b c) my-things) ...) -- Stefan