From 9764065c6a5362ce78405990b5412ffac3e7debb Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 7 Jul 2007 08:31:19 +0000 Subject: [PATCH] 370.5 svn: r6832 --- collects/big/new-lambda.ss | 12 +- collects/mzlib/private/contract.ss | 4 +- collects/scribblings/reference/breaks.scrbl | 5 +- .../scribblings/reference/cont-marks.scrbl | 2 +- collects/scribblings/reference/cont.scrbl | 12 +- collects/scribblings/reference/evts.scrbl | 73 +- collects/scribblings/reference/exns.scrbl | 100 +- .../scribblings/reference/file-ports.scrbl | 2 +- .../scribblings/reference/parameters.scrbl | 21 +- collects/scribblings/reference/printer.scrbl | 6 +- collects/scribblings/reference/read.scrbl | 2 +- collects/scribblings/reference/regexps.scrbl | 2 +- .../scribblings/reference/semaphores.scrbl | 4 +- .../scribblings/reference/sequences.scrbl | 2 +- collects/scribblings/reference/struct.scrbl | 2 +- .../scribblings/reference/windows-paths.scrbl | 9 +- collects/scribblings/reference/write.scrbl | 10 +- collects/tests/mzscheme/basic.ss | 19 + collects/tests/mzscheme/param.ss | 29 +- .../web-server/docs/reference/reference.scrbl | 2 +- doc/release-notes/mzscheme/HISTORY | 4 + src/mzscheme/src/cstartup.inc | 5859 ++++++++--------- src/mzscheme/src/mzmark.c | 2 + src/mzscheme/src/mzmarksrc.c | 1 + src/mzscheme/src/schminc.h | 2 +- src/mzscheme/src/schvers.h | 4 +- src/mzscheme/src/symbol.c | 55 + src/mzscheme/src/thread.c | 14 +- src/wxmac/src/mac/wx_frame.cc | 4 +- 29 files changed, 3223 insertions(+), 3040 deletions(-) diff --git a/collects/big/new-lambda.ss b/collects/big/new-lambda.ss index 2f07d7524e..4322e61ede 100644 --- a/collects/big/new-lambda.ss +++ b/collects/big/new-lambda.ss @@ -133,15 +133,6 @@ ;; The sort in "list.ss" should be moved into it's own library, ;; so we can use it here without requiring lots of other stuff.) - ;; Also, keywordstring a) - (keyword->string b))) - (define-for-syntax (keywordstring a) - (keyword->string b))) - (define-for-syntax (sort l 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 @secref["mz:exnsandflow"]) for exceptions other than +handler (see @scheme[current-error-display-handler]) for exceptions other than @scheme[exn:fail:user] (see @scheme[raise-user-error] in @secref["mz:errorproc"]).} diff --git a/collects/scribblings/reference/cont.scrbl b/collects/scribblings/reference/cont.scrbl index fb19a9ba46..6e1c320032 100644 --- a/collects/scribblings/reference/cont.scrbl +++ b/collects/scribblings/reference/cont.scrbl @@ -59,7 +59,7 @@ default) or @scheme[make-continuation-prompt-tag]. The result of @scheme[call-with-continuation-prompt] call. The @scheme[handler] argument specifies a handler procedure to be -called in tail position with repsect to the +called in tail position with respect to the @scheme[call-with-continuation-prompt] call when the installed prompt is the target of a @scheme[abort-current-continuation] call with @scheme[prompt-tag]; the remaining arguments of @@ -294,11 +294,11 @@ to disable breaks. In both cases, the target for a jump is recomputed after each @scheme[pre-thunk] or @scheme[post-thunk] completes. When a -prompt-delimited continuation (see @secref["mz:prompts"]) is captured -in a @scheme[post-thunk], it might be delimited and instantiated in -such a way that the target of a jump turns out to be different when -the continuation is applied than when the continuation was -captured. There may even be no appropriate target, if a relevant +prompt-delimited continuation (see @secref["mz:prompt-model"]) is +captured in a @scheme[post-thunk], it might be delimited and +instantiated in such a way that the target of a jump turns out to be +different when the continuation is applied than when the continuation +was captured. There may even be no appropriate target, if a relevant prompt or escape continuation is not in the continuation after the restore; in that case, the first step in a @scheme[pre-thunk] or @scheme[post-thunk]'s continuation can raise an exception. diff --git a/collects/scribblings/reference/evts.scrbl b/collects/scribblings/reference/evts.scrbl index 10c714b02b..673ebcf341 100644 --- a/collects/scribblings/reference/evts.scrbl +++ b/collects/scribblings/reference/evts.scrbl @@ -32,34 +32,33 @@ event's state. The following act as events in stand-alone MzScheme. An extension or embedding application can extend the set of primitive events --- in particular, an eventspace in MrEd is an event --- and new structure -types can generate events (see @secref["mz:evt-structs"]). +types can generate events (see @scheme[prop:evt]). @itemize{ @item{@scheme[semaphore] --- a semaphore is ready when - @scheme[semaphore-wait] (see @secref["mz:semaphore"]) would not - block. @ResultItself{semaphore}.} + @scheme[semaphore-wait] would not block. @ResultItself{semaphore}.} @item{@scheme[semaphore-peek] --- a semaphore-peek event returned by - @scheme[semaphore-peek-evt] applied to @scheme[semaphore] (see - @secref["mz:semaphore"]) is ready exactly when @scheme[semaphore] is + @scheme[semaphore-peek-evt] applied to @scheme[semaphore] is ready + exactly when @scheme[semaphore] is ready. @ResultItself{semaphore-peek}.} - @item{@scheme[channel] --- a channel returned by @scheme[make-channel] - is ready when @scheme[channel-get] would not block (see - @secref["mz:channel"]). The channel's result as an event is the same as - the @scheme[channel-get] result.} + @item{@scheme[channel] --- a channel returned by + @scheme[make-channel] is ready when @scheme[channel-get] would not + block. The channel's result as an event is the same as the + @scheme[channel-get] result.} @item{@scheme[channel-put] --- an event returned by @scheme[channel-put-evt] applied to @scheme[channel] is ready when - @scheme[channel-put] would not block on @scheme[channel] (see - @secref["mz:channel"]). @ResultItself{channel-put}.} + @scheme[channel-put] would not block on + @scheme[channel]. @ResultItself{channel-put}.} @item{@scheme[input-port] --- an input port is ready as an event when @scheme[read-byte] would not block. @ResultItself{input-port}.} @item{@scheme[output-port] --- an output port is ready when - @scheme[write-bytes-avail] would not block (see @secref["mz:write"]) or + @scheme[write-bytes-avail] would not block or when the port contains buffered characters and @scheme[write-bytes-avail*] can flush part of the buffer (although @scheme[write-bytes-avail] might block). @ResultItself{output-port}.} @@ -69,49 +68,45 @@ types can generate events (see @secref["mz:evt-structs"]). any subsequent read from @scheme[input-port]. @ResultItself{progress}.} @item{@scheme[tcp-listener] --- a TCP listener is ready when - @scheme[tcp-accept] (see @secref["mz:tcp"]) would not block. - @ResultItself{listener}.} + @scheme[tcp-accept] would not block. @ResultItself{listener}.} @item{@scheme[thd] --- a thread is ready when @scheme[thread-wait] - (see @secref["mz:threadsync"]) would not block. @ResultItself{thread}.} + would not block. @ResultItself{thread}.} @item{@scheme[thread-dead] --- an event returned by - @scheme[thread-dead-evt] (see @secref["mz:threadsync"]) applied to - @scheme[thd] is ready when @scheme[thd] has terminated. - @ResultItself{thread-dead}.} + @scheme[thread-dead-evt] applied to @scheme[thd] is ready when + @scheme[thd] has terminated. @ResultItself{thread-dead}.} @item{@scheme[thread-resume] --- an event returned by - @scheme[thread-resume-evt] (see @secref["mz:threadsync"]) applied to - @scheme[thd] is ready when @scheme[thd] subsequently resumes - execution (if it was not already running). The event's result is - @scheme[thd].} + @scheme[thread-resume-evt] applied to @scheme[thd] is ready when + @scheme[thd] subsequently resumes execution (if it was not already + running). The event's result is @scheme[thd].} @item{@scheme[thread-suspend] --- an event returned by - @scheme[thread-suspend-evt] (see @secref["mz:threadsync"]) applied to - @scheme[thd] is ready when @scheme[thd] subsequently suspends - execution (if it was not already suspended). The event's result is - @scheme[thd].} + @scheme[thread-suspend-evt] applied to @scheme[thd] is ready when + @scheme[thd] subsequently suspends execution (if it was not already + suspended). The event's result is @scheme[thd].} @item{@scheme[alarm] --- an event returned by @scheme[alarm-evt] is ready after a particular date and time. @ResultItself{alarm}.} @item{@scheme[subprocess] --- a subprocess is ready when - @scheme[subprocess-wait] (see @secref["mz:subprocess"]) would not block. + @scheme[subprocess-wait] would not block. @ResultItself{subprocess}.} @item{@scheme[will-executor] --- a will executor is ready when - @scheme[will-execute] (see @secref["mz:willexecutor"]) would not block. + @scheme[will-execute] would not block. @ResultItself{will-executor}.} @item{@scheme[udp] --- an event returned by @scheme[udp-send-evt] or - @scheme[udp-receive!-evt] (see @secref["mz:udp"]) is ready when a send or - receive on the original socket would block, respectively. @ResultItself{udp}.} + @scheme[udp-receive!-evt] is ready when a send or receive on the + original socket would block, respectively. @ResultItself{udp}.} - @item{@scheme[choice] --- an event returned by @scheme[choice-evt] (see - below) is ready when one or more of the @scheme[evt]s supplied to + @item{@scheme[choice] --- an event returned by @scheme[choice-evt] is + ready when one or more of the @scheme[evt]s supplied to @scheme[chocie-evt] are ready. If the choice event is chosen, one of - its ready @scheme[evt]s is chosen pseudo-randomly, and the result is the - chosen @scheme[evt]'s result.} + its ready @scheme[evt]s is chosen pseudo-randomly, and the result is + the chosen @scheme[evt]'s result.} @item{@scheme[wrap] --- an event returned by @scheme[wrap-evt] applied to @scheme[evt] and @scheme[proc] is ready when @scheme[evt] is @@ -164,8 +159,8 @@ types can generate events (see @secref["mz:evt-structs"]). result.} @item{@scheme[struct] --- a structure whose type has the - @scheme[prop:evt] property identifies/generates an event through - the property; see @secref["mz:evt-structs"] for further information.} + @scheme[prop:evt] property identifies/generates an event through the + property.} @item{@scheme[always-evt] --- a constant event that is always ready. @ResultItself{@scheme[always-evt]}.} @@ -342,9 +337,9 @@ A @tech{structure type property} that identifies structure types whose } Instances of a structure type with the @scheme[prop:input-port] or -@scheme[prop:output-port] property (see @secref["mz:portstructs"]) are -also synchronizable by virtue of being a port. If the structure type -has more than one of @scheme[prop:evt], @scheme[prop:input-port], and +@scheme[prop:output-port] property are also synchronizable by virtue +of being a port. If the structure type has more than one of +@scheme[prop:evt], @scheme[prop:input-port], and @scheme[prop:output-port], then the @scheme[prop:evt] value (if any) takes precedence for determing the instance's behavior as an event, and the @scheme[prop:input-port] property takes precedence over diff --git a/collects/scribblings/reference/exns.scrbl b/collects/scribblings/reference/exns.scrbl index b57ba41fee..b3694886c6 100644 --- a/collects/scribblings/reference/exns.scrbl +++ b/collects/scribblings/reference/exns.scrbl @@ -190,7 +190,7 @@ exception is raised during the evaluation of @scheme[thunk] (in an extension of the current continuation that does not have its own exception handler), then @scheme[f] is applied to the @scheme[raise]d value in the continuation of the @scheme[raise] call (but extended -with a continuation barrier; see @secref["mz:continuations"]). +with a @tech{continuation barrier}; see @secref["mz:prompt-model"]). Any procedure that takes one argument can be an exception handler. If the exception handler returns a value when invoked by @scheme[raise], @@ -276,6 +276,104 @@ Like @scheme[with-handlers], but if a @scheme[handler-expr] procedure is called, breaks are not explicitly disabled, and the call is in tail position with respect to the @scheme[with-handlers*] form.} +@;------------------------------------------------------------------------ +@section{Configuring Default Handling} + +@defparam[error-escape-handler proc (-> any)]{ + +A parameter for the @deftech{error escape handler}, which takes no +arguments and escapes from the dynamic context of an exception. The +default error escape handler escapes using +@scheme[(abort-current-continuation (default-continuation-prompt-tag) +void)]. + +The error escape handler is normally called directly by an exception +handler, in a @tech{parameterization} that sets the @tech{error +display handler} and @tech{error escape handler} to the default +handlers, and it is normally @scheme[parameterize-break]ed to disable +breaks. To escape from a run-time error in a different context, use +@scheme[raise] or @scheme[error]. + +Due to a @tech{continuation barrier} around exception-handling calls, +an error escape handler cannot invoke a full continuation that was +created prior to the exception, but it can abort to a prompt (see +@scheme[call-with-continuation-prompt]) or invoke an escape +continuation (see @scheme[call-with-escape-continuation]).} + +@defparam[error-display-handler proc (string? any/c . -> . any)]{ + +A parameter for the @deftech{error display handler}, which is called +by the default exception handler with an error message and the +exception value. More generally, the handler's first argument is a +string to print as an error message, and the second is a value +representing a raised exception. + +The default error display handler @scheme[display]s its first argument +to the current error port (determined by the +@scheme[current-error-port] parameter) and extracts a stack trace (see +@scheme[continuation-mark-set->context]) to display from the second +argument if it is an @scheme[exn] value but not an +@scheme[exn:fail:user] value. + +@margin-note{The default error display handler in DrScheme also uses +the second argument to highlight source locations.} + +To report a run-time error, use @scheme[raise] or procedures like +@scheme[error], instead of calling the error display procedure +directly.} + +@defparam[error-print-width width (and exact-integer? (>=/c 3))]{ + +A parameter whose value is used as the maximum number of characters +used to print a Scheme value that is embedded in a primitive error +message.} + +@defparam[error-print-context-length cnt nonnegative-exact-integer?]{ + +A parameter whose value is used by the default error display handler +as the maximum number of lines of context (or ``stack trace'') to +print; a single ``...'' line is printed if more lines are available +after the first @scheme[cnt] lines. A @scheme[0] value for +@scheme[cnt] disables context printing entirely.} + +@defparam[error-value->string-handler proc (any/c nonnegative-exact-integer? + . -> . + string?)]{ + +A parameter that determines the @deftech{error value conversion +handler}, which is used to print a Scheme value that is embedded in a +primitive error message. + +The integer argument to the handler specifies the maximum number of +characters that should be used to represent the value in the resulting +string. The default error value conversion handler @scheme[print]s +the value into a string (using the current @tech{global port print +handler}; see @scheme[global-port-print-handler]). If the printed form +is too long, the printed form is truncated and the last three +characters of the return string are set to ``...''. + +If the string returned by an error value conversion handler is longer +than requested, the string is destructively ``truncated'' by setting +the first extra position in the string to the null character. If a +non-string is returned, then the string @scheme["..."] is used. If a +primitive error string needs to be generated before the handler has +returned, the default error value conversion handler is used. + +Call to an error value conversion handler are @scheme[parameterized] +to re-install the default error value conversion handler, and to +enable printing of unreadable values (see @scheme[print-unreadable]).} + +@defboolparam[error-print-source-location include?]{ + +A parameter that controls whether read and syntax error messages +include source information, such as the source line and column or the +expression. This parameter also controls the error message when a +module-defined variable is accessed before its definition is executed; +the parameter determines whether the message includes a module +name. Only the message field of an @scheme[exn:fail:read], +@scheme[exn:fail:syntax], or @scheme[exn:fail:contract:variable] +structure is affected by the parameter. The default is @scheme[#t].} + @;------------------------------------------------------------------------ @section{Built-in Exception Types} diff --git a/collects/scribblings/reference/file-ports.scrbl b/collects/scribblings/reference/file-ports.scrbl index 94e387c5c5..724d5529d3 100644 --- a/collects/scribblings/reference/file-ports.scrbl +++ b/collects/scribblings/reference/file-ports.scrbl @@ -1,7 +1,7 @@ #reader(lib "docreader.ss" "scribble") @require["mz.ss"] -@title{File Ports} +@title[#:tag "mz:file-ports"]{File Ports} A port created by @scheme[open-input-file], @scheme[open-output-file], @scheme[subprocess], and related functions is a @deftech{file-stream diff --git a/collects/scribblings/reference/parameters.scrbl b/collects/scribblings/reference/parameters.scrbl index 8a58d6a9b5..4c01e339b0 100644 --- a/collects/scribblings/reference/parameters.scrbl +++ b/collects/scribblings/reference/parameters.scrbl @@ -5,9 +5,9 @@ See @secref["mz:parameter-model"] for basic information on the parameter model. Parameters correspond to @defterm{preserved thread -fluids} in \first{Scsh} @cite[#:key "cite:thread-fluids" #:title -"Processes vs. User-Level Threads in Scsh" #:author "Martin Gasbichler -and Michael Sperber" #:date 2002 #:location "Scheme Workshop"]. +fluids} in Scsh @cite[#:key "cite:thread-fluids" #:title "Processes +vs. User-Level Threads in Scsh" #:author "Martin Gasbichler and +Michael Sperber" #:date 2002 #:location "Scheme Workshop"]. To parameterize code in a thread- and continuation-friendly manner, use @scheme[parameterize]. The @scheme[parameterize] form introduces a @@ -123,12 +123,21 @@ forms.} @defproc[(make-derived-parameter [v any/c] - [guard (any/c . -> . any)]) + [guard (any/c . -> . any)] + [wrap (any/c . -> . any)]) parameter?]{ Returns a parameter procedure that sets or retrieves the same value as -@scheme[parameter], but with the additional guard @scheme[guard] -applied (before any guard associated with @scheme[parameter]).} +@scheme[parameter], but with: + +@itemize{ + + @item{@scheme[guard] applied when setting the parameter (before any + guard associated with @scheme[parameter]), and} + + @item{@scheme[wrap] applied when obtaining the parameter's value.} + +}} @defproc[(parameter? [v any/c]) boolean?]{ diff --git a/collects/scribblings/reference/printer.scrbl b/collects/scribblings/reference/printer.scrbl index c607450ec2..16701e82b4 100644 --- a/collects/scribblings/reference/printer.scrbl +++ b/collects/scribblings/reference/printer.scrbl @@ -154,7 +154,7 @@ is written using @litchar{\a}, @litchar{\b}, @litchar{\t}, @litchar{\e} if possible, otherwise using @litchar{\} followed by one to three octal digits (only as many as necessary). -@section{Printing Vectors} +@section[#:tag "mz:print-vectors"]{Printing Vectors} In @scheme[display] mode, the printed form of a vector is @litchar{#} followed by the printed form of @scheme[vector->list] applied to the @@ -162,7 +162,7 @@ vector. In @scheme[write] mode, the printed form is the same, except that a decimal integer is printed after the @litchar{#} when the @scheme[print-vector-length] parameter is @scheme[#t]. -@section{Printing Hash Tables} +@section[#:tag "mz:print-hashtable"]{Printing Hash Tables} When the @scheme[print-hash-table] parameter is set to @scheme[#t], a hash table prints starting with @litchar{#hash(} or @litchar{#hasheq(} @@ -177,7 +177,7 @@ After all key-value pairs, the printed form completes with When the @scheme[print-hash-table] parameter is set to @scheme[#f], a hash table prints (un@scheme[read]ably) as @litchar{#}. -@section{Printing Boxes} +@section[#:tag "mz:print-box"]{Printing Boxes} When the @scheme[print-box] parameter is set to @scheme[#t], a box prints as @litchar{#&} followed by the printed form of its content. diff --git a/collects/scribblings/reference/read.scrbl b/collects/scribblings/reference/read.scrbl index 1489bb8e95..531fa29b78 100644 --- a/collects/scribblings/reference/read.scrbl +++ b/collects/scribblings/reference/read.scrbl @@ -36,7 +36,7 @@ Similar to calling @scheme[read], but normally used during the dynamic extent of @scheme[read] within a reader-extension procedure (see @secref["mz:reader-procs"]). The main effect of using @scheme[read/recursive] instead of @scheme[read] is that -graph-structure annotations (see @secref["mz:sexpressions"]) in the +graph-structure annotations (see @secref["mz:parse-graph"]) in the nested read are considered part of the overall read, at least when the @scheme[graph?] argument is true; since the result is wrapped in a placeholder, however, it is not directly inspectable. diff --git a/collects/scribblings/reference/regexps.scrbl b/collects/scribblings/reference/regexps.scrbl index cbd54dca77..006d143a35 100644 --- a/collects/scribblings/reference/regexps.scrbl +++ b/collects/scribblings/reference/regexps.scrbl @@ -317,7 +317,7 @@ match succeeds, @scheme[#f] otherwise.} Like @scheme[regexp-match] on input ports, but only peeks bytes from @scheme[input-port] instead of reading them. Furthermore, instead of an output port, the last optional argument is a progress event for -@scheme[input-port] (see @secref["mz:read"]). If @scheme[progress] +@scheme[input-port] (see @scheme[port-progress-evt]). If @scheme[progress] becomes ready, then the match stops peeking from @scheme[input-port] and returns @scheme[#f]. The @scheme[progress] argument can be @scheme[#f], in which case the peek may continue with inconsistent diff --git a/collects/scribblings/reference/semaphores.scrbl b/collects/scribblings/reference/semaphores.scrbl index 9ffec911c8..01c8d0ebfd 100644 --- a/collects/scribblings/reference/semaphores.scrbl +++ b/collects/scribblings/reference/semaphores.scrbl @@ -69,8 +69,8 @@ the event does not decrement @scheme[sema]'s internal count.} Waits on @scheme[sema] using @scheme[semaphore-wait], calls @scheme[proc] with all @scheme[arg]s, and then posts to -@scheme[sema]. A continuation barrier blocks full continuation jumps -into or out of @scheme[proc] (see @secref["mz:continuations"]), but +@scheme[sema]. A @tech{continuation barrier} blocks full continuation jumps +into or out of @scheme[proc] (see @secref["mz:prompt-model"]), but escape jumps are allowed, and @scheme[sema] is posted on escape. If @scheme[try-fail-thunk] is provided and is not @scheme[#f], then @scheme[semaphore-try-wait?] is called on @scheme[sema] instead of diff --git a/collects/scribblings/reference/sequences.scrbl b/collects/scribblings/reference/sequences.scrbl index 45210e202e..de7d583f05 100644 --- a/collects/scribblings/reference/sequences.scrbl +++ b/collects/scribblings/reference/sequences.scrbl @@ -33,7 +33,7 @@ built-in datatypes, the sequence datatype includes the following: @item{byte strings (see @secref["mz:bytestrings"])} - @item{input ports (see @secref["mz:input-ports"])} + @item{input ports (see @secref["mz:ports"])} } diff --git a/collects/scribblings/reference/struct.scrbl b/collects/scribblings/reference/struct.scrbl index fb4fac0098..68b16e0144 100644 --- a/collects/scribblings/reference/struct.scrbl +++ b/collects/scribblings/reference/struct.scrbl @@ -103,7 +103,7 @@ information about the structure type and its instances; see @secref["mz:inspectors"] for more information. If @scheme[proc-spec] is an integer or procedure, instances of the -structure type act as procedures. See @secref["mz:procstructs"] for +structure type act as procedures. See @scheme[prop:procedure] for further information. Providing a non-@scheme[#f] value for @scheme[proc-spec] is the same as pairing the value with @scheme[prop:procedure] in @scheme[props], plus including diff --git a/collects/scribblings/reference/windows-paths.scrbl b/collects/scribblings/reference/windows-paths.scrbl index 5a35ceeb86..fad36b0e7d 100644 --- a/collects/scribblings/reference/windows-paths.scrbl +++ b/collects/scribblings/reference/windows-paths.scrbl @@ -8,11 +8,10 @@ @title[#:tag "mz:windowspaths"]{Windows Path Conventions} In general, a Windows pathname consists of an optional drive specifier -and a drive-specific path. As noted in @secref["mz:filesystem"], a -Windows path can be @defterm{absolute} but still relative to the -current drive; such paths start with a @litchar{/} or @litchar["\\"] -separator and are not UNC paths or paths that start with -@litchar["\\\\?\\"]. +and a drive-specific path. A Windows path can be @defterm{absolute} +but still relative to the current drive; such paths start with a +@litchar{/} or @litchar["\\"] separator and are not UNC paths or paths +that start with @litchar["\\\\?\\"]. A path that starts with a drive specification is @defterm{complete}. Roughly, a drive specification is either a Roman letter followed by a diff --git a/collects/scribblings/reference/write.scrbl b/collects/scribblings/reference/write.scrbl index 1494a7f4b0..d2691c8bf8 100644 --- a/collects/scribblings/reference/write.scrbl +++ b/collects/scribblings/reference/write.scrbl @@ -143,7 +143,7 @@ structures that have a custom-write procedure (see @defboolparam[print-graph on?]{ A parameter that controls printing data with sharing; defaults to -@scheme[#f]. See @secref["mz:sexpressions"] for more information.} +@scheme[#f]. See @secref["mz:printing"] for more information.} @defboolparam[print-struct on?]{ @@ -156,17 +156,17 @@ structures that have a custom-write procedure (see @defboolparam[print-box on?]{ A parameter that controls printing box values; defaults to -@scheme[#t]. See @secref["mz:printing"] for more information.} +@scheme[#t]. See @secref["mz:print-box"] for more information.} @defboolparam[print-vector-length on?]{ A parameter that controls printing vectors; defaults to -@scheme[#t]. See @secref["mz:printing"] for more information.} +@scheme[#t]. See @secref["mz:print-vector"] for more information.} @defboolparam[print-hash-table on?]{ A parameter that controls printing hash tables; defaults to -@scheme[#f]. See @secref["mz:printing"] for more information.} +@scheme[#f]. See @secref["mz:print-hashtable"] for more information.} @defboolparam[print-honu on?]{ @@ -204,7 +204,7 @@ global port print handler is the same as the default write handler.} @defparam[global-port-print-handler proc (any/c output-port? . -> . any)]{ -A parameter that determines @idefterm{global port print handler}, +A parameter that determines @deftech{global port print handler}, which is called by the default port print handler (see @scheme[port-print-handler]) to @scheme[print] values into a port. The default value uses the built-in printer (see diff --git a/collects/tests/mzscheme/basic.ss b/collects/tests/mzscheme/basic.ss index 32da62db69..cbad29f903 100644 --- a/collects/tests/mzscheme/basic.ss +++ b/collects/tests/mzscheme/basic.ss @@ -400,6 +400,25 @@ (arity-test symbol? 1 1) +(test #t keyword? '#:a) +(test #f keyword? 'a) +(test '#:apple string->keyword "apple") +(test "apple" keyword->string '#:apple) +(test #t keywordkeyword "a") (string->keyword "\uA0")) +(test #t keywordkeyword "a") (string->keyword "\uFF")) +(test #f keywordkeyword "\uA0") (string->keyword "a")) +(test #f keywordkeyword "\uFF") (string->keyword "a")) +(test #t keywordkeyword "\uA0") (string->keyword "\uFF")) +(test #f keywordkeyword "\uFF") (string->keyword "\uA0")) +(test #f keywordkeyword "\uA0") (string->keyword "\uA0")) + +(arity-test keyword? 1 1) +(arity-test keyworddirectory-path (build-path v "sub"))]) @@ -144,7 +144,8 @@ (let ([cd (make-derived-parameter current-directory (lambda (x) (set! l (cons x l)) - "sub"))] + "sub") + values)] [v (current-directory)]) (let ([sub (path->directory-path (build-path v "sub"))]) (parameterize ([cd "foo"]) diff --git a/collects/web-server/docs/reference/reference.scrbl b/collects/web-server/docs/reference/reference.scrbl index 406db7e6d4..ce3a4d848b 100644 --- a/collects/web-server/docs/reference/reference.scrbl +++ b/collects/web-server/docs/reference/reference.scrbl @@ -2,7 +2,7 @@ @require["../web-server.ss"] @title[#:tag "web-server-ref"]{Web Server Reference Manual} -@author{Jay McCarthy (jay\@plt-scheme.org)} +@author{Jay McCarthy (jay@"@"plt-scheme.org)} The @web-server collection provides libraries that can be used to develop Web applications in Scheme. diff --git a/doc/release-notes/mzscheme/HISTORY b/doc/release-notes/mzscheme/HISTORY index 49dd18a2f4..2e5858bb81 100644 --- a/doc/release-notes/mzscheme/HISTORY +++ b/doc/release-notes/mzscheme/HISTORY @@ -1,3 +1,7 @@ +Version 370.5 +Added keywordkey); gcMARK(d->guard); + gcMARK(d->extract_guard); gcMARK(d->defcell); return @@ -3823,6 +3824,7 @@ static int mark_param_data_FIXUP(void *p) { gcFIXUP(d->key); gcFIXUP(d->guard); + gcFIXUP(d->extract_guard); gcFIXUP(d->defcell); return diff --git a/src/mzscheme/src/mzmarksrc.c b/src/mzscheme/src/mzmarksrc.c index e457e37463..439a654e92 100644 --- a/src/mzscheme/src/mzmarksrc.c +++ b/src/mzscheme/src/mzmarksrc.c @@ -1546,6 +1546,7 @@ mark_param_data { gcMARK(d->key); gcMARK(d->guard); + gcMARK(d->extract_guard); gcMARK(d->defcell); size: diff --git a/src/mzscheme/src/schminc.h b/src/mzscheme/src/schminc.h index c6e07416a1..1e6e7bc5e4 100644 --- a/src/mzscheme/src/schminc.h +++ b/src/mzscheme/src/schminc.h @@ -13,7 +13,7 @@ #define USE_COMPILED_STARTUP 1 -#define EXPECTED_PRIM_COUNT 904 +#define EXPECTED_PRIM_COUNT 905 #ifdef MZSCHEME_SOMETHING_OMITTED # undef USE_COMPILED_STARTUP diff --git a/src/mzscheme/src/schvers.h b/src/mzscheme/src/schvers.h index d70ac78807..e583ad7567 100644 --- a/src/mzscheme/src/schvers.h +++ b/src/mzscheme/src/schvers.h @@ -9,6 +9,6 @@ #define MZSCHEME_VERSION_MAJOR 370 -#define MZSCHEME_VERSION_MINOR 4 +#define MZSCHEME_VERSION_MINOR 5 -#define MZSCHEME_VERSION "370.4" _MZ_SPECIAL_TAG +#define MZSCHEME_VERSION "370.5" _MZ_SPECIAL_TAG diff --git a/src/mzscheme/src/symbol.c b/src/mzscheme/src/symbol.c index 87c6190efb..5f5499254c 100644 --- a/src/mzscheme/src/symbol.c +++ b/src/mzscheme/src/symbol.c @@ -64,6 +64,7 @@ static Scheme_Object *string_to_symbol_prim (int argc, Scheme_Object *argv[]); static Scheme_Object *string_to_uninterned_symbol_prim (int argc, Scheme_Object *argv[]); static Scheme_Object *symbol_to_string_prim (int argc, Scheme_Object *argv[]); static Scheme_Object *keyword_p_prim (int argc, Scheme_Object *argv[]); +static Scheme_Object *keyword_lt (int argc, Scheme_Object *argv[]); static Scheme_Object *string_to_keyword_prim (int argc, Scheme_Object *argv[]); static Scheme_Object *keyword_to_string_prim (int argc, Scheme_Object *argv[]); static Scheme_Object *gensym(int argc, Scheme_Object *argv[]); @@ -320,6 +321,11 @@ scheme_init_symbol (Scheme_Env *env) "keyword?", 1, 1, 1), env); + scheme_add_global_constant("keywordkeyword", scheme_make_noncm_prim(string_to_keyword_prim, "string->keyword", @@ -683,6 +689,55 @@ keyword_p_prim (int argc, Scheme_Object *argv[]) return SCHEME_KEYWORDP(argv[0]) ? scheme_true : scheme_false; } +static Scheme_Object *keyword_lt (int argc, Scheme_Object *argv[]) +{ + Scheme_Object *prev = argv[0], *kw; + GC_CAN_IGNORE unsigned char *a, *b; + int i, al, bl, t; + + if (!SCHEME_KEYWORDP(prev)) + scheme_wrong_type("keyword *b) { + al = bl = 0; + break; + } else { + a++; + b++; + } + } + a = b = NULL; + + if (al >= bl) { + /* Check remaining types */ + for (i++; i < argc; i++) { + if (!SCHEME_KEYWORDP(argv[i])) + scheme_wrong_type("keywordis_derived) { - return _scheme_tail_apply(data->key, argc, argv2); + if (!argc) { + Scheme_Object *v; + v = _scheme_apply(data->key, argc, argv2); + pos[0] = v; + return _scheme_tail_apply(data->extract_guard, 1, pos); + } else { + return _scheme_tail_apply(data->key, argc, argv2); + } } pos[0] = data->key; @@ -6161,6 +6169,7 @@ static Scheme_Object *make_derived_parameter(int argc, Scheme_Object **argv) scheme_wrong_type("make-derived-parameter", "parameter", 0, argc, argv); scheme_check_proc_arity("make-derived-parameter", 1, 1, argc, argv); + scheme_check_proc_arity("make-derived-parameter", 1, 2, argc, argv); data = MALLOC_ONE_RT(ParamData); #ifdef MZTAG_REQUIRED @@ -6169,6 +6178,7 @@ static Scheme_Object *make_derived_parameter(int argc, Scheme_Object **argv) data->is_derived = 1; data->key = argv[0]; data->guard = argv[1]; + data->extract_guard = argv[2]; p = scheme_make_closed_prim_w_arity(do_param, (void *)data, "parameter-procedure", 0, 1); diff --git a/src/wxmac/src/mac/wx_frame.cc b/src/wxmac/src/mac/wx_frame.cc index b0365b39fa..d9a3f91cda 100644 --- a/src/wxmac/src/mac/wx_frame.cc +++ b/src/wxmac/src/mac/wx_frame.cc @@ -134,7 +134,7 @@ wxFrame::wxFrame // Constructor (for frame window) windowClass = kToolbarWindowClass; windowAttributes = kWindowNoAttributes; } else { - windowClass = kUtilityWindowClass; + windowClass = kUtilityWindowClass; /* or kFloatingWindowClass? */ windowAttributes = kWindowCloseBoxAttribute; if (!(cStyle & wxNO_RESIZE_BORDER)) { windowAttributes |= kWindowFullZoomAttribute | kWindowResizableAttribute; @@ -1230,6 +1230,8 @@ wxFrame *wxFrame::GetSheetParent() return NULL; /* No nested sheets */ else if (cStyle & wxNO_CAPTION) return NULL; /* Sheets need a title bar */ + else if (cStyle & wxFLOAT_FRAME) + return NULL; /* Don't use sheets on floating windows */ else #endif return this;