doc clarifications (PR 9307) and arity issue (PR 9025)
svn: r9855
This commit is contained in:
parent
6ef3399174
commit
4effd7b897
|
@ -65,10 +65,7 @@ it is still running, leaving the coroutine result unchanged.}
|
||||||
(values thread? procedure?)]{
|
(values thread? procedure?)]{
|
||||||
|
|
||||||
Returns two values: a thread descriptor for a new thread, and a
|
Returns two values: a thread descriptor for a new thread, and a
|
||||||
procedure with the same arity as @scheme[f]. (The returned procedure
|
procedure with the same arity as @scheme[f].
|
||||||
actually accepts any number of arguments, but immediately raises
|
|
||||||
@scheme[exn:fail:contract:arity] if @scheme[f] cannot accept the
|
|
||||||
provided number of arguments.)
|
|
||||||
|
|
||||||
When the returned procedure is applied, its arguments are queued to be
|
When the returned procedure is applied, its arguments are queued to be
|
||||||
passed on to @scheme[f], and @|void-const| is immediately returned.
|
passed on to @scheme[f], and @|void-const| is immediately returned.
|
||||||
|
|
|
@ -41,18 +41,13 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(init)
|
(init)
|
||||||
(loop))))
|
(loop))))
|
||||||
(lambda new-state
|
(procedure-reduce-arity
|
||||||
(let ([num (length new-state)])
|
(lambda new-state
|
||||||
(unless (procedure-arity-includes? f num)
|
(semaphore-wait protect)
|
||||||
(raise
|
(set! front-state (cons new-state front-state))
|
||||||
(make-exn:fail:contract:arity
|
(semaphore-post protect)
|
||||||
(format "<procedure-from-consumer-thread>: consumer procedure arity is ~e; provided ~s argument~a"
|
(semaphore-post sema))
|
||||||
(procedure-arity f) num (if (= 1 num) "" "s"))
|
(procedure-arity f)))))
|
||||||
(current-continuation-marks)))))
|
|
||||||
(semaphore-wait protect)
|
|
||||||
(set! front-state (cons new-state front-state))
|
|
||||||
(semaphore-post protect)
|
|
||||||
(semaphore-post sema)))))
|
|
||||||
|
|
||||||
(define/kw (run-server port-number handler connection-timeout
|
(define/kw (run-server port-number handler connection-timeout
|
||||||
#:optional
|
#:optional
|
||||||
|
|
|
@ -121,19 +121,26 @@ Returns @scheme[#t] if @scheme[v] is a mark set created by
|
||||||
[mark-set continuation-mark-set?])
|
[mark-set continuation-mark-set?])
|
||||||
list?]{
|
list?]{
|
||||||
|
|
||||||
Returns a list representing a ``@index["stack dump"]{@as-index{stack
|
Returns a list representing an approximate ``@index["stack
|
||||||
trace}}'' for @scheme[mark-set]'s continuation. The list contains
|
dump"]{@as-index{stack trace}}'' for @scheme[mark-set]'s
|
||||||
pairs, where the @scheme[car] of each pair contains either @scheme[#f]
|
continuation. The list contains pairs, where the @scheme[car] of each
|
||||||
or a symbol for a procedure name, and the @scheme[cdr] of each pair
|
pair contains either @scheme[#f] or a symbol for a procedure name, and
|
||||||
contains either @scheme[#f] or a @scheme[srcloc] value for the
|
the @scheme[cdr] of each pair contains either @scheme[#f] or a
|
||||||
procedure's source location (see @secref["linecol"]); the
|
@scheme[srcloc] value for the procedure's source location (see
|
||||||
@scheme[car] and @scheme[cdr] are never both @scheme[#f].
|
@secref["linecol"]); the @scheme[car] and @scheme[cdr] are never both
|
||||||
|
@scheme[#f].
|
||||||
|
|
||||||
The stack-trace list is the result of
|
Conceptually, the stack-trace list is the result of
|
||||||
@scheme[continuation-mark-set->list] with @scheme[mark-set] and
|
@scheme[continuation-mark-set->list] with @scheme[mark-set] and
|
||||||
Scheme's private key for procedure-call marks. A stack trace is
|
Scheme's private key for procedure-call marks. The implementation may
|
||||||
extracted from an exception and displayed by the default error display
|
be different, however, and the results may merely approximate the
|
||||||
handler (see @scheme[current-error-display-handler]) for exceptions other than
|
correct answer. Thus, while the result may contain useful hints to
|
||||||
|
humans about the context of an expression, it is not reliable enough
|
||||||
|
for programmatic use.
|
||||||
|
|
||||||
|
A stack trace is extracted from an exception and displayed by the
|
||||||
|
default error display handler (see
|
||||||
|
@scheme[current-error-display-handler]) for exceptions other than
|
||||||
@scheme[exn:fail:user] (see @scheme[raise-user-error] in
|
@scheme[exn:fail:user] (see @scheme[raise-user-error] in
|
||||||
@secref["errorproc"]).}
|
@secref["errorproc"]).}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user