From 3a7dd428fe4e19a07426caf76cad6eb314703b6f Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 20 Jan 2005 16:33:04 +0000 Subject: [PATCH] . original commit: 58883226424b22d866dd6fd642f05431e0aee16a --- collects/mzlib/contract.ss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/collects/mzlib/contract.ss b/collects/mzlib/contract.ss index 3127811..7c8a1da 100644 --- a/collects/mzlib/contract.ss +++ b/collects/mzlib/contract.ss @@ -2989,7 +2989,17 @@ add struct contracts for immutable structs? val)) (delay (p-app (force val)))))))))) + #| + as with copy-struct in struct.ss, this first begin0 + expansion "declares" that struct/c is an expression + preventing further expansion until the internal definition + context is sorted out. + |# (define-syntax (struct/c stx) + (syntax-case stx () + [(_ . args) (syntax (begin0 (do-struct/c . args)))])) + + (define-syntax (do-struct/c stx) (syntax-case stx () [(_ struct-name args ...) (and (identifier? (syntax struct-name))