racket/racket/lib/collects/mzscheme/private/old-if.rkt
Sam Tobin-Hochstadt d54c1e4e49 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.
2013-07-01 12:08:42 -04:00

33 lines
934 B
Racket

(module old-if '#%kernel
(#%require (for-syntax '#%kernel))
(#%provide if*)
(define-syntaxes (if*)
(lambda (stx)
(let-values ([(if-stx) (quote-syntax if)])
(if (pair? (syntax-e stx))
(let-values ([(l) (syntax->list stx)])
(if (if l
(if (= (length l) 3)
#t
#f)
#f)
(datum->syntax
stx
(list if-stx
(cadr l)
(caddr l)
(quote-syntax (void)))
stx
stx)
(datum->syntax
stx
(cons if-stx
(cdr (syntax-e stx)))
stx
stx)))
(datum->syntax
if-stx
'if
stx))))))