From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Replace trivial pcase occurrences in the Emacs sources Date: Thu, 1 Nov 2018 11:28:20 -0400 Message-ID: <8f870a4f-6c04-22ca-f791-61b197a06146@gmail.com> References: <86mur137n8.fsf@gmail.com> <20181029130132.GB4195@ACM> <20181029134722.GC4195@ACM> <83r2g8klf9.fsf@gnu.org> <9bfd9d19-3b6b-57cd-50a0-24660707768b@gmail.com> <20181030181434.GB5705@ACM> <87231bd6-d4a3-e117-06b9-774ec482d62f@gmail.com> <867ehzx9j8.fsf@gmail.com> <3806f024-c562-150a-99b7-53c9d36824ba@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1541086011 6879 195.159.176.226 (1 Nov 2018 15:26:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2018 15:26:51 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 01 16:26:46 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 1gIErs-0001dD-UL for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2018 16:26:45 +0100 Original-Received: from localhost ([::1]:42640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIEtz-0002Jw-9L for ged-emacs-devel@m.gmane.org; Thu, 01 Nov 2018 11:28:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIEtn-0002Hu-Cc for emacs-devel@gnu.org; Thu, 01 Nov 2018 11:28:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIEti-0007UF-Ft for emacs-devel@gnu.org; Thu, 01 Nov 2018 11:28:42 -0400 Original-Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]:42929) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gIEta-0007BH-9Z for emacs-devel@gnu.org; Thu, 01 Nov 2018 11:28:34 -0400 Original-Received: by mail-qt1-x82c.google.com with SMTP id z20-v6so21480595qti.9 for ; Thu, 01 Nov 2018 08:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=OUf+dozInMwXfhGusYWvsVu+DgEM4gjxa/ORRMRVU8w=; b=mvVndaroQTRYh5atqTs4wweZJJiZ0sri1bni5QjJpO5vSEY7BOJdzNXG9tG0eMu71i yNVC3q4o+DDxXtgAn7OPI8T71poc3URLoZKQssdJ3SXpBRQBw6uWZFuYqRt/4p3yHoLd Zv6G3qv/4Xum+aGpHNXQ8Wvgi5Brsi+kZMw125xDyoyvGHFj58RLITvDT7tSdmplnd5Z QeShgBQx0rbVjuXYJGCideMIqFA6kh/Jw62szihDT5nmVdIDyVVLoIarpHXQTCoGG+R5 ngbs7P/DvJ52LFYCOfVM7v555uEZgWA9dNVbpHj3b8MNmv9kYRYz2ODTIyyXuquSdtwZ BNHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OUf+dozInMwXfhGusYWvsVu+DgEM4gjxa/ORRMRVU8w=; b=oh8321lVkYKLipn/YM1qb/7iSmHwmBaqNVcnMyhy4FVwd0gWX/1h2i8qj99Kqt9kEc HnKbG7njZVbT3fCQjOfiK92wZya8TQRhwAHuMi6+CIH+d0oxj3q73b5xCNhA6zlgaejD w/GGP6f2a644yrW0flqL+r2LI+t/hc7WvwTnT7ZX5IvXg4NTVTm3ag/6LQXYGuVIp323 Q3kw+kBhoS4yh7rEVsNB36/vsidzeWlzAf1E6b/ZhEXbFyM7bguE7cy4s0mGPQc4YAeI HSBO51YOdKLeZ0s7FkVjjt+gK6lDatm8jt8P1FWeK1f0SHiCEB3x6QosZrsvCbOe+Yqv jM3w== X-Gm-Message-State: AGRZ1gL1DyCHAxQfSf88IvG3R2udx5Lx42guuoZpz7RergbYaA1OXuXE iLu2z9CqYqx/jrRvUaDYEGVJgpFc X-Google-Smtp-Source: AJdET5ep8cG90+sQNg3snMpuahx3BGSRsKBImxGurSwZ6x5DjR/lkeaZOun/FWVeUsuU6/0T0Akcsw== X-Received: by 2002:a0c:83c2:: with SMTP id k60-v6mr6978967qva.232.1541086102289; Thu, 01 Nov 2018 08:28:22 -0700 (PDT) Original-Received: from [18.26.2.123] (26-2-123.dynamic.csail.mit.edu. [18.26.2.123]) by smtp.gmail.com with ESMTPSA id p67-v6sm15962219qkf.92.2018.11.01.08.28.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 08:28:21 -0700 (PDT) In-Reply-To: Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82c 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:230953 Archived-At: On 01/11/2018 10.44, Andy Moreton wrote: > The difference is that the non-pcase constructs can document exactly > which types are acceptable as arguments. For the pcase macros, the > acceptable argument types are not fixed by the pcase macro, but depend > on the patterns used. That is harder to explain clearly, and harder for > the user to reason about correctness of the code that they write. Thanks, I see what you mean (though it soujnds more like a general indictment of pcase, not just of the "fail silently" behavior of pcase-*). Conversely, though, you could argue that documenting exactly which data are acceptable is precisely what the patterns passed to pcase-let do: if I write `(pcase-let* ((`(,a . ,b) xyz)) …)`, I'm specifying that `xyz' should be a cons.