drscheme shares pconvert-prop.ss, EOPL uses it to change constructor printing

svn: r545
This commit is contained in:
Matthew Flatt 2005-08-04 04:18:37 +00:00
parent e08138d97c
commit 3881680c95
4 changed files with 12 additions and 7 deletions

View File

@ -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)

View File

@ -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

View File

@ -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 ...))

View File

@ -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