From: Matt Wette <matt.wette@gmail.com>
To: 22601@debbugs.gnu.org
Subject: bug#22601: guile.texi section on ice-9 match
Date: Sun, 19 Mar 2017 18:56:33 -0700 [thread overview]
Message-ID: <199A3D39-E75D-407A-BE14-63DE692C5CCF@gmail.com> (raw)
In-Reply-To: <590DEFE0-5B65-4691-8A6F-00142B3E0473@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 253 bytes --]
> On Mar 19, 2017, at 4:42 PM, Matt Wette <matt.wette@gmail.com> wrote:
>
> Patch for guile-2.2.0, wrt doc/ref/match.texi, is attached.
>
> <match.texi.patch>
Updated patch. Upon proofread, I found an error wrt “ooo” in the original.
[-- Attachment #2: match.texi.patch --]
[-- Type: application/octet-stream, Size: 6780 bytes --]
--- doc/ref/match.texi-orig 2015-04-11 13:07:14.000000000 -0700
+++ doc/ref/match.texi 2017-03-19 18:54:05.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
+@i{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
+
+@i{ooo} ::=
+ ... zero or more
+ | ___ zero or more
+ | ..1 1 or more
+
+ quasi-patterns: matches:
+
+@i{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},
prev parent reply other threads:[~2017-03-20 1:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA+tCiVbOjcjdK8_GYHUkEiq+5ZSsZiCjEO+1e0kwccsJ8BNWNw@mail.gmail.com>
[not found] ` <87twlno63d.fsf@gnu.org>
[not found] ` <CA+tCiVZ0F-T1Xtjo-FLpwjN7shUr28rpT2W_kYCpcfX26ibDiw@mail.gmail.com>
[not found] ` <877figyxb2.fsf@dustycloud.org>
[not found] ` <87si13k4nn.fsf@gnu.org>
[not found] ` <87twljxbuq.fsf@dustycloud.org>
[not found] ` <87io1zueog.fsf@gnu.org>
2016-02-08 21:04 ` bug#22601: guile.texi section on ice-9 match Matt Wette
2016-08-07 11:38 ` Andy Wingo
2017-02-28 14:50 ` Andy Wingo
2017-03-19 23:00 ` Matt Wette
2017-03-19 23:42 ` Matt Wette
2017-03-20 1:56 ` Matt Wette [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199A3D39-E75D-407A-BE14-63DE692C5CCF@gmail.com \
--to=matt.wette@gmail.com \
--cc=22601@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).