compatibility/racket/lib/collects/mzscheme/private/old-ds.rkt
Sam Tobin-Hochstadt b0043b013b Remove most uses of mzscheme in the core.
Remaining are:
 - parts of unit200 that Matthew plans to remove.
 - the `mzscheme` implementation itself.

The implementation of `mzscheme` has been moved
to the `mzscheme` collection (from the `racket` and
`scheme` collections). The `scheme/mzscheme`
language, which was undocumented, has been removed.

This is slightly backwards-incompatible, because
the `xform` handling of precompiled headers now
evaluates code in a `racket/base`-like namespace,
instead of in a `mzscheme`-like namespace.

original commit: d54c1e4e4942c26dcbaaebcc43d5c92d507a8112
2013-07-01 12:08:42 -04:00

34 lines
1.1 KiB
Racket

(module old-ds '#%kernel
(#%require racket/private/define-struct
(for-syntax '#%kernel
racket/private/stxcase-scheme))
(#%provide define-struct let-struct old-datum)
(define-syntaxes (define-struct)
(lambda (stx)
(with-syntax ([orig stx])
(syntax-case stx ()
[(_ base (field ...))
#'(define-struct/derived orig base (field ...) #:mutable)]
[(_ base (field ...) insp)
(with-syntax ([insp
(if (keyword? (syntax-e #'insp))
(datum->syntax #'insp
(cons '#%datum #'insp)
#'insp)
#'insp)])
#'(define-struct/derived orig base (field ...) #:mutable #:inspector insp))]))))
(define-syntaxes (let-struct)
(syntax-rules ()
[(_ base (field ...) body1 body ...)
(let-values ()
(define-struct base (field ...))
body1 body ...)]))
(define-syntaxes (old-datum)
(syntax-rules ()
[(_ . any) (quote any)])))