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: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources] Date: Mon, 29 Oct 2018 13:26:13 -0400 Message-ID: <38aa830d-740e-af4d-9071-9aa0d9c10f04@gmail.com> References: <20151216202605.GA3752@acm.fritz.box> <56893C8C.3060200@yandex.ru> <87oad2irtd.fsf@fencepost.gnu.org> <5689456A.1010601@yandex.ru> <87egdy8tyz.fsf@fencepost.gnu.org> <56895FDE.4060406@yandex.ru> <8760za8r4a.fsf@fencepost.gnu.org> <87h9iunkcg.fsf@web.de> <87h8hc4xw2.fsf_-_@web.de> <83tvlcsnee.fsf@gnu.org> <87pnw037ar.fsf@web.de> <83ftwvs7y9.fsf@gnu.org> <877ei7mkfh.fsf@web.de> <87a7mze7tl.fsf@web.de> <87zhuykjjh.fsf@web.de> <871s8aesdc.fsf@portable.galex-713.eu> <87tvl6dc3e.fsf_-_@portable.galex-713.eu> <87efc9isxj.fsf@web.de> <87tvl5653j.fsf@portable.galex-713.eu> 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 1540833965 5341 195.159.176.226 (29 Oct 2018 17:26:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 Oct 2018 17:26:05 +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 Mon Oct 29 18:26:01 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 1gHBIe-0001Di-Sy for ged-emacs-devel@m.gmane.org; Mon, 29 Oct 2018 18:26:01 +0100 Original-Received: from localhost ([::1]:47511 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHBKl-00050r-Ae for ged-emacs-devel@m.gmane.org; Mon, 29 Oct 2018 13:28:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHBJO-0004XI-0l for emacs-devel@gnu.org; Mon, 29 Oct 2018 13:26:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHBJJ-0002bY-HG for emacs-devel@gnu.org; Mon, 29 Oct 2018 13:26:45 -0400 Original-Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:42036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHBJE-0002QI-Lg for emacs-devel@gnu.org; Mon, 29 Oct 2018 13:26:37 -0400 Original-Received: by mail-qk1-x734.google.com with SMTP id u68so1475705qkg.9 for ; Mon, 29 Oct 2018 10:26:16 -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=eW17GSAB5QPuPjsHCD6MmEtasq6+srf0ofoDVGXd4yE=; b=BNNgZMTrGhCGYFqT5x+7zTurixS6WsNBXSnxRkk4XKizodhhFPpEqX9CPP9ITAjzJM 2CrJkZ8Qw9seyrzFTbWLTtV4pQVAKcLl0AvQkLPC3U+303lBFRkD/98M+CYwcWSqV0co cAscuUvdLAjDQx2gnK0eGG18+kouM2lvjhSL1ZZJ6q/TWALu/8pUzSSaRitPvKQnVKEM 6swei/mebRn58gDVYidUX9MJXum2lG57B4qLLu+PxZ8kZADRf/L7cnsN6kXmmuunRFm7 o02DhzkVy0IL74Dw7pW0PrV9gokChZHmFcTIGFeGWVas+hjSDvr7p/0WZELRBe8FiS+N 0/Vg== 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=eW17GSAB5QPuPjsHCD6MmEtasq6+srf0ofoDVGXd4yE=; b=RKspVgLaOhYkw3dbLF3wZtmlXLNO7jCsTOmKi0xvM+9B1DP/VnIoGia7LqRik9FvGN oDcAqcEVF+NSjhttZiFz7SJ8JXMljVSR74iH+0W8D63bE7JDYi+Cvd3Rra1SJqWrsbOV QAn5NDQfhBoTglSO+rydRdioEfWQwuUDWTkgeGCn2Z+bbJbaBSluLJqsmH+Xa1987wos R61o5DF3Fklp5iLFtNXBeCXRVIV/0tbRfFpo5M51o08HxYnJrqomBDCti6bhkVz8mVKD YApe3IKziN+rPf+mOFUJq1tTMmlU1CkAJ5qYqaoZTDzRAzATBAgwU3MRV/Wbp3yPMIM1 Fx9Q== X-Gm-Message-State: AGRZ1gIqFPY7/LVuIEfENm5hXfdSneukzW8aPveUSH/c7m6vshFHIv4W +dRkdpwRBa/B4+53xsGps2/hVeT1 X-Google-Smtp-Source: AJdET5ec3BdGSxqMvmIt8xvPcVkwTV0NVY+hxsvpwnz+Jeeja164K+cZRc8KQg0vHobefUaYEQdV3A== X-Received: by 2002:a37:5d3:: with SMTP id 202mr8409272qkf.6.1540833975188; Mon, 29 Oct 2018 10:26:15 -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 h25-v6sm18916704qtc.44.2018.10.29.10.26.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 10:26:14 -0700 (PDT) In-Reply-To: <87tvl5653j.fsf@portable.galex-713.eu> 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::734 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:230768 Archived-At: On 28/10/2018 19.09, Garreau, Alexandre wrote: > the pattern look like what the data should be. adding “`” and “,” > destroy this feature, because the pattern no longer looks like what > is matched. Maybe it's a matter of perspective? Adding "`" and "," is precisely what makes the pattern look like the data: the invariant is that if you have a match, repeating the pattern produces the original data. Here's a concrete example: (pcase '(1 2 3 4) (`(,x ,y . ,z) `(,x ,y . ,z))) is a no-op. In other words, q-patterns are equations with multiple unknown variables (holes). When you write a q-pattern, you're asking "what values should the variables in this pattern take so that evaluating the pattern would return the matched data?" Clément.