added or/c as alias for union

svn: r2059
This commit is contained in:
Robby Findler 2006-01-31 16:29:12 +00:00
parent 55e361dad4
commit c43a6f2821

View File

@ -675,7 +675,7 @@ add struct contracts for immutable structs?
(provide anaphoric-contracts
flat-rec-contract
flat-murec-contract
union
or/c union
not/c
=/c >=/c <=/c </c >/c
integer-in
@ -769,7 +769,24 @@ add struct contracts for immutable structs?
(lambda (v)
(hash-table-get ht v (lambda () #f))))))
(define (union . args)
(define-syntax (union stx)
(begin
#;
(fprintf (current-error-port)
"WARNING: union is deprecated, use or/c (file ~a~a)\n"
(let ([file (syntax-source stx)])
(if (path? file)
(path->string file)
(format "~s" file)))
(let ([line (syntax-line stx)])
(if (number? line)
(format ", line ~a" line)
"")))
(syntax-case stx ()
[(_ args ...) (syntax (or/c args ...))]
[id (syntax or/c)])))
(define (or/c . args)
(for-each
(lambda (x)
(unless (or (contract? x)