disable print-vector-length by default

svn: r7818
This commit is contained in:
Matthew Flatt 2007-11-22 19:27:02 +00:00
parent 44478fa8e0
commit 0d44c0c57a
7 changed files with 23 additions and 18 deletions

View File

@ -354,7 +354,7 @@
(advance c init-line!) (advance c init-line!)
(when (vector? (syntax-e c)) (when (vector? (syntax-e c))
(let ([vec (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)) (if (zero? (vector-length vec))
(set! src-col (+ src-col (- (syntax-span c) 2))) (set! src-col (+ src-col (- (syntax-span c) 2)))
(set! src-col (+ src-col (- (syntax-column (vector-ref vec 0)) (set! src-col (+ src-col (- (syntax-column (vector-ref vec 0))
@ -611,7 +611,7 @@
[(or (list? v) [(or (list? v)
(vector? v)) (vector? v))
(let* ([vec-sz (if (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)]) 0)])
(let ([l (let loop ([col (+ col 1 vec-sz)] (let ([l (let loop ([col (+ col 1 vec-sz)]
[v (if (vector? v) [v (if (vector? v)

View File

@ -10,11 +10,11 @@ values. Unlike a list, a vector supports constant-time access and
update of its elements. update of its elements.
A vector prints similar to a list---as a parenthesized sequence of its A vector prints similar to a list---as a parenthesized sequence of its
elements---but a vector is prefixed with @litchar{#} and the length elements---but a vector is prefixed with @litchar{#}. For a vector as
of the vector. The vector length is optional for a vector as an an expression, an optional length can be supplied. Also, a vector as
expression. Also, a vector as an expression implicitly quotes the an expression implicitly quotes the forms for its content, which means
forms for its content, which means that identifiers and parenthesized that identifiers and parenthesized forms in a vector constant
forms in a vector constant represent symbols and lists. represent symbols and lists.
@refdetails/gory["parse-vector"]{the syntax of vectors} @refdetails/gory["parse-vector"]{the syntax of vectors}

View File

@ -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{#} In @scheme[display] mode, the printed form of a vector is @litchar{#}
followed by the printed form of @scheme[vector->list] applied to the followed by the printed form of @scheme[vector->list] applied to the
vector. In @scheme[write] mode, the printed form is the same, except vector. In @scheme[write] mode, the printed form is the same, except
that a decimal integer is printed after the @litchar{#} when the that when the @scheme[print-vector-length] parameter is @scheme[#t], a
@scheme[print-vector-length] parameter is @scheme[#t]. decimal integer is printed after the @litchar{#}, and a repeated last
element is printed only once..
@section[#:tag "print-hashtable"]{Printing Hash Tables} @section[#:tag "print-hashtable"]{Printing Hash Tables}

View File

@ -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["{"]]{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 string; see @secref["parse-string"]}
@dispatch[@litchar{,}]{starts a quote; see @secref["parse-quote"]} @dispatch[@litchar{,}]{starts a quote; see @secref["parse-quote"]}
@dispatch[@litchar{`}]{starts a quasiquote; 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"]} @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 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 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[@litchar["#~"]]{starts compiled code; see @scheme[current-compile]}
@dispatch[@cilitchar{#i}]{starts a number; see @secref["parse-number"]} @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[] @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 When the reader encounters @as-index{@litchar{#reader}}, then it loads
an external reader procedure and applies it to the current input an external reader procedure and applies it to the current input

View File

@ -174,7 +174,7 @@ A parameter that controls printing box values; defaults to
@defboolparam[print-vector-length on?]{ @defboolparam[print-vector-length on?]{
A parameter that controls printing vectors; defaults to 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?]{ @defboolparam[print-hash-table on?]{

View File

@ -83,7 +83,11 @@ in several significant ways:
used carefully; library functions should typically allow "~" to be used carefully; library functions should typically allow "~" to be
a relative path). 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 - Graph input syntax, such as `#0=(1 . #0#)' is no longer allowed in
program syntax parsed by `read-syntax', though it is still allowed program syntax parsed by `read-syntax', though it is still allowed

View File

@ -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_GRAPH, scheme_false);
init_param(cells, paramz, MZCONFIG_PRINT_STRUCT, scheme_true); init_param(cells, paramz, MZCONFIG_PRINT_STRUCT, scheme_true);
init_param(cells, paramz, MZCONFIG_PRINT_BOX, 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_HASH_TABLE, scheme_true);
init_param(cells, paramz, MZCONFIG_PRINT_UNREADABLE, scheme_true); init_param(cells, paramz, MZCONFIG_PRINT_UNREADABLE, scheme_true);
init_param(cells, paramz, MZCONFIG_PRINT_PAIR_CURLY, scheme_false); init_param(cells, paramz, MZCONFIG_PRINT_PAIR_CURLY, scheme_false);