plai/{gc2/}mutator: doc fixes

A symptom of mismatched `for-label' imports was that searching for "<="
would show red-underlined links to the `plai/{gc2/}mutator' documentation.

Merge to v5.3.4
(cherry picked from commit de9b77ad6d)
This commit is contained in:
Matthew Flatt 2013-04-09 12:57:58 -06:00 committed by Ryan Culpepper
parent b62f496e78
commit fd2acba3d2
3 changed files with 52 additions and 60 deletions

View File

@ -23,9 +23,8 @@
heap-value? heap-value?
heap-set! heap-ref with-heap heap-set! heap-ref with-heap
get-root-set read-root set-root! make-root) get-root-set read-root set-root! make-root)
plai/scribblings/fake-collector plai/scribblings/fake-collector2
plai/scribblings/fake-mutator plai/scribblings/fake-mutator2
plai/scribblings/fake-web
plai/random-mutator plai/random-mutator
(only-in plai/web (only-in plai/web
no-web-browser no-web-browser
@ -39,7 +38,7 @@
printf))) printf)))
@title[#:tag "gc2-collector"]{GC Collector, 2} @title[#:tag "gc2-collector"]{GC Collector Language, 2}
@defmodulelang[plai/gc2/collector] @defmodulelang[plai/gc2/collector]

View File

@ -4,18 +4,14 @@
"plai-exports.rkt" "plai-exports.rkt"
"lang-names.rkt" "lang-names.rkt"
(for-syntax scheme) (for-syntax scheme)
(for-label (except-in scheme (for-label (only-in racket/base
error printf) list modulo
(prefix-in scheme: procedure? path-string?
scheme) input-port? string? void?
(only-in plai/main exact-nonnegative-integer?
type-case define-type error exact-positive-integer?)
test test/pred test/exn test/regexp (only-in racket/contract/base
abridged-test-output or/c listof any/c)
plai-catch-test-exn
halt-on-errors print-only-errors
test-inexact-epsilon plai-ignore-exn-strings
plai-all-test-results)
(only-in plai/collector (only-in plai/collector
root? root?
heap-size heap-size
@ -31,13 +27,7 @@
(only-in plai/web (only-in plai/web
no-web-browser no-web-browser
static-files-path) static-files-path)
(only-in plai/mutator plai/mutator))
set-first!
set-rest!
import-primitives
test/location=?
test/value=?
printf)))
@title[#:tag "mutator"]{@MUTATE-LANG} @title[#:tag "mutator"]{@MUTATE-LANG}
@ -59,9 +49,9 @@ The first expression of a mutator must be:
@defform/subs[ @defform/subs[
(allocator-setup collector-module (allocator-setup collector-module
heap-size) heap-size)
([heap-size exact-nonnegative-integer?])]{ ([heap-size exact-nonnegative-integer])]{
@racket[_collector-module] specifies the path to the garbage collector that the The @racket[_collector-module] form specifies the path to the garbage collector that the
mutator should use. The collector must be written in the @COLLECT-LANG mutator should use. The collector must be written in the @COLLECT-LANG
language. language.
} }
@ -77,9 +67,12 @@ as @racket[gc:cons], written in the collector.
The @MUTATE-LANG language supports the following procedures and syntactic The @MUTATE-LANG language supports the following procedures and syntactic
forms: forms:
@(define-syntax-rule (defprocthing id content ...)
@defthing[id procedure? content ...])
@(define-syntax (document/lift stx) @(define-syntax (document/lift stx)
(syntax-case stx () (syntax-case stx ()
[(_ a ...) [(_ defidform a ...)
(with-syntax ([(doc ...) (with-syntax ([(doc ...)
(map (λ (a) (map (λ (a)
(with-syntax ([a a] (with-syntax ([a a]
@ -90,7 +83,8 @@ forms:
#'(begin #'(begin
doc ...))])) doc ...))]))
@document/lift[if and or cond case define-values let let-values let* set! quote error begin] @document/lift[defidform
if and or cond case define-values let let-values let* set! quote begin]
@defform[(define (id arg-id ...) body-expression ...+)]{ @defform[(define (id arg-id ...) body-expression ...+)]{
Just like Racket's @racket[define], except restricted to the simpler form Just like Racket's @racket[define], except restricted to the simpler form
@ -102,7 +96,9 @@ forms:
simpler form above. simpler form above.
} }
@document/lift[add1 sub1 zero? + - * / even? odd? = < > <= >= @document/lift[defprocthing
error
add1 sub1 zero? + - * / even? odd? = < > <= >=
symbol? symbol=? number? boolean? empty? eq?] symbol? symbol=? number? boolean? empty? eq?]
@defproc[(cons [hd any/c] [tl any/c]) cons?]{ @defproc[(cons [hd any/c] [tl any/c]) cons?]{
@ -120,25 +116,25 @@ forms:
} }
@defproc[(set-first! [c cons?] [v any/c]) @defproc[(set-first! [c cons?] [v any/c])
void]{ void?]{
Sets the @racket[first] of the cons cell @racket[c]. Sets the @racket[first] of the cons cell @racket[c].
} }
@defproc[(set-rest! [c cons?] [v any/c]) @defproc[(set-rest! [c cons?] [v any/c])
void]{ void?]{
Sets the @racket[rest] of the cons cell @racket[c]. Sets the @racket[rest] of the cons cell @racket[c].
} }
@defidform[empty]{ @defidform[empty]{
The identifier @racket[empty] is defined to invoke The identifier @racket[empty] is defined to invoke
@racket[(gc:alloc-flat empty)] wherever it is used. @racket[(gc:alloc-flat '())] wherever it is used.
} }
@defidform[print-only-errors]{ @defprocthing[print-only-errors]{
Behaves like PLAI's @|plai:print-only-errors|. Behaves like PLAI's @|plai:print-only-errors|.
} }
@defidform[halt-on-errors]{ @defprocthing[halt-on-errors]{
Behaves like PLAI's @|plai:halt-on-errors|. Behaves like PLAI's @|plai:halt-on-errors|.
} }
@ -253,7 +249,7 @@ of random mutators:
(listof heap-value?)]{ (listof heap-value?)]{
Processes @racket[input] looking for occurrences of @racket[heap-value?]s in Processes @racket[input] looking for occurrences of @racket[heap-value?]s in
the source of the program and returns them. This makes a good start for the the source of the program and returns them. This makes a good start for the
@racket[heap-values] argument to @racket[save-random-mutator]. @racket[_heap-values] argument to @racket[save-random-mutator].
If @racket[input] is a port, its contents are assumed to be a well-formed If @racket[input] is a port, its contents are assumed to be a well-formed
PLAI program. If @racket[input] is a file, the contents of the file are used. PLAI program. If @racket[input] is a file, the contents of the file are used.

View File

@ -5,18 +5,14 @@
"lang-names.rkt" "lang-names.rkt"
scribble/decode scribble/decode
(for-syntax scheme) (for-syntax scheme)
(for-label (except-in scheme (for-label (only-in racket/base
error printf) list modulo
(prefix-in scheme: procedure? path-string?
scheme) input-port? string? void?
(only-in plai/main exact-nonnegative-integer?
type-case define-type error exact-positive-integer?)
test test/pred test/exn test/regexp (only-in racket/contract/base
abridged-test-output or/c listof any/c)
plai-catch-test-exn
halt-on-errors print-only-errors
test-inexact-epsilon plai-ignore-exn-strings
plai-all-test-results)
(only-in plai/collector (only-in plai/collector
root? root?
heap-size heap-size
@ -25,17 +21,13 @@
heap-set! heap-ref with-heap heap-set! heap-ref with-heap
get-root-set read-root set-root! get-root-set read-root set-root!
procedure-roots) procedure-roots)
plai/scribblings/fake-collector2
plai/scribblings/fake-mutator2
plai/random-mutator plai/random-mutator
(only-in plai/web (only-in plai/web
no-web-browser no-web-browser
static-files-path) static-files-path)
(only-in plai/mutator plai/gc2/mutator))
set-first!
set-rest!
import-primitives
test/location=?
test/value=?
printf)))
@title[#:tag "gc2-mutator"]{GC Mutator Language, 2} @title[#:tag "gc2-mutator"]{GC Mutator Language, 2}
@ -57,7 +49,7 @@ The first expression of a mutator must be:
@defform/subs[ @defform/subs[
(allocator-setup collector-module (allocator-setup collector-module
heap-size) heap-size)
([heap-size exact-nonnegative-integer?])]{ ([heap-size exact-nonnegative-integer])]{
@racket[_collector-module] specifies the path to the garbage collector that the @racket[_collector-module] specifies the path to the garbage collector that the
mutator should use. The collector must be written in the @COLLECT-LANG mutator should use. The collector must be written in the @COLLECT-LANG
@ -75,9 +67,12 @@ as @racket[gc:cons], written in the collector.
The @MUTATE-LANG language supports the following procedures and syntactic The @MUTATE-LANG language supports the following procedures and syntactic
forms: forms:
@(define-syntax-rule (defprocthing id content ...)
@defthing[id procedure? content ...])
@(define-syntax (document/lift stx) @(define-syntax (document/lift stx)
(syntax-case stx () (syntax-case stx ()
[(_ a ...) [(_ defidform a ...)
(with-syntax ([(doc ...) (with-syntax ([(doc ...)
(for/list ([a (in-list (syntax->list #'(a ...)))]) (for/list ([a (in-list (syntax->list #'(a ...)))])
(syntax-case a () (syntax-case a ()
@ -92,12 +87,13 @@ forms:
#'(begin #'(begin
doc ...))])) doc ...))]))
@document/lift[if and or cond case define-values let let-values let* @document/lift[defidform
if and or cond case define-values let let-values let*
(set! @splice[@list{Unlike Racket's @|rkt:set!|, this @racket[set!] is syntactically allowed only (set! @splice[@list{Unlike Racket's @|rkt:set!|, this @racket[set!] is syntactically allowed only
in positions that discard its result, e.g., at the top-level in positions that discard its result, e.g., at the top-level
or in a @racket[begin] expression (although not as the last expression or in a @racket[begin] expression (although not as the last expression
in a @racket[begin]).}]) in a @racket[begin]).}])
quote error begin] quote begin]
@defform[(define (id arg-id ...) body-expression ...+)]{ @defform[(define (id arg-id ...) body-expression ...+)]{
Just like Racket's @racket[define], except restricted to the simpler form Just like Racket's @racket[define], except restricted to the simpler form
@ -109,7 +105,8 @@ forms:
simpler form above. simpler form above.
} }
@document/lift[add1 sub1 zero? + - * / even? odd? = < > <= >= @document/lift[defprocthing
error add1 sub1 zero? + - * / even? odd? = < > <= >=
symbol? symbol=? number? boolean? empty? eq?] symbol? symbol=? number? boolean? empty? eq?]
@defproc[(cons [hd any/c] [tl any/c]) cons?]{ @defproc[(cons [hd any/c] [tl any/c]) cons?]{
@ -153,7 +150,7 @@ forms:
@defidform[empty]{ @defidform[empty]{
The identifier @racket[empty] is defined to invoke The identifier @racket[empty] is defined to invoke
@racket[(gc:alloc-flat empty)] wherever it is used. @racket[(gc:alloc-flat '())] wherever it is used.
} }
@defidform[print-only-errors]{ @defidform[print-only-errors]{
@ -275,7 +272,7 @@ of random mutators:
(listof heap-value?)]{ (listof heap-value?)]{
Processes @racket[input] looking for occurrences of @racket[heap-value?]s in Processes @racket[input] looking for occurrences of @racket[heap-value?]s in
the source of the program and returns them. This makes a good start for the the source of the program and returns them. This makes a good start for the
@racket[heap-values] argument to @racket[save-random-mutator]. @racket[_heap-values] argument to @racket[save-random-mutator].
If @racket[input] is a port, its contents are assumed to be a well-formed If @racket[input] is a port, its contents are assumed to be a well-formed
PLAI program. If @racket[input] is a file, the contents of the file are used. PLAI program. If @racket[input] is a file, the contents of the file are used.