From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Mon, 29 Oct 2018 16:12:45 -0700 Message-ID: <87muqwxs7m.fsf@ericabrahamsen.net> References: <83tvlcsnee.fsf@gnu.org> <86mur137n8.fsf@gmail.com> <20181029130132.GB4195@ACM> <20181029134722.GC4195@ACM> <87lg6gifnb.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540854663 10676 195.159.176.226 (29 Oct 2018 23:11:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 Oct 2018 23:11:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 30 00:10:58 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHGgR-0002ck-Ra for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2018 00:10:56 +0100 Original-Received: from localhost ([::1]:49507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHGiY-0006q4-1G for ged-emacs-devel@m.gmane.org; Mon, 29 Oct 2018 19:13:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHGiR-0006pw-CI for emacs-devel@gnu.org; Mon, 29 Oct 2018 19:13:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHGiO-0003We-8s for emacs-devel@gnu.org; Mon, 29 Oct 2018 19:12:59 -0400 Original-Received: from mail.ericabrahamsen.net ([50.56.99.223]:40877) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHGiO-0003Tc-1K for emacs-devel@gnu.org; Mon, 29 Oct 2018 19:12:56 -0400 Original-Received: from localhost (50-251-205-17-static.hfc.comcastbusiness.net [50.251.205.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 546D73F094; Mon, 29 Oct 2018 23:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1540854768; bh=l1Un9NEi7mh9O+Mo8HaJNUCA8UezDto84ZHi3SJDLng=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=XHiXbzcrRUbeTXYrMFYLSOBc1H8D1olhIKAYm5JQiWOjC4Gj57cIVXZPfFENG92Op v/UR3tATBbT5jpzcaQ9UkiictLNIacNvY7lq1y8XraptYpxtOqHlEM2CzcZC9TqIZl wNj8ssAdatoq7SkhTFwwh02af9fNeIeln54UQ0Uk= In-Reply-To: <87lg6gifnb.fsf@web.de> (Michael Heerdegen's message of "Mon, 29 Oct 2018 22:53:12 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 50.56.99.223 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:230783 Archived-At: Michael Heerdegen writes: > Stefan Monnier writes: > >> I'd rather keep it defined in terms of its differences w.r.t `dolist`, >> but if really needed, we could change the doc so it doesn't rely on >> `dolist`s own doc at all. > > I also don't think that would be an improvement. > >> +As in the case of `pcase-let', PATTERN is matched under the >> assumption +that it *will* match. > > What this leaves a bit unclear: It sounds like matching itself happens > differently (user visibly). Or does it just mean "if PATTERN doesn't > match, the behavior [of pcase-dolist] is undefined/ this is not > allowed". I wonder if the manual shouldn't have a section somewhere making explicit the difference between `pcase' -- where a single value is matched against many patterns, and may fail to match altogether, and destructuring is only one of the use-cases -- and the other pcase-derived forms, where many values are matched against a single pattern, which *must* match (or error), and destructuring is kind of the whole point. Conceptually, they're pretty different. BTW I just looked at the new manual section for pcase -- that's much better! Eric