diff --git a/collects/scribble/scheme.ss b/collects/scribble/scheme.ss index cfebd12287..1b77a0d26b 100644 --- a/collects/scribble/scheme.ss +++ b/collects/scribble/scheme.ss @@ -354,7 +354,7 @@ (advance c init-line!) (when (vector? (syntax-e c)) (let ([vec (syntax-e c)]) - (out (format "#~a" (vector-length vec)) p-color) + (out "#" #;(format "#~a" (vector-length vec)) p-color) (if (zero? (vector-length vec)) (set! src-col (+ src-col (- (syntax-span c) 2))) (set! src-col (+ src-col (- (syntax-column (vector-ref vec 0)) @@ -611,7 +611,7 @@ [(or (list? v) (vector? v)) (let* ([vec-sz (if (vector? v) - (+ 1 (string-length (format "~a" (vector-length v)))) + (+ 1 #;(string-length (format "~a" (vector-length v)))) 0)]) (let ([l (let loop ([col (+ col 1 vec-sz)] [v (if (vector? v) diff --git a/collects/scribblings/guide/vectors.scrbl b/collects/scribblings/guide/vectors.scrbl index aa770aad6a..26fd3f1bc1 100644 --- a/collects/scribblings/guide/vectors.scrbl +++ b/collects/scribblings/guide/vectors.scrbl @@ -10,11 +10,11 @@ values. Unlike a list, a vector supports constant-time access and update of its elements. A vector prints similar to a list---as a parenthesized sequence of its -elements---but a vector is prefixed with @litchar{#} and the length -of the vector. The vector length is optional for a vector as an -expression. Also, a vector as an expression implicitly quotes the -forms for its content, which means that identifiers and parenthesized -forms in a vector constant represent symbols and lists. +elements---but a vector is prefixed with @litchar{#}. For a vector as +an expression, an optional length can be supplied. Also, a vector as +an expression implicitly quotes the forms for its content, which means +that identifiers and parenthesized forms in a vector constant +represent symbols and lists. @refdetails/gory["parse-vector"]{the syntax of vectors} diff --git a/collects/scribblings/reference/printer.scrbl b/collects/scribblings/reference/printer.scrbl index b578d4763f..fbec44a3fd 100644 --- a/collects/scribblings/reference/printer.scrbl +++ b/collects/scribblings/reference/printer.scrbl @@ -169,8 +169,9 @@ to three octal digits (only as many as necessary). In @scheme[display] mode, the printed form of a vector is @litchar{#} followed by the printed form of @scheme[vector->list] applied to the 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]. +that when the @scheme[print-vector-length] parameter is @scheme[#t], a +decimal integer is printed after the @litchar{#}, and a repeated last +element is printed only once.. @section[#:tag "print-hashtable"]{Printing Hash Tables} diff --git a/collects/scribblings/reference/reader.scrbl b/collects/scribblings/reference/reader.scrbl index 301e18ed6e..c458591c76 100644 --- a/collects/scribblings/reference/reader.scrbl +++ b/collects/scribblings/reference/reader.scrbl @@ -86,14 +86,14 @@ on the next character or characters in the input stream as follows: @dispatch[@litchar{[}]{starts a pair or list; see @secref["parse-pair"]} @dispatch[@litchar["{"]]{starts a pair or list; see @secref["parse-pair"]} - @dispatch[@litchar{)}]{matches @litchar{(} or raises @Exn{exn:fail:read}} - @dispatch[@litchar{]}]{matches @litchar{[} or raises @Exn{exn:fail:read}} - @dispatch[@litchar["}"]]{matches @litchar["{"] or raises @Exn{exn:fail:read}} + @dispatch[@litchar{)}]{matches @litchar{(} or raises @Exn[exn:fail:read]} + @dispatch[@litchar{]}]{matches @litchar{[} or raises @Exn[exn:fail:read]} + @dispatch[@litchar["}"]]{matches @litchar["{"] or raises @Exn[exn:fail:read]} @dispatch[@litchar{"}]{starts a string; see @secref["parse-string"]} @dispatch[@litchar{,}]{starts a quote; see @secref["parse-quote"]} @dispatch[@litchar{`}]{starts a quasiquote; see @secref["parse-quote"]} - @dispatch[@litchar{,}]{starts an unquote or splicing unquote; see @secref["parse-quote"]} + @dispatch[@litchar{,}]{starts an [splicing] unquote; see @secref["parse-quote"]} @dispatch[@litchar{;}]{starts a line comment; see @secref["parse-comment"]} @@ -117,7 +117,7 @@ on the next character or characters in the input stream as follows: @dispatch[@litchar["#! "]]{starts a line comment; see @secref["parse-comment"]} @dispatch[@litchar["#!/"]]{starts a line comment; see @secref["parse-comment"]} @dispatch[@litchar{#`}]{starts a syntax quasiquote; see @secref["parse-quote"]} - @dispatch[@litchar{#,}]{starts an syntax unquote or splicing unquote; see @secref["parse-quote"]} + @dispatch[@litchar{#,}]{starts an syntax [splicing] unquote; see @secref["parse-quote"]} @dispatch[@litchar["#~"]]{starts compiled code; see @scheme[current-compile]} @dispatch[@cilitchar{#i}]{starts a number; see @secref["parse-number"]} @@ -715,7 +715,7 @@ neither defines nor uses graph tags for other top-level forms. @local-table-of-contents[] -@section[#:tag "parse-reader"]{Reading via an External Reader} +@section[#:tag "parse-reader"]{Reading via an Extension} When the reader encounters @as-index{@litchar{#reader}}, then it loads an external reader procedure and applies it to the current input diff --git a/collects/scribblings/reference/write.scrbl b/collects/scribblings/reference/write.scrbl index bc8656e787..91c9ec0c63 100644 --- a/collects/scribblings/reference/write.scrbl +++ b/collects/scribblings/reference/write.scrbl @@ -174,7 +174,7 @@ A parameter that controls printing box values; defaults to @defboolparam[print-vector-length on?]{ A parameter that controls printing vectors; defaults to -@scheme[#t]. See @secref["print-vectors"] for more information.} +@scheme[#f]. See @secref["print-vectors"] for more information.} @defboolparam[print-hash-table on?]{ diff --git a/doc/release-notes/mzscheme/MzScheme_4.txt b/doc/release-notes/mzscheme/MzScheme_4.txt index 14aebfa6f6..ebb96b9c47 100644 --- a/doc/release-notes/mzscheme/MzScheme_4.txt +++ b/doc/release-notes/mzscheme/MzScheme_4.txt @@ -83,7 +83,11 @@ in several significant ways: used carefully; library functions should typically allow "~" to be a relative path). - - Hash table printing is enabled by default. + - Hash table printing is enabled by default, and vector-length + printing is disabled by default. Opaque structure instances no + longer print with a leading "struct:" between angle brackets, and + built-in procedures print with "procedure:" instead of + "primitive:". - Graph input syntax, such as `#0=(1 . #0#)' is no longer allowed in program syntax parsed by `read-syntax', though it is still allowed diff --git a/src/mzscheme/src/thread.c b/src/mzscheme/src/thread.c index ac86c8e7f8..8f6c879578 100644 --- a/src/mzscheme/src/thread.c +++ b/src/mzscheme/src/thread.c @@ -6263,7 +6263,7 @@ static void make_initial_config(Scheme_Thread *p) init_param(cells, paramz, MZCONFIG_PRINT_GRAPH, scheme_false); init_param(cells, paramz, MZCONFIG_PRINT_STRUCT, scheme_true); init_param(cells, paramz, MZCONFIG_PRINT_BOX, scheme_true); - init_param(cells, paramz, MZCONFIG_PRINT_VEC_SHORTHAND, scheme_true); + init_param(cells, paramz, MZCONFIG_PRINT_VEC_SHORTHAND, scheme_false); init_param(cells, paramz, MZCONFIG_PRINT_HASH_TABLE, scheme_true); init_param(cells, paramz, MZCONFIG_PRINT_UNREADABLE, scheme_true); init_param(cells, paramz, MZCONFIG_PRINT_PAIR_CURLY, scheme_false);