From c43a6f2821c7a8520fcec23e3f6dac16f8094d86 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 31 Jan 2006 16:29:12 +0000 Subject: [PATCH] added or/c as alias for union svn: r2059 --- collects/mzlib/private/contract.ss | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/collects/mzlib/private/contract.ss b/collects/mzlib/private/contract.ss index 8108de6744..233cf8e1fa 100644 --- a/collects/mzlib/private/contract.ss +++ b/collects/mzlib/private/contract.ss @@ -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 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)