diff --git a/LOG b/LOG index 1f8b5eeba2..c9ca65454e 100644 --- a/LOG +++ b/LOG @@ -301,7 +301,12 @@ syntax.ss - added tests for the case and exclusive-cond syntax-error calls 4.ms, root-experr-compile-0-f-f-f -- added print-extended-identifier parameter. when #t, symbols like +- added print-extended-identifiers parameter. when #t, symbols like 1+ and +++ print without escapes. priminfo.ss, print.ss, 6.ms +- added descriptions of print-extended-identifiers to the user's guide + and release notes. updated the release notes to account for a couple + of other log entries. + release_notes.stex, + intro.stex, io.stex diff --git a/csug/intro.stex b/csug/intro.stex index 6f9971ab73..8917c47107 100644 --- a/csug/intro.stex +++ b/csug/intro.stex @@ -269,10 +269,13 @@ parameter \scheme{case-sensitive} has been set to \scheme{#f}. The printer invoked by \scheme{write}, \scheme{put-datum}, \scheme{pretty-print}, and the \scheme{format} \scheme{~s} option always prints standard Revised$^6$ Report objects -using the standard syntax. -For example, it prints symbols whose names require escaping using hex -scalar value escapes, not one of the other mechanisms supported by the -reader. +using the standard syntax, unless a different behavior is +requested via the setting of one of the print parameters. +For example, it prints symbols in the extended identifier syntax +of Chez Scheme described above using hex scalar value escapes, +unless the parameter +\index{\scheme{print-extended-identifiers}}\scheme{print-extended-identifiers} is set to +true. Similarly, it does not print the explicit length or suppress duplicate trailing elements unless the parameter \index{\scheme{print-vector-length}}\scheme{print-vector-length} is set to diff --git a/csug/io.stex b/csug/io.stex index f30122fe8c..b77c19ba6f 100644 --- a/csug/io.stex +++ b/csug/io.stex @@ -2789,7 +2789,7 @@ Character associations created by \scheme{char-name} are ignored by the printer unless the parameter \scheme{print-char-name} is set to a true value. The reader recognizes character names established by \scheme{char-name} -except after the \scheme{#!r6rs}, which is implied within a library or +except after \scheme{#!r6rs}, which is implied within a library or R6RS top-level program. In the one-argument form, \var{obj} must be a symbol or character. @@ -3146,6 +3146,56 @@ common control structures, e.g., around \scheme{let} bindings and (get-output-string p))) ;== " \endschemedisplay +%---------------------------------------------------------------------------- +\entryheader +\formdef{print-extended-identifiers}{\categorythreadparameter}{print-extended-identifiers} +\listlibraries +\endentryheader + +Chez Scheme extends the syntax of identifiers as described +Section~\ref{SECTINTROSYNTAX}, except within a set of forms prefixed by +\scheme{#!r6rs} (which is implied by in a library or top-level program). + +When this parameter is set to a false (the default), identifiers in the +extended set are printed with hex scalar value escapes as necessary to +conform to the R6RS syntax for identifiers. +When this parameter is set to a a true value, identifiers in the +extended set are printed without the escapes. +Identifiers whose names fall outside of both syntaxes are printed with +the escapes regardless of the setting of this parameter. + +For example: + +\schemedisplay +(parameterize ([print-extended-identifiers #f]) + (printf "~s\n~s\n" + '(1+ --- { } .xyz) + (string->symbol "123"))) +\endschemedisplay + +prints + +\schemedisplay +(\x31;+ \x2D;-- \x7B; \x7D; \x2E;xyz) +\x31;23 +\endschemedisplay + +while + +\schemedisplay +(parameterize ([print-extended-identifiers #t]) + (printf "~s\n~s\n" + '(1+ --- { } .xyz) + (string->symbol "123"))) +\endschemedisplay + +prints + +\schemedisplay +(1+ --- { } .xyz) +\x31;23 +\endschemedisplay + %---------------------------------------------------------------------------- \entryheader \formdef{print-vector-length}{\categorythreadparameter}{print-vector-length} diff --git a/release_notes/release_notes.stex b/release_notes/release_notes.stex index 06b3942ddb..4eac0abee7 100644 --- a/release_notes/release_notes.stex +++ b/release_notes/release_notes.stex @@ -58,6 +58,24 @@ Online versions of both books can be found at %----------------------------------------------------------------------------- \section{Functionality Changes}\label{section:functionality} +\subsection{Printing of non-standard (extended) identifiers (9.4.1)} + +Chez Scheme extends the syntax of identifiers as described in the +introduction to the Chez Scheme User's Guide, except within forms prefixed +by \scheme{#!r6rs}, which is implied by in a library or top-level program. +Prior to Version~9.4.1, the printer always printed such identifiers using +hex scalar value escapes as necessary to render them with valid R6RS identifier syntax. +When the new parameter \scheme{print-extended-identifiers} is set +to \scheme{#t}, these identifiers are printed without escapes, e.g., +\scheme{1+} prints as \scheme{1+} rather than as \scheme{\x31;+}. +The default value of this parameter is \scheme{#f}. + +\subsection{Expression-editor Unicode support (9.4.1)} + +The expression editor now supports Unicode characters under Linux and MacOS~X +except that combining characters are not treated correctly for +line-wrapping. + \subsection{Extensions to whole-program, whole-library optimization (9.3.1, 9.3.4)} \scheme{compile-whole-program} now supports incomplete @@ -1428,7 +1446,26 @@ in fasl files does not generally make sense. %----------------------------------------------------------------------------- \section{Bug Fixes}\label{section:bugfixes} -\subsection{Compiler error: leaked or unexpected \protect\scheme{cpvalid-defer} form (9.4.1)} +\subsection{Incorrect code for certain nested \protect\scheme{if} patterns (9.4.1)} + +A bug in the source optimizer that produced incorrect code for certain +nested \scheme{if} patterns has been fixed. +For example, the code generated for the following expression: + +\schemedisplay +(if (if (if (if (zero? (a)) #f #t) (begin (b) #t) #f) + (c) + #f) + (x) + (y)) +\endschemedisplay + +inappropriately evaluated the subexpression \scheme{(b)} when the +subexpression \scheme{(a)} evaluates to 0 and not when \scheme{(a)} +evaluates to 1. +[This bug dated back to Version 9.0.] + +\subsection{Leaked or unexpected \protect\scheme{cpvalid-defer} form (9.4.1)} A bug in the pass of the compiler that inserts valid checks for \scheme{letrec} and \scheme{letrec*} bindings has been fixed. @@ -1475,18 +1512,17 @@ zone-offset field. \subsection{\protect\scheme{wchar} and \protect\scheme{wchar_t} record field types fail to inline in Windows (9.4)} -On Windows, the inliner has been fixed to handle \scheme{wchar} and +On Windows, the source optimizer has been fixed to handle \scheme{wchar} and \scheme{wchar_t} record field types. \subsection{path-related procedures cause invalid memory reference with non-string arguments in Windows (9.4)} On Windows, the path-related procedures now raise an appropriate exception when the path argument is not a string. -\subsection{Internal mutex structure not always thread safe (9.4)} +\subsection{Mutex acquisition bug (9.4)} -The internal mutex structure now has its fields marked -\scheme{volatile} so that the C compiler does not reorder assignments -to these fields. +A bug in the handling of mutexes has been fixed. +The bug typically presented as a spurious ``recursively locked'' exception. \subsection{\protect\scheme{dynamic-wind} mistakenly enabling interrupts (9.3.3)}