From e136aa78e2f78b247ad0d4ba4bc44c251e2a97b9 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 4 Aug 2013 17:01:22 +0900 Subject: [PATCH] Updating additional docs to use backslash. --- lib/chibi/io/io.scm | 44 ++++----- lib/chibi/loop/loop.scm | 52 +++++------ lib/chibi/match/match.scm | 182 +++++++++++++++++++------------------- lib/chibi/process.stub | 30 +++---- lib/chibi/system.stub | 8 +- lib/chibi/time.stub | 6 +- lib/chibi/trace.sld | 12 +-- 7 files changed, 167 insertions(+), 167 deletions(-) diff --git a/lib/chibi/io/io.scm b/lib/chibi/io/io.scm index 1dc580d1..bc6cd6c6 100644 --- a/lib/chibi/io/io.scm +++ b/lib/chibi/io/io.scm @@ -31,19 +31,19 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; reading and writing -;; Display @var{str} to the given output port, defaulting to -;; @scheme{(current-output-port)}, followed by a newline. +;; Display \var{str} to the given output port, defaulting to +;; \scheme{(current-output-port)}, followed by a newline. (define (write-line str . o) (let ((out (if (pair? o) (car o) (current-output-port)))) (display str out) (newline out))) -;;> @subsubsubsection{(write-string str [out [start [end]]])} +;;> \subsubsubsection{(write-string str [out [start [end]]])} -;;> Writes the characters from @var{start} to @var{end} of string -;;> @var{str} to output port @var{out}, where @var{start} defaults -;;> to 0 and @var{end} defaults to @scheme{(string-length @var{str})}. +;;> Writes the characters from \var{start} to \var{end} of string +;;> \var{str} to output port \var{out}, where \var{start} defaults +;;> to 0 and \var{end} defaults to \scheme{(string-length \var{str})}. (define (write-string str . o) (let ((out (if (pair? o) (car o) (current-output-port))) @@ -60,11 +60,11 @@ (display (substring str start end) out)))) (display str out)))) -;;> @subsubsubsection{(read-line [in [n]])} +;;> \subsubsubsection{(read-line [in [n]])} -;;> Read a line from the input port @var{in}, defaulting to -;;> @scheme{(current-input-port)}, and return the result as -;;> a string not including the newline. Reads at most @var{n} +;;> Read a line from the input port \var{in}, defaulting to +;;> \scheme{(current-input-port)}, and return the result as +;;> a string not including the newline. Reads at most \var{n} ;;> characters, defaulting to 8192. (cond-expand @@ -109,13 +109,13 @@ (else res))))))) -;;> @subsubsubsection{(read-string n [in])} +;;> \subsubsubsection{(read-string n [in])} -;;> Reads @var{n} characters from input-port @var{in}, -;;> defaulting to @scheme{(current-input-port)}, and -;;> returns the result as a string. Returns @scheme{""} -;;> if @var{n} is zero. May return a string with fewer -;;> than @var{n} characters if the end of file is reached, +;;> Reads \var{n} characters from input-port \var{in}, +;;> defaulting to \scheme{(current-input-port)}, and +;;> returns the result as a string. Returns \scheme{""} +;;> if \var{n} is zero. May return a string with fewer +;;> than \var{n} characters if the end of file is reached, ;;> or the eof-object if no characters are available. (cond-expand @@ -140,14 +140,14 @@ (port-line in))) (cadr res))))))) -;;> @subsubsubsection{(read-string! str n [in])} +;;> \subsubsubsection{(read-string! str n [in])} -;;> Reads @var{n} characters from port @var{in}, which -;;> defaults to @scheme{(current-input-port)}, and writes -;;> them into the string @var{str} starting at index 0. +;;> Reads \var{n} characters from port \var{in}, which +;;> defaults to \scheme{(current-input-port)}, and writes +;;> them into the string \var{str} starting at index 0. ;;> Returns the number of characters read. -;;> An error is signalled if the length of @var{str} is smaller -;;> than @var{n}. +;;> An error is signalled if the length of \var{str} is smaller +;;> than \var{n}. (cond-expand ((not string-streams) diff --git a/lib/chibi/loop/loop.scm b/lib/chibi/loop/loop.scm index df79720e..9dc240cb 100644 --- a/lib/chibi/loop/loop.scm +++ b/lib/chibi/loop/loop.scm @@ -4,7 +4,7 @@ ;; BSD-style license: http://synthcode.com/license.txt ;;> The loop API is mostly compatible with Taylor Campbell's -;;> @hyperlink["http://mumble.net/~campbell/scheme/foof-loop.txt"]{foof-loop}, +;;> \hyperlink["http://mumble.net/~campbell/scheme/foof-loop.txt"]{foof-loop}, ;;> but the iterator API is different and subject to change. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -49,7 +49,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;> @subsubsubsection{@scheme{(loop [name] (vars ...) [=> result] body ...)}} +;;> \subsubsubsection{\scheme{(loop [name] (vars ...) [=> result] body ...)}} (define-syntax loop (syntax-rules () @@ -124,27 +124,27 @@ . rest)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;> @subsubsection{Iterators} +;;> \subsubsection{Iterators} ;; Each gets passed two lists, those items left of the macro and those to ;; the right, followed by a NEXT and REST continuation. ;; ;; Should finish with ;; -;; @schemeblock{ +;; \schemeblock{ ;; (next (outer-vars ...) (cursor-vars ...) (done?-tests ...) ;; (loop-vars ...) (final-vars ...) . rest) ;; } ;; -;; @itemlist[ -;; @item{@var{outer-vars} - bound once outside the loop in a LET*} -;; @item{@var{cursor-vars} - DO-style bindings of the form (name init update)} -;; @item{@var{done?-tests} - possibly empty list of forms that terminate the loop on #t} -;; @item{@var{loop-vars} - inner variables, updated in parallel after the cursors} -;; @item{@var{final-vars} - final variables, bound only in the => result} +;; \itemlist[ +;; \item{\var{outer-vars} - bound once outside the loop in a LET*} +;; \item{\var{cursor-vars} - DO-style bindings of the form (name init update)} +;; \item{\var{done?-tests} - possibly empty list of forms that terminate the loop on #t} +;; \item{\var{loop-vars} - inner variables, updated in parallel after the cursors} +;; \item{\var{final-vars} - final variables, bound only in the => result} ;; ] -;;> @subsubsubsection{@scheme{(for var [pair] (in-list ls [cdr]))}} +;;> \subsubsubsection{\scheme{(for var [pair] (in-list ls [cdr]))}} ;;> Basic list iterator. @@ -172,7 +172,7 @@ () . rest)))) -;;> @subsubsubsection{@scheme{(for elts [pairs] (in-lists lol [cdr [done?]]))}} +;;> \subsubsubsection{\scheme{(for elts [pairs] (in-lists lol [cdr [done?]]))}} ;;> Iterator from Taylor R. Campbell. If you know the number of lists ;;> ahead of time it's much more efficient to iterate over each one @@ -215,12 +215,12 @@ (%in-idx < (lambda (x i) (- i 1)) (lambda (x) (- (length x) 1)) (lambda (x) 0) ref tmp seq next . rest)))) )))) -;;> @subsubsubsection{@scheme{(for var [index] (in-vector vec))}} -;;> @subsubsubsection{@scheme{(for var [index] (in-vector-reverse vec))}} +;;> \subsubsubsection{\scheme{(for var [index] (in-vector vec))}} +;;> \subsubsubsection{\scheme{(for var [index] (in-vector-reverse vec))}} (define-in-indexed in-vector in-vector-reverse vector-length vector-ref) -;;> @subsubsubsection{@scheme{(for ch [cursor] (in-string str))}} +;;> \subsubsubsection{\scheme{(for ch [cursor] (in-string str))}} (define-syntax in-string (syntax-rules () @@ -229,7 +229,7 @@ string-cursor-start string-cursor-end string-cursor-ref tmp s next . rest)))) -;;> @subsubsubsection{@scheme{(for ch [cursor] (in-string-reverse str))}} +;;> \subsubsubsection{\scheme{(for ch [cursor] (in-string-reverse str))}} (define-syntax in-string-reverse (syntax-rules () @@ -258,7 +258,7 @@ . rest)) )) -;;> @subsubsubsection{@scheme{(for ch (in-port [input-port [reader [eof?]]]))}} +;;> \subsubsubsection{\scheme{(for ch (in-port [input-port [reader [eof?]]]))}} (define-syntax in-port (syntax-rules () @@ -278,7 +278,7 @@ () . rest)))) -;;> @subsubsubsection{@scheme{(for ch (in-file [input-port [reader [eof?]]]))}} +;;> \subsubsubsection{\scheme{(for ch (in-file [input-port [reader [eof?]]]))}} (define-syntax in-file (syntax-rules () @@ -296,7 +296,7 @@ ((dummy (close-input-port p))) . rest)))) -;;> @subsubsubsection{@scheme{(for x (up-from [start] [(to limit)] [(by step)]))}} +;;> \subsubsubsection{\scheme{(for x (up-from [start] [(to limit)] [(by step)]))}} (define-syntax up-from (syntax-rules (to by) @@ -322,7 +322,7 @@ (next ((s start)) ((var s (+ var 1))) () () () . rest)) )) -;;> @subsubsubsection{@scheme{(for x (down-from [start] [(to limit)] [(by step)]))}} +;;> \subsubsubsection{\scheme{(for x (down-from [start] [(to limit)] [(by step)]))}} (define-syntax down-from (syntax-rules (to by) @@ -371,14 +371,14 @@ ((var (final cursor))) . rest)))) -;;> @subsubsubsection{@scheme{(for x [pair] (listing expr))}} +;;> \subsubsubsection{\scheme{(for x [pair] (listing expr))}} (define-syntax listing (syntax-rules () ((listing args next . rest) (accumulating (cons reverse '()) args next . rest)))) -;;> @subsubsubsection{@scheme{(for x [pair] (listing-reverse expr))}} +;;> \subsubsubsection{\scheme{(for x [pair] (listing-reverse expr))}} (define-syntax listing-reverse (syntax-rules () @@ -388,28 +388,28 @@ (define (append-reverse rev tail) (if (null? rev) tail (append-reverse (cdr rev) (cons (car rev) tail)))) -;;> @subsubsubsection{@scheme{(for x [pair] (appending expr))}} +;;> \subsubsubsection{\scheme{(for x [pair] (appending expr))}} (define-syntax appending (syntax-rules () ((appending args next . rest) (accumulating (append-reverse reverse '()) args next . rest)))) -;;> @subsubsubsection{@scheme{(for x [pair] (appending-reverse expr))}} +;;> \subsubsubsection{\scheme{(for x [pair] (appending-reverse expr))}} (define-syntax appending-reverse (syntax-rules () ((appending-reverse args next . rest) (accumulating (append-reverse (lambda (x) x) '()) args next . rest)))) -;;> @subsubsubsection{@scheme{(for x (summing expr))}} +;;> \subsubsubsection{\scheme{(for x (summing expr))}} (define-syntax summing (syntax-rules () ((summing args next . rest) (accumulating (+ (lambda (x) x) 0) args next . rest)))) -;;> @subsubsubsection{@scheme{(for x (multiplying expr))}} +;;> \subsubsubsection{\scheme{(for x (multiplying expr))}} (define-syntax multiplying (syntax-rules () diff --git a/lib/chibi/match/match.scm b/lib/chibi/match/match.scm index 811716f4..bb4489a8 100644 --- a/lib/chibi/match/match.scm +++ b/lib/chibi/match/match.scm @@ -3,155 +3,155 @@ ;; This code is written by Alex Shinn and placed in the ;; Public Domain. All warranties are disclaimed. -;;> @example-import[(srfi 9)] +;;> \example-import[(srfi 9)] -;;> This is a full superset of the popular @hyperlink[ +;;> This is a full superset of the popular \hyperlink[ ;;> "http://www.cs.indiana.edu/scheme-repository/code.match.html"]{match} -;;> package by Andrew Wright, written in fully portable @scheme{syntax-rules} +;;> package by Andrew Wright, written in fully portable \scheme{syntax-rules} ;;> and thus preserving hygiene. -;;> The most notable extensions are the ability to use @emph{non-linear} +;;> The most notable extensions are the ability to use \emph{non-linear} ;;> patterns - patterns in which the same identifier occurs multiple ;;> times, tail patterns after ellipsis, and the experimental tree patterns. -;;> @subsubsection{Patterns} +;;> \subsubsection{Patterns} ;;> Patterns are written to look like the printed representation of ;;> the objects they match. The basic usage is -;;> @scheme{(match expr (pat body ...) ...)} +;;> \scheme{(match expr (pat body ...) ...)} -;;> where the result of @var{expr} is matched against each pattern in +;;> where the result of \var{expr} is matched against each pattern in ;;> turn, and the corresponding body is evaluated for the first to ;;> succeed. Thus, a list of three elements matches a list of three ;;> elements. -;;> @example{(let ((ls (list 1 2 3))) (match ls ((1 2 3) #t)))} +;;> \example{(let ((ls (list 1 2 3))) (match ls ((1 2 3) #t)))} ;;> If no patterns match an error is signalled. ;;> Identifiers will match anything, and make the corresponding ;;> binding available in the body. -;;> @example{(match (list 1 2 3) ((a b c) b))} +;;> \example{(match (list 1 2 3) ((a b c) b))} ;;> If the same identifier occurs multiple times, the first instance ;;> will match anything, but subsequent instances must match a value -;;> which is @scheme{equal?} to the first. +;;> which is \scheme{equal?} to the first. -;;> @example{(match (list 1 2 1) ((a a b) 1) ((a b a) 2))} +;;> \example{(match (list 1 2 1) ((a a b) 1) ((a b a) 2))} -;;> The special identifier @scheme{_} matches anything, no matter how +;;> The special identifier \scheme{_} matches anything, no matter how ;;> many times it is used, and does not bind the result in the body. -;;> @example{(match (list 1 2 1) ((_ _ b) 1) ((a b a) 2))} +;;> \example{(match (list 1 2 1) ((_ _ b) 1) ((a b a) 2))} ;;> To match a literal identifier (or list or any other literal), use -;;> @scheme{quote}. +;;> \scheme{quote}. -;;> @example{(match 'a ('b 1) ('a 2))} +;;> \example{(match 'a ('b 1) ('a 2))} -;;> Analogous to its normal usage in scheme, @scheme{quasiquote} can +;;> Analogous to its normal usage in scheme, \scheme{quasiquote} can ;;> be used to quote a mostly literally matching object with selected ;;> parts unquoted. -;;> @example|{(match (list 1 2 3) (`(1 ,b ,c) (list b c)))}| +;;> \example|{(match (list 1 2 3) (`(1 ,b ,c) (list b c)))}| ;;> Often you want to match any number of a repeated pattern. Inside -;;> a list pattern you can append @scheme{...} after an element to +;;> a list pattern you can append \scheme{...} after an element to ;;> match zero or more of that pattern (like a regexp Kleene star). -;;> @example{(match (list 1 2) ((1 2 3 ...) #t))} -;;> @example{(match (list 1 2 3) ((1 2 3 ...) #t))} -;;> @example{(match (list 1 2 3 3 3) ((1 2 3 ...) #t))} +;;> \example{(match (list 1 2) ((1 2 3 ...) #t))} +;;> \example{(match (list 1 2 3) ((1 2 3 ...) #t))} +;;> \example{(match (list 1 2 3 3 3) ((1 2 3 ...) #t))} ;;> Pattern variables matched inside the repeated pattern are bound to ;;> a list of each matching instance in the body. -;;> @example{(match (list 1 2) ((a b c ...) c))} -;;> @example{(match (list 1 2 3) ((a b c ...) c))} -;;> @example{(match (list 1 2 3 4 5) ((a b c ...) c))} +;;> \example{(match (list 1 2) ((a b c ...) c))} +;;> \example{(match (list 1 2 3) ((a b c ...) c))} +;;> \example{(match (list 1 2 3 4 5) ((a b c ...) c))} -;;> More than one @scheme{...} may not be used in the same list, since +;;> More than one \scheme{...} may not be used in the same list, since ;;> this would require exponential backtracking in the general case. -;;> However, @scheme{...} need not be the final element in the list, +;;> However, \scheme{...} need not be the final element in the list, ;;> and may be succeeded by a fixed number of patterns. -;;> @example{(match (list 1 2 3 4) ((a b c ... d e) c))} -;;> @example{(match (list 1 2 3 4 5) ((a b c ... d e) c))} -;;> @example{(match (list 1 2 3 4 5 6 7) ((a b c ... d e) c))} +;;> \example{(match (list 1 2 3 4) ((a b c ... d e) c))} +;;> \example{(match (list 1 2 3 4 5) ((a b c ... d e) c))} +;;> \example{(match (list 1 2 3 4 5 6 7) ((a b c ... d e) c))} -;;> @scheme{___} is provided as an alias for @scheme{...} when it is +;;> \scheme{___} is provided as an alias for \scheme{...} when it is ;;> inconvenient to use the ellipsis (as in a syntax-rules template). -;;> The @scheme{..1} syntax is exactly like the @scheme{...} except +;;> The \scheme{..1} syntax is exactly like the \scheme{...} except ;;> that it matches one or more repetitions (like a regexp "+"). -;;> @example{(match (list 1 2) ((a b c ..1) c))} -;;> @example{(match (list 1 2 3) ((a b c ..1) c))} +;;> \example{(match (list 1 2) ((a b c ..1) c))} +;;> \example{(match (list 1 2 3) ((a b c ..1) c))} -;;> The boolean operators @scheme{and}, @scheme{or} and @scheme{not} +;;> The boolean operators \scheme{and}, \scheme{or} and \scheme{not} ;;> can be used to group and negate patterns analogously to their ;;> Scheme counterparts. -;;> The @scheme{and} operator ensures that all subpatterns match. -;;> This operator is often used with the idiom @scheme{(and x pat)} to -;;> bind @var{x} to the entire value that matches @var{pat} +;;> The \scheme{and} operator ensures that all subpatterns match. +;;> This operator is often used with the idiom \scheme{(and x pat)} to +;;> bind \var{x} to the entire value that matches \var{pat} ;;> (c.f. "as-patterns" in ML or Haskell). Another common use is in -;;> conjunction with @scheme{not} patterns to match a general case +;;> conjunction with \scheme{not} patterns to match a general case ;;> with certain exceptions. -;;> @example{(match 1 ((and) #t))} -;;> @example{(match 1 ((and x) x))} -;;> @example{(match 1 ((and x 1) x))} +;;> \example{(match 1 ((and) #t))} +;;> \example{(match 1 ((and x) x))} +;;> \example{(match 1 ((and x 1) x))} -;;> The @scheme{or} operator ensures that at least one subpattern +;;> The \scheme{or} operator ensures that at least one subpattern ;;> matches. If the same identifier occurs in different subpatterns, ;;> it is matched independently. All identifiers from all subpatterns -;;> are bound if the @scheme{or} operator matches, but the binding is +;;> are bound if the \scheme{or} operator matches, but the binding is ;;> only defined for identifiers from the subpattern which matched. -;;> @example{(match 1 ((or) #t) (else #f))} -;;> @example{(match 1 ((or x) x))} -;;> @example{(match 1 ((or x 2) x))} +;;> \example{(match 1 ((or) #t) (else #f))} +;;> \example{(match 1 ((or x) x))} +;;> \example{(match 1 ((or x 2) x))} -;;> The @scheme{not} operator succeeds if the given pattern doesn't +;;> The \scheme{not} operator succeeds if the given pattern doesn't ;;> match. None of the identifiers used are available in the body. -;;> @example{(match 1 ((not 2) #t))} +;;> \example{(match 1 ((not 2) #t))} -;;> The more general operator @scheme{?} can be used to provide a -;;> predicate. The usage is @scheme{(? predicate pat ...)} where -;;> @var{predicate} is a Scheme expression evaluating to a predicate +;;> The more general operator \scheme{?} can be used to provide a +;;> predicate. The usage is \scheme{(? predicate pat ...)} where +;;> \var{predicate} is a Scheme expression evaluating to a predicate ;;> called on the value to match, and any optional patterns after the -;;> predicate are then matched as in an @scheme{and} pattern. +;;> predicate are then matched as in an \scheme{and} pattern. -;;> @example{(match 1 ((? odd? x) x))} +;;> \example{(match 1 ((? odd? x) x))} -;;> The field operator @scheme{=} is used to extract an arbitrary +;;> The field operator \scheme{=} is used to extract an arbitrary ;;> field and match against it. It is useful for more complex or ;;> conditional destructuring that can't be more directly expressed in -;;> the pattern syntax. The usage is @scheme{(= field pat)}, where -;;> @var{field} can be any expression, and should result in a +;;> the pattern syntax. The usage is \scheme{(= field pat)}, where +;;> \var{field} can be any expression, and should result in a ;;> procedure of one argument, which is applied to the value to match -;;> to generate a new value to match against @var{pat}. +;;> to generate a new value to match against \var{pat}. -;;> Thus the pattern @scheme{(and (= car x) (= cdr y))} is equivalent -;;> to @scheme{(x . y)}, except it will result in an immediate error +;;> Thus the pattern \scheme{(and (= car x) (= cdr y))} is equivalent +;;> to \scheme{(x . y)}, except it will result in an immediate error ;;> if the value isn't a pair. -;;> @example{(match '(1 . 2) ((= car x) x))} -;;> @example{(match 4 ((= square x) x))} +;;> \example{(match '(1 . 2) ((= car x) x))} +;;> \example{(match 4 ((= square x) x))} -;;> The record operator @scheme{$} is used as a concise way to match +;;> The record operator \scheme{$} is used as a concise way to match ;;> records defined by SRFI-9 (or SRFI-99). The usage is -;;> @scheme{($ rtd field ...)}, where @var{rtd} should be the record +;;> \scheme{($ rtd field ...)}, where \var{rtd} should be the record ;;> type descriptor specified as the first argument to -;;> @scheme{define-record-type}, and each @var{field} is a subpattern +;;> \scheme{define-record-type}, and each \var{field} is a subpattern ;;> matched against the fields of the record in order. Not all fields ;;> must be present. -;;> @example{ +;;> \example{ ;;> (let () ;;> (define-record-type employee ;;> (make-employee name title) @@ -162,29 +162,29 @@ ;;> (($ employee n t) (list t n)))) ;;> } -;;> The @scheme{set!} and @scheme{get!} operators are used to bind an +;;> The \scheme{set!} and \scheme{get!} operators are used to bind an ;;> identifier to the setter and getter of a field, respectively. The ;;> setter is a procedure of one argument, which mutates the field to ;;> that argument. The getter is a procedure of no arguments which ;;> returns the current value of the field. -;;> @example{(let ((x (cons 1 2))) (match x ((1 . (set! s)) (s 3) x)))} -;;> @example{(match '(1 . 2) ((1 . (get! g)) (g)))} +;;> \example{(let ((x (cons 1 2))) (match x ((1 . (set! s)) (s 3) x)))} +;;> \example{(match '(1 . 2) ((1 . (get! g)) (g)))} -;;> The new operator @scheme{***} can be used to search a tree for -;;> subpatterns. A pattern of the form @scheme{(x *** y)} represents -;;> the subpattern @var{y} located somewhere in a tree where the path -;;> from the current object to @var{y} can be seen as a list of the -;;> form @scheme{(x ...)}. @var{y} can immediately match the current +;;> The new operator \scheme{***} can be used to search a tree for +;;> subpatterns. A pattern of the form \scheme{(x *** y)} represents +;;> the subpattern \var{y} located somewhere in a tree where the path +;;> from the current object to \var{y} can be seen as a list of the +;;> form \scheme{(x ...)}. \var{y} can immediately match the current ;;> object in which case the path is the empty list. In a sense it's -;;> a 2-dimensional version of the @scheme{...} pattern. +;;> a 2-dimensional version of the \scheme{...} pattern. -;;> As a common case the pattern @scheme{(_ *** y)} can be used to -;;> search for @var{y} anywhere in a tree, regardless of the path +;;> As a common case the pattern \scheme{(_ *** y)} can be used to +;;> search for \var{y} anywhere in a tree, regardless of the path ;;> used. -;;> @example{(match '(a (a (a b))) ((x *** 'b) x))} -;;> @example{(match '(a (b) (c (d e) (f g))) ((x *** 'g) x))} +;;> \example{(match '(a (a (a b))) ((x *** 'b) x))} +;;> \example{(match '(a (b) (c (d e) (f g))) ((x *** 'g) x))} ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Notes @@ -239,19 +239,19 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;> @subsubsection{Syntax} +;;> \subsubsection{Syntax} -;;> @subsubsubsection{@rawcode{(match expr (pattern . body) ...)@br{} +;;> \subsubsubsection{\rawcode{(match expr (pattern . body) ...)\br{} ;;> (match expr (pattern (=> failure) . body) ...)}} -;;> The result of @var{expr} is matched against each @var{pattern} in +;;> The result of \var{expr} is matched against each \var{pattern} in ;;> turn, according to the pattern rules described in the previous -;;> section, until the the first @var{pattern} matches. When a match is -;;> found, the corresponding @var{body}s are evaluated in order, +;;> section, until the the first \var{pattern} matches. When a match is +;;> found, the corresponding \var{body}s are evaluated in order, ;;> and the result of the last expression is returned as the result -;;> of the entire @scheme{match}. If a @var{failure} is provided, +;;> of the entire \scheme{match}. If a \var{failure} is provided, ;;> then it is bound to a procedure of no arguments which continues, -;;> processing at the next @var{pattern}. If no @var{pattern} matches, +;;> processing at the next \var{pattern}. If no \var{pattern} matches, ;;> an error is signalled. ;; The basic interface. MATCH just performs some basic syntax @@ -783,7 +783,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Gimme some sugar baby. -;;> Shortcut for @scheme{lambda} + @scheme{match}. Creates a +;;> Shortcut for \scheme{lambda} + \scheme{match}. Creates a ;;> procedure of one argument, and matches that argument against each ;;> clause. @@ -791,7 +791,7 @@ (syntax-rules () ((_ (pattern . body) ...) (lambda (expr) (match expr (pattern . body) ...))))) -;;> Similar to @scheme{match-lambda}. Creates a procedure of any +;;> Similar to \scheme{match-lambda}. Creates a procedure of any ;;> number of arguments, and matches the argument list against each ;;> clause. @@ -803,7 +803,7 @@ ;;> the body with all match variables in scope. Raises an error if ;;> any of the expressions fail to match. Syntax analogous to named ;;> let can also be used for recursive functions which match on their -;;> arguments as in @scheme{match-lambda*}. +;;> arguments as in \scheme{match-lambda*}. (define-syntax match-let (syntax-rules () @@ -812,7 +812,7 @@ ((_ loop ((var init) ...) . body) (match-named-let loop ((var init) ...) . body)))) -;;> Similar to @scheme{match-let}, but analogously to @scheme{letrec} +;;> Similar to \scheme{match-let}, but analogously to \scheme{letrec} ;;> matches and binds the variables with all match variables in scope. (define-syntax match-letrec @@ -846,9 +846,9 @@ ((_ loop (v ...) ((pat expr) . rest) . body) (match-named-let loop (v ... (pat expr tmp)) rest . body)))) -;;> @subsubsubsection{@rawcode{(match-let* ((var value) ...) body ...)}} +;;> \subsubsubsection{\rawcode{(match-let* ((var value) ...) body ...)}} -;;> Similar to @scheme{match-let}, but analogously to @scheme{let*} +;;> Similar to \scheme{match-let}, but analogously to \scheme{let*} ;;> matches and binds the variables in sequence, with preceding match ;;> variables in scope. diff --git a/lib/chibi/process.stub b/lib/chibi/process.stub index 4793ffc0..71d5e7db 100644 --- a/lib/chibi/process.stub +++ b/lib/chibi/process.stub @@ -44,12 +44,12 @@ (c-include "signal.c") -;;> @subsubsubsection{@rawcode{(set-signal-action! signal handler)}} +;;> \subsubsubsection{\rawcode{(set-signal-action! signal handler)}} -;;> Sets the signal handler for @var{signal} to @var{handler} -;;> and returns the old handler. @var{handler} should be a procedure -;;> of one argument, the signal number, the value @scheme{#t} for -;;> the default signal handler, or @scheme{#f} for no handler. +;;> Sets the signal handler for \var{signal} to \var{handler} +;;> and returns the old handler. \var{handler} should be a procedure +;;> of one argument, the signal number, the value \scheme{#t} for +;;> the default signal handler, or \scheme{#f} for no handler. ;;> Signal handlers are queued run in a dedicated thread after the ;;> system handler has returned. @@ -77,19 +77,19 @@ (define-c errno (current-signal-mask "sigprocmask") ((value SIG_BLOCK int) (pointer value NULL sigset_t) (pointer result sigset_t))) -;;> Send a @var{signal/alarm} signal to the current process -;;> after @var{unsigned-int} seconds have elapsed. +;;> Send a \var{signal/alarm} signal to the current process +;;> after \var{unsigned-int} seconds have elapsed. (define-c unsigned-int alarm (unsigned-int)) -;;> Suspend the current process for @var{unsigned-int} seconds. -;;> See @hyperlink["http://srfi.schemers.org/srfi-18/srfi-18.html"]{SRFI-18} -;;> @scheme{thread-sleep!} for a light-weight sleep for only the +;;> Suspend the current process for \var{unsigned-int} seconds. +;;> See \hyperlink["http://srfi.schemers.org/srfi-18/srfi-18.html"]{SRFI-18} +;;> \scheme{thread-sleep!} for a light-weight sleep for only the ;;> current thread. (define-c unsigned-int sleep (unsigned-int)) -;;> Fork the current process. Returns @rawcode{0} for the newly +;;> Fork the current process. Returns \rawcode{0} for the newly ;;> created process, and the process id of the new process for ;;> the parent. @@ -99,12 +99,12 @@ ;;(define-c pid_t wait ((result int))) -;;> @subsubsubsection{@rawcode{(waitpid pid options)}} +;;> \subsubsubsection{\rawcode{(waitpid pid options)}} -;;> Wait on the process @var{pid}, or any child process if @var{pid} -;;> is @rawcode{-1}. @var{options} should be 0, or @var{wait/no-hang} +;;> Wait on the process \var{pid}, or any child process if \var{pid} +;;> is \rawcode{-1}. \var{options} should be 0, or \var{wait/no-hang} ;;> to return immediately if no processes have reported status. Returns -;;> a list whose first element is the actual @var{pid} reporting, and +;;> a list whose first element is the actual \var{pid} reporting, and ;;> the second element is the integer status. (define-c pid_t waitpid (int (result int) int)) diff --git a/lib/chibi/system.stub b/lib/chibi/system.stub index c184143b..b0f09572 100644 --- a/lib/chibi/system.stub +++ b/lib/chibi/system.stub @@ -3,9 +3,9 @@ (c-system-include "pwd.h") (c-system-include "sys/types.h") -;;> @subsubsubsection{@scheme{(user-information name-or-id)}} +;;> \subsubsubsection{\scheme{(user-information name-or-id)}} -;;> Returns the password entry for the given user. @var{name-or-id} +;;> Returns the password entry for the given user. \var{name-or-id} ;;> should be a string indicating the user name, or an integer ;;> for the user id. @@ -20,7 +20,7 @@ (string pw_shell user-shell)) ;;> Accessors for the password entry structure returned by -;;> @scheme{user-information}. +;;> \scheme{user-information}. ;;/ (define-c uid_t (current-user-id "getuid") ()) @@ -45,7 +45,7 @@ (define-c pid_t (create-session "setsid") ()) -;;> Set @var{string} to be the new root directory, so that +;;> Set \var{string} to be the new root directory, so that ;;> paths beginning with "/" are resolved relative to the ;;> new root. diff --git a/lib/chibi/time.stub b/lib/chibi/time.stub index 1da56217..64cb68fd 100644 --- a/lib/chibi/time.stub +++ b/lib/chibi/time.stub @@ -17,7 +17,7 @@ (int tm_yday time-day-of-year) (int tm_isdst time-dst?)) -;;> Accessors for the @scheme{tm} struct. +;;> Accessors for the \scheme{tm} struct. ;;/ (define-c-struct timeval @@ -26,7 +26,7 @@ (time_t tv_sec timeval-seconds) (int tv_usec timeval-microseconds)) -;;> Accessors for the @scheme{timeval} struct. +;;> Accessors for the \scheme{timeval} struct. ;;/ (define-c-struct timezone @@ -34,7 +34,7 @@ (int tz_minuteswest timezone-offset) (int tz_dsttime timezone-dst-time)) -;;> Accessors for the @scheme{timezone} struct. +;;> Accessors for the \scheme{timezone} struct. ;;/ ;;> Returns the current time as an integer number diff --git a/lib/chibi/trace.sld b/lib/chibi/trace.sld index 555ee0df..c63870e2 100644 --- a/lib/chibi/trace.sld +++ b/lib/chibi/trace.sld @@ -1,14 +1,14 @@ -;;> @subsubsubsection{(trace proc)} +;;> \subsubsubsection{(trace proc)} -;;> Write a trace of all calls to the procedure @var{proc} to -;;> @scheme{(current-error-port)}. +;;> Write a trace of all calls to the procedure \var{proc} to +;;> \scheme{(current-error-port)}. -;;> @subsubsubsection{(untrace proc)} +;;> \subsubsubsection{(untrace proc)} -;;> Remove any active traces on the procedure @var{proc}. +;;> Remove any active traces on the procedure \var{proc}. -;;> @subsubsubsection{(untrace-all)} +;;> \subsubsubsection{(untrace-all)} ;;> Remove all active procedure traces.