doc edits
This commit is contained in:
parent
dcda2b60d3
commit
8e9e8ee48e
|
@ -131,7 +131,15 @@ are simulated using @racket[thread].}
|
||||||
|
|
||||||
If the function indicated by @racket[module-path] and
|
If the function indicated by @racket[module-path] and
|
||||||
@racket[start-proc] returns, then the place terminates with the
|
@racket[start-proc] returns, then the place terminates with the
|
||||||
@tech{completion value} @racket[0].}
|
@tech{completion value} @racket[0].
|
||||||
|
|
||||||
|
In the created place, the values of the @racket[current-input-port],
|
||||||
|
@racket[current-output-port], and @racket[current-error-port]
|
||||||
|
parameters are connected to the current ports in the creating
|
||||||
|
place. If the ports are @tech{file-stream ports}, then the connected
|
||||||
|
ports in the places share the underlying stream, otherwise a
|
||||||
|
@tech{thread} in the creating place pumps bytes to and from the
|
||||||
|
current ports in the creating place.}
|
||||||
|
|
||||||
|
|
||||||
@defproc[(dynamic-place* [module-path module-path?]
|
@defproc[(dynamic-place* [module-path module-path?]
|
||||||
|
@ -139,22 +147,25 @@ are simulated using @racket[thread].}
|
||||||
[#:in in (or/c input-port? #f) #f]
|
[#:in in (or/c input-port? #f) #f]
|
||||||
[#:out out (or/c output-port? #f) (current-output-port)]
|
[#:out out (or/c output-port? #f) (current-output-port)]
|
||||||
[#:err err (or/c output-port? #f) (current-error-port)])
|
[#:err err (or/c output-port? #f) (current-error-port)])
|
||||||
(values place? (or/c input-port? #f) (or/c output-port? #f) (or/c output-port? #f))]{
|
(values place? (or/c output-port? #f) (or/c input-port? #f) (or/c input-port? #f))]{
|
||||||
|
|
||||||
The @racket[dynamic-place*] function behaves just like the
|
Like @racket[dynamic-place], but accepts specific ports to the new
|
||||||
@racket[dynamic-place] but allows the user to specify the standard
|
place's ports, and returns a created port when @racket[#f] is
|
||||||
in, out, and error ports for the new place. Upon execution of
|
supplied for a port. The @racket[in], @racket[out], and
|
||||||
@racket[dynamic-place*], the @racket[in], @racket[out], and
|
@racket[err] ports are connected to the @racket[current-input-port],
|
||||||
@racket[err] ports become the @racket[current-input-port],
|
@racket[current-output-port], and @racket[current-error-port] ports,
|
||||||
@racket[current-output-port], and @racket[current-error-port] for the
|
respectively, for the
|
||||||
@tech{place}. Any of the ports can be @racket[#f], in which case a
|
@tech{place}. Any of the ports can be @racket[#f], in which case a
|
||||||
system pipe is created and returned by @racket[dynamic-place*]. The
|
@tech{file-stream port} (for an operating-system pipe)
|
||||||
@racket[stderr] argument can be @racket['stdout], in which case the
|
is created and returned by @racket[dynamic-place*]. The
|
||||||
same file-stream port or system pipe that is supplied as standard
|
@racket[err] argument can be @racket['stdout], in which case the
|
||||||
|
same @tech{file-stream port} or that is supplied as standard
|
||||||
output is also used for standard error. For each port or
|
output is also used for standard error. For each port or
|
||||||
@racket['stdout] that is provided, no pipe is created and the
|
@racket['stdout] that is provided, no pipe is created and the
|
||||||
corresponding returned value is @racket[#f]. The user is responsible
|
corresponding returned value is @racket[#f].
|
||||||
for closing all ports returned by @racket[dynamic-place*].
|
|
||||||
|
The caller of @racket[dynamic-place*] is responsible for closing all
|
||||||
|
returned ports; none are closed automatically.
|
||||||
|
|
||||||
The @racket[dynamic-place*] procedure returns four values:
|
The @racket[dynamic-place*] procedure returns four values:
|
||||||
|
|
||||||
|
@ -185,28 +196,40 @@ The @racket[dynamic-place*] procedure returns four values:
|
||||||
like the result of @racket[dynamic-place].
|
like the result of @racket[dynamic-place].
|
||||||
}
|
}
|
||||||
|
|
||||||
@defform[(place* [#:in in #f]
|
@defform/subs[(place* maybe-port ...
|
||||||
[#:out out (current-output-port)]
|
id
|
||||||
[#:err err (current-error-port)]
|
body ...+)
|
||||||
id
|
([maybe-port code:blank
|
||||||
body ...+)]{
|
(code:line #:in in-expr)
|
||||||
Behaves like @racket[place] and allows the user to set
|
(code:line #:out out-expr)
|
||||||
the @racket[current-input-port], @racket[current-output-port], and
|
(code:line #:err err-expr)])]{
|
||||||
@racket[current-error-port] for the @tech{place}. The result of a
|
Like @racket[place], but supports optional @racket[#:in], @racket[#:out],
|
||||||
@racket[place*] form is analogous to the result of @racket[dynamic-place*].
|
and @racket[#:err] expressions (at most one of each) to specify ports in the same way and
|
||||||
|
with the same defaults as @racket[dynamic-place*]. The result of
|
||||||
|
a @racket[place*] form is also the same as for @racket[dynamic-place*].
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@defproc[(place-wait [p place?]) exact-integer?]{
|
@defproc[(place-wait [p place?]) exact-integer?]{
|
||||||
Returns the @tech{completion value} of the place indicated by @racket[p],
|
Returns the @tech{completion value} of the place indicated by @racket[p],
|
||||||
blocking until the place has terminated.
|
blocking until the place has terminated.
|
||||||
}
|
|
||||||
|
If any pumping threads were created to connect a
|
||||||
|
non-@tech{file-stream port} to the ports in the place for @racket[p]
|
||||||
|
(see @racket[dynamic-place]), @racket[place-wait] returns only when
|
||||||
|
the pumping threads have completed. }
|
||||||
|
|
||||||
|
|
||||||
@defproc[(place-dead-evt [p place?]) evt?]{
|
@defproc[(place-dead-evt [p place?]) evt?]{
|
||||||
|
|
||||||
Returns a @tech{synchronizable event} (see @secref["sync"]) that is
|
Returns a @tech{synchronizable event} (see @secref["sync"]) that is
|
||||||
ready if and only if @racket[p] has terminated.}
|
ready if and only if @racket[p] has terminated.
|
||||||
|
|
||||||
|
If any pumping threads were created to connect a non-@tech{file-stream
|
||||||
|
port} to the ports in the place for @racket[p] (see
|
||||||
|
@racket[dynamic-place]), the event returned by
|
||||||
|
@racket[place-dead-evt] may become ready even if a pumping thread is
|
||||||
|
still running.}
|
||||||
|
|
||||||
|
|
||||||
@defproc[(place-kill [p place?]) void?]{
|
@defproc[(place-kill [p place?]) void?]{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user