doc clarifications (PR 9307) and arity issue (PR 9025)

svn: r9855
This commit is contained in:
Matthew Flatt 2008-05-15 17:29:49 +00:00
parent 6ef3399174
commit 4effd7b897
3 changed files with 26 additions and 27 deletions

View File

@ -65,10 +65,7 @@ it is still running, leaving the coroutine result unchanged.}
(values thread? procedure?)]{
Returns two values: a thread descriptor for a new thread, and a
procedure with the same arity as @scheme[f]. (The returned procedure
actually accepts any number of arguments, but immediately raises
@scheme[exn:fail:contract:arity] if @scheme[f] cannot accept the
provided number of arguments.)
procedure with the same arity as @scheme[f].
When the returned procedure is applied, its arguments are queued to be
passed on to @scheme[f], and @|void-const| is immediately returned.

View File

@ -41,18 +41,13 @@
(lambda ()
(init)
(loop))))
(procedure-reduce-arity
(lambda new-state
(let ([num (length new-state)])
(unless (procedure-arity-includes? f num)
(raise
(make-exn:fail:contract:arity
(format "<procedure-from-consumer-thread>: consumer procedure arity is ~e; provided ~s argument~a"
(procedure-arity f) num (if (= 1 num) "" "s"))
(current-continuation-marks)))))
(semaphore-wait protect)
(set! front-state (cons new-state front-state))
(semaphore-post protect)
(semaphore-post sema)))))
(semaphore-post sema))
(procedure-arity f)))))
(define/kw (run-server port-number handler connection-timeout
#:optional

View File

@ -121,19 +121,26 @@ Returns @scheme[#t] if @scheme[v] is a mark set created by
[mark-set continuation-mark-set?])
list?]{
Returns a list representing a ``@index["stack dump"]{@as-index{stack
trace}}'' for @scheme[mark-set]'s continuation. The list contains
pairs, where the @scheme[car] of each pair contains either @scheme[#f]
or a symbol for a procedure name, and the @scheme[cdr] of each pair
contains either @scheme[#f] or a @scheme[srcloc] value for the
procedure's source location (see @secref["linecol"]); the
@scheme[car] and @scheme[cdr] are never both @scheme[#f].
Returns a list representing an approximate ``@index["stack
dump"]{@as-index{stack trace}}'' for @scheme[mark-set]'s
continuation. The list contains pairs, where the @scheme[car] of each
pair contains either @scheme[#f] or a symbol for a procedure name, and
the @scheme[cdr] of each pair contains either @scheme[#f] or a
@scheme[srcloc] value for the procedure's source location (see
@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's private key for procedure-call marks. 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's private key for procedure-call marks. The implementation may
be different, however, and the results may merely approximate the
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
@secref["errorproc"]).}