From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: pcase docs Date: Fri, 22 Jan 2016 20:58:06 +0100 Message-ID: <87r3h95qs3.fsf@web.de> References: <83a8o8gcya.fsf@gnu.org> <87zivx5ree.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1453492803 19552 80.91.229.3 (22 Jan 2016 20:00:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Jan 2016 20:00:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: John Wiegley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 22 20:59:54 2016 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 1aMhs9-0006Kj-Az for ged-emacs-devel@m.gmane.org; Fri, 22 Jan 2016 20:59:53 +0100 Original-Received: from localhost ([::1]:55322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMhs8-0007gz-L4 for ged-emacs-devel@m.gmane.org; Fri, 22 Jan 2016 14:59:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMhs5-0007dz-EB for emacs-devel@gnu.org; Fri, 22 Jan 2016 14:59:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMhs1-0007YY-E0 for emacs-devel@gnu.org; Fri, 22 Jan 2016 14:59:49 -0500 Original-Received: from mout.web.de ([212.227.17.12]:59327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMhs1-0007YP-4W for emacs-devel@gnu.org; Fri, 22 Jan 2016 14:59:45 -0500 Original-Received: from drachen.dragon ([92.77.162.209]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MUW7T-1aVKik3puV-00RIgf; Fri, 22 Jan 2016 20:59:42 +0100 In-Reply-To: <87zivx5ree.fsf@web.de> (Michael Heerdegen's message of "Fri, 22 Jan 2016 20:46:17 +0100") Original-Lines: 30 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:JaoFTh4uErP9OlM5H8RkqCic2nK4Bl/FpA9LCjCmpMZITit1NA7 /siNqPy49YiVt8GVrjhix19Db9CeGEgjtYGPzVWGJHj/PTJh+Wq+7s0Zeh5XwN+pF4viwUf wyjOf4v0SxBrjYBaT5IdkVfS8v0nDI9xATJPIU9zy6k699XaAH4/lKMEKT/eq8wgM/mBfAv +/+naVYkt1BQAG8AAikyg== X-UI-Out-Filterresults: notjunk:1;V01:K0:13Cf7+wXJKE=:zfxu6+kO/UY/KjCFn6hUSL OazCDXGmdtRBEhJvQe8K5WR42g9SKW2C2iCyZAU0xid6fGd9IldhZpt00JoUUfTUP7lyZq0F7 pbcjTToAPjsCgQ1kWee1Zm5m5P5Fat/aBkY3uw6TlhUPt+gYdQCfi2rUOByfDiUDlRrCbF6qS lYgld0EgKgB2a80HtVHBke/hCyqcUbKXxobVKByZW/LpAPJl63Xz8NQRr9nQxXI6FfWIGZ9ia EVRxkDiqhb56t46UiDR3oz4zpOybxg/Fu5pTO80uhS5ybt+JiyzCHgqI3kRI+13KeENQhTY2s LxV3lNAgEuBGrPkqxroo5+p+3JBYjiJ7tIo/HXEYf9zO5xX2YCRhJCW5rZgIX9co7zs/Elkoy wo6WwbLEAW/A5+GAf88fA5VYsO1o47XjrdmOfDzRK8AkfPhehH29Yt6px2hk0emhhKAQ/rHJY 1HKRXLTlV/MfZnv8FZLGoKQYwYH8tYZ6rqip1nRDMaj8mlHjzNNGfRepao3DG8m4/5QnpwfXU SANGa1cZ8oWIBdBTHJol9aCP3gbgxor74GKMYWQSw++pb7EK8gUE+xxFIiL+WeZrsJr9XGSbH f+Qelb5RjhRF4GdoqoA4apNPnFq5sp67lInozjDgNJztmOi6M8cluKT5iUoSqMi/b4GNgebIK 85jw3mKEIZVKvHYNg+PS7OJLFy0mRH/D6g9NwoYnkoKRlCjwKepQG3M+CyzIRVD1RfWLcpSIv +5pwzfS4q74CqK8jti7tJf/jpzCeG7GbnEQBF5U1Cu/v8h5RjS72bfcWAsfMlA9EKFlGczsx X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.12 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:198599 Archived-At: Michael Heerdegen writes: > > All of them? I guess that means I have more text to write for you. And pcase-defmacro is intended for developers of (internal) packages like seq etc, so it must not have to be described broadly. Just say that it is basically like `defmacro': you define how to expand the defined pattern to a new pattern used instead of the one defined. This is done recursively (like for defmacro), and when compiling (also like for defmacro). It's a simple thing. A small example could be helpful. You could also make the definition of ` an example. If you leave out vectors, it's quite simple and very instructive: --8<---------------cut here---------------start------------->8--- (pcase-defmacro \` (qpat) (cond ((eq (car-safe qpat) '\,) (cadr qpat)) ((consp qpat) `(and (pred consp) (app car ,(list '\` (car qpat))) (app cdr ,(list '\` (cdr qpat))))) ((or (stringp qpat) (integerp qpat) (symbolp qpat)) `',qpat) (t (error "Unknown QPAT: %S" qpat)))) --8<---------------cut here---------------end--------------->8--- Michael.