From 3881680c9563404af781ba064c4bd3e398e19c9a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 4 Aug 2005 04:18:37 +0000 Subject: [PATCH] drscheme shares pconvert-prop.ss, EOPL uses it to change constructor printing svn: r545 --- collects/drscheme/private/eval.ss | 3 ++- collects/eopl/datatype.ss | 5 ++++- collects/eopl/doc.txt | 9 +++++---- notes/mzscheme/HISTORY | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/collects/drscheme/private/eval.ss b/collects/drscheme/private/eval.ss index f81971274f..47a11a3ec6 100644 --- a/collects/drscheme/private/eval.ss +++ b/collects/drscheme/private/eval.ss @@ -174,7 +174,8 @@ (list 'mzscheme '(lib "foreign.ss") '(lib "mred.ss" "mred") - '(lib "cache-image-snip.ss" "mrlib"))) + '(lib "cache-image-snip.ss" "mrlib") + '(lib "pconvert-prop.ss"))) ;; ensure that they are all here. (for-each (λ (x) (dynamic-require x #f)) to-be-copied-module-specs) diff --git a/collects/eopl/datatype.ss b/collects/eopl/datatype.ss index 6e7d2f6071..ab1b8fc559 100644 --- a/collects/eopl/datatype.ss +++ b/collects/eopl/datatype.ss @@ -4,6 +4,7 @@ (module datatype mzscheme + (require (lib "pconvert-prop.ss")) (require-for-syntax "private/utils.ss") (define-syntax define-datatype @@ -100,7 +101,9 @@ (let-values ([(struct:variant make-variant variant? variant-accessor variant-mutator) (make-struct-type 'variant-name struct:x variant-field-count 0 - #f null (make-inspector))] + #f + `((,prop:print-convert-constructor-name . variant-name)) + (make-inspector))] ...) ;; User-available functions: (values diff --git a/collects/eopl/doc.txt b/collects/eopl/doc.txt index 896406dbbd..62c111124b 100644 --- a/collects/eopl/doc.txt +++ b/collects/eopl/doc.txt @@ -34,10 +34,11 @@ Differences from the book: as the variant's `field-id's, and each argument is checked by applying the function produced by the variant's `predicate-expr'. - When constructor-based printing is used in DrScheme, variant - instances are printed with a `make-' prefix before the variant name. - Thus, in addition to `variant-id', `make-variant-id' is also defined - for each `variant-id' (to the same constructor as `variant-id'). + In DrScheme v209 and older, when constructor-based printing was + used, variant instances were printed with a `make-' prefix before + the variant name. Thus, for compatibility, in addition to + `variant-id', `make-variant-id' is also defined for each + `variant-id' (to the same constructor as `variant-id'). > (cases datatype-id expr (variant-id (field-id ...) result-expr ...) ...) > (cases datatype-id expr (variant-id (field-id ...) result-expr ...) ... (else result-expr ...)) diff --git a/notes/mzscheme/HISTORY b/notes/mzscheme/HISTORY index 3a9f0b1f1e..f220666799 100644 --- a/notes/mzscheme/HISTORY +++ b/notes/mzscheme/HISTORY @@ -68,7 +68,7 @@ Libraries: to return an alist of bytes, not strings Misc: Cygwin build produces a Unix-style installation instead of - a Windows-style installation (e.g., system-type is 'unix) + a Windows-style installation (e.g., system-type is 'unix) Version 299.100, March 2005 >> See MzScheme_300.txt for information on major changes since