From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Re: The poor state of documentation of pcase like things. Date: Thu, 17 Dec 2015 08:34:27 -0800 Message-ID: References: <20151216202605.GA3752@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450370105 21988 80.91.229.3 (17 Dec 2015 16:35:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Dec 2015 16:35:05 +0000 (UTC) Cc: Alan Mackenzie , Emacs developers To: Kaushal Modi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 17 17:34:56 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 1a9bW3-0004l8-SU for ged-emacs-devel@m.gmane.org; Thu, 17 Dec 2015 17:34:56 +0100 Original-Received: from localhost ([::1]:54640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bW2-0006GX-RT for ged-emacs-devel@m.gmane.org; Thu, 17 Dec 2015 11:34:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bVn-0006GN-4T for emacs-devel@gnu.org; Thu, 17 Dec 2015 11:34:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9bVj-0003IX-VH for emacs-devel@gnu.org; Thu, 17 Dec 2015 11:34:39 -0500 Original-Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:35720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bVj-0003IM-Pk for emacs-devel@gnu.org; Thu, 17 Dec 2015 11:34:35 -0500 Original-Received: by mail-pa0-x22b.google.com with SMTP id jx14so16033948pad.2 for ; Thu, 17 Dec 2015 08:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mail-followup-to:mime-version:content-type; bh=I3FiORIIrwjec/ApMwvqIOSdnuOPlIVCMGkO09frEms=; b=Yvu9oF2FdZZjaPJQ5z0lkoTWhdb8kVvCViL8nwBYqJx08iBtH2GeUHnTTn5aBrwdAL 6KWOFewO0G69xIvv2wnwczsptmPG/YknSyv1xy0SwzlVX/h//+9gugAgpkFe9e6g6Uq/ OF7WHTs0iCNlVVFIy4P1Dle13Zsvs/H1MbIR70MONWPeKBBtAkG91v1jz1wKtyCoWlVR 1onfGR4kbA9eEWGIBm9YpIdElJN63HvvhRJmw1xU1Ktdy1bEsXW2gww0PHaqOdgvfLIW e4cx4bhD714C+5cs8OcqoMZNI+wOEA9PM6EgiL3X4Yj/q3nkFlZZ4Nk3S3SHaBJsnp+I uK2w== X-Received: by 10.66.90.194 with SMTP id by2mr73226400pab.2.1450370075119; Thu, 17 Dec 2015 08:34:35 -0800 (PST) Original-Received: from Vulcan.local (76-234-68-79.lightspeed.frokca.sbcglobal.net. [76.234.68.79]) by smtp.gmail.com with ESMTPSA id fc6sm16823335pac.44.2015.12.17.08.34.33 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 17 Dec 2015 08:34:33 -0800 (PST) X-Google-Original-From: "John Wiegley" Original-Received: by Vulcan.local (Postfix, from userid 501) id 82C901193D4F0; Thu, 17 Dec 2015 08:34:32 -0800 (PST) In-Reply-To: (Kaushal Modi's message of "Wed, 16 Dec 2015 15:53:38 -0500") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (darwin) Mail-Followup-To: Kaushal Modi , Alan Mackenzie , Emacs developers X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::22b 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:196425 Archived-At: >>>>> Kaushal Modi writes: > I would welcome a short tutorial on how (and why) to use pcase. There are several examples shown here: http://www.emacswiki.org/emacs/PatternMatching pcase makes a lot more sense if you're used to pattern matching in functional languages, where you describe a pattern (not unlike destructuring-bind) whose "shape" is intended to match the set of shapes you want to successful match against. Since pattern matching like this isn't something I had ever encountered outside of FP, I agree that a tutorial is in order. I'm willing to volunteer for this. -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2