From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.bugs Subject: bug#22601: guile.texi section on ice-9 match Date: Sun, 19 Mar 2017 16:42:54 -0700 Message-ID: <590DEFE0-5B65-4691-8A6F-00142B3E0473@gmail.com> References: <70AB27D7-FFFA-4447-8AAF-7A1C9295E1D7@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_B8BE103E-06C6-46F5-85D1-3FDC82715F57" X-Trace: blaine.gmane.org 1489967055 29493 195.159.176.226 (19 Mar 2017 23:44:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Mar 2017 23:44:15 +0000 (UTC) To: 22601@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Mar 20 00:44:11 2017 Return-path: Envelope-to: guile-bugs@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 1cpkUW-0006f9-RL for guile-bugs@m.gmane.org; Mon, 20 Mar 2017 00:44:05 +0100 Original-Received: from localhost ([::1]:58544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpkUd-0000K2-0t for guile-bugs@m.gmane.org; Sun, 19 Mar 2017 19:44:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpkUX-0000Jk-3v for bug-guile@gnu.org; Sun, 19 Mar 2017 19:44:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpkUU-0005l1-1y for bug-guile@gnu.org; Sun, 19 Mar 2017 19:44:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37465) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cpkUT-0005kx-Sl for bug-guile@gnu.org; Sun, 19 Mar 2017 19:44:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cpkUT-0002qs-M4 for bug-guile@gnu.org; Sun, 19 Mar 2017 19:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Wette Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 19 Mar 2017 23:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22601 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 22601-submit@debbugs.gnu.org id=B22601.148996698610887 (code B ref 22601); Sun, 19 Mar 2017 23:44:01 +0000 Original-Received: (at 22601) by debbugs.gnu.org; 19 Mar 2017 23:43:06 +0000 Original-Received: from localhost ([127.0.0.1]:35664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpkTa-0002pX-48 for submit@debbugs.gnu.org; Sun, 19 Mar 2017 19:43:06 -0400 Original-Received: from mail-pg0-f44.google.com ([74.125.83.44]:32826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpkTX-0002oZ-M5 for 22601@debbugs.gnu.org; Sun, 19 Mar 2017 19:43:04 -0400 Original-Received: by mail-pg0-f44.google.com with SMTP id n190so68330825pga.0 for <22601@debbugs.gnu.org>; Sun, 19 Mar 2017 16:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=tRsL9eyfLsEXtD7oqBN4wzrLc/UfHEZIdoYKMQRi4Tk=; b=Qt2a7m3w5+A3BOxNwC8nGp0moPbTBBz6wGOh18FsnirR37gsAJ4fdFMBOYhv8EpXu4 4rkI0TrJ0W4gpDlfrIuvBJVBtGgiO8TFWPf/X50WRP6Dy4CN9BKpF6C/T5psMWYPT7i9 JqYupwuTAbwQl9XgVUmrFBuS9dDrtdysdvYKcbYcw/VPn8NbtphiruzGudV57avNyMUm MiJn50v5Qp2nBSFjJaDHQ0yAGCFbcAWNRz3KVYYil/2NW/xkaCbF2EpRlOfKE8UOtnuW M5eEDjRnNGzWoMueAelFmQH7+gKpFMhNsb0tE8iQ00n3UJIMomDccFtOtPQqFjcr82Aa yKdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=tRsL9eyfLsEXtD7oqBN4wzrLc/UfHEZIdoYKMQRi4Tk=; b=gxTuj5AzzgXkaw9FR9eNlE7S8Oe4H7LiFFuOBm5kvq47U0L93JwSVM3tY+aVVYv9OG w1185C5UCkMyLrOJkzlSDGX7y4M96/+337O+oJ9WoLChip6zw7ekB+MvMKCdr5mAlUtk nLFBzKb514WEMeF+CAJGoKlzl8e6952+86WR8BRHK7rkA0Q4gbkaUBZKMuOrbOkTbIRE xJuQRNeqXUzKyjz880zhcPD/+Mgscg1uGH0Ej1Qqs+osTdvJYgVy3idZnlHepM+dpWhl RbKWvmOW0CAnjQhHJJTv2aESRS4nKA1Uabi/wKIVsNLAGolXrlvQoEnwLYAgVfF4VS2D vcqg== X-Gm-Message-State: AFeK/H1z6e73djv3lqB+d3M88Rmf08289y3yUS2FY+1FMF0Ro6lNd1pshDqiyqo+i//SNw== X-Received: by 10.98.198.138 with SMTP id x10mr30471225pfk.85.1489966977457; Sun, 19 Mar 2017 16:42:57 -0700 (PDT) Original-Received: from [192.168.2.114] (216-165-236-44.championbroadband.com. [216.165.236.44]) by smtp.gmail.com with ESMTPSA id c22sm29231417pgn.43.2017.03.19.16.42.55 for <22601@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Mar 2017 16:42:56 -0700 (PDT) In-Reply-To: <70AB27D7-FFFA-4447-8AAF-7A1C9295E1D7@gmail.com> X-Mailer: Apple Mail (2.3259) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8711 Archived-At: --Apple-Mail=_B8BE103E-06C6-46F5-85D1-3FDC82715F57 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Patch for guile-2.2.0, wrt doc/ref/match.texi, is attached. --Apple-Mail=_B8BE103E-06C6-46F5-85D1-3FDC82715F57 Content-Disposition: attachment; filename=match.texi.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="match.texi.patch" Content-Transfer-Encoding: 7bit --- doc/ref/match.texi-orig 2015-04-11 13:07:14.000000000 -0700 +++ doc/ref/match.texi 2017-03-19 16:40:08.000000000 -0700 @@ -116,65 +116,68 @@ The syntax and interpretation of patterns is as follows: -@verbatim - patterns: matches: +@example + patterns: matches: -pat ::= identifier anything, and binds identifier - | _ anything - | () the empty list - | #t #t - | #f #f - | string a string - | number a number - | character a character - | 'sexp an s-expression - | 'symbol a symbol (special case of s-expr) - | (pat_1 ... pat_n) list of n elements - | (pat_1 ... pat_n . pat_{n+1}) list of n or more - | (pat_1 ... pat_n pat_n+1 ooo) list of n or more, each element - of remainder must match pat_n+1 - | #(pat_1 ... pat_n) vector of n elements - | #(pat_1 ... pat_n pat_n+1 ooo) vector of n or more, each element - of remainder must match pat_n+1 - | #&pat box - | ($ record-name pat_1 ... pat_n) a record - | (= field pat) a ``field'' of an object - | (and pat_1 ... pat_n) if all of pat_1 thru pat_n match - | (or pat_1 ... pat_n) if any of pat_1 thru pat_n match - | (not pat_1 ... pat_n) if all pat_1 thru pat_n don't match - | (? predicate pat_1 ... pat_n) if predicate true and all of - pat_1 thru pat_n match - | (set! identifier) anything, and binds setter - | (get! identifier) anything, and binds getter - | `qp a quasi-pattern - | (identifier *** pat) matches pat in a tree and binds - identifier to the path leading - to the object that matches pat - -ooo ::= ... zero or more - | ___ zero or more - | ..1 1 or more - - quasi-patterns: matches: - -qp ::= () the empty list - | #t #t - | #f #f - | string a string - | number a number - | character a character - | identifier a symbol - | (qp_1 ... qp_n) list of n elements - | (qp_1 ... qp_n . qp_{n+1}) list of n or more - | (qp_1 ... qp_n qp_n+1 ooo) list of n or more, each element - of remainder must match qp_n+1 - | #(qp_1 ... qp_n) vector of n elements - | #(qp_1 ... qp_n qp_n+1 ooo) vector of n or more, each element - of remainder must match qp_n+1 - | #&qp box - | ,pat a pattern - | ,@pat a pattern -@end verbatim +pat ::= + @i{identifier} anything, and binds identifier + | _ anything + | () the empty list + | #t #t + | #f #f + | @i{string} a string + | @i{number} a number + | @i{character} a character + | '@i{sexp} an s-expression + | '@i{symbol} a symbol (special case of s-expr) + | (@i{pat_1 ... pat_n}) list of n elements + | (@i{pat_1 ... pat_n} . @i{pat_{n+1}}) list of n or more + | (@i{pat_1 ... pat_n pat_n+1} ooo) list of n or more, each element + of remainder must match pat_n+1 + | #(@i{pat_1 ... pat_n}) vector of n elements + | #(@i{pat_1 ... pat_n pat_n+1} ooo) vector of n or more, each element + of remainder must match pat_n+1 + | #&@i{pat} box + | ($ @i{record-name} @i{pat_1 ... pat_n}) a record + | (= @i{field} @i{pat}) a ``field'' of an object + | (and @i{pat_1 ... pat_n}) if all of pat_1 thru pat_n match + | (or @i{pat_1 ... pat_n}) if any of pat_1 thru pat_n match + | (not @i{pat_1 ... pat_n}) if all pat_1 thru pat_n don't match + | (? @i{predicate} @i{pat_1 ... pat_n}) if predicate true and all of + pat_1 thru pat_n match + | (set! @i{identifier}) anything, and binds setter + | (get! @i{identifier}) anything, and binds getter + | `@i{qp} a quasi-pattern + | (@i{identifier} *** @i{pat}) matches pat in a tree and binds + identifier to the path leading + to the object that matches pat + +ooo ::= + ... zero or more + | ___ zero or more + | ..1 1 or more + + quasi-patterns: matches: + +qp ::= + () the empty list + | #t #t + | #f #f + | @i{string} a string + | @i{number} a number + | @i{character} a character + | @i{identifier} a symbol + | (@i{qp_1 ... qp_n}) list of n elements + | (@i{qp_1 ... qp_n} . @i{qp_{n+1}}) list of n or more + | (@i{qp_1 ... qp_n qp_n+1} ooo) list of n or more, each element + of remainder must match qp_n+1 + | #(@i{qp_1 ... qp_n}) vector of n elements + | #(@i{qp_1 ... qp_n qp_n+1} ooo) vector of n or more, each element + of remainder must match qp_n+1 + | #&@i{qp} box + | ,@i{pat} a pattern + | ,@@@i{pat} a pattern +@end example The names @code{quote}, @code{quasiquote}, @code{unquote}, @code{unquote-splicing}, @code{?}, @code{_}, @code{$}, @code{and}, --Apple-Mail=_B8BE103E-06C6-46F5-85D1-3FDC82715F57--