From 7e3a21ba6fef06da9aed8f4bf299335bbe1946fd Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Thu, 30 Mar 2017 19:01:56 -0400 Subject: [PATCH] extends form supports non-strs and allows explicit prefix --- macrotypes/typecheck.rkt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/macrotypes/typecheck.rkt b/macrotypes/typecheck.rkt index e8c15a3..bbd95e7 100644 --- a/macrotypes/typecheck.rkt +++ b/macrotypes/typecheck.rkt @@ -104,15 +104,19 @@ (define-syntax extends (syntax-parser [(_ base-lang + (~optional (~seq #:prefix pre)) (~optional (~seq #:except (~and x:id (~not _:keyword)) ...) #:defaults ([(x 1) null])) (~optional (~seq #:rename [old new] ...) #:defaults ([(old 1) null][(new 1) null]))) #:with pre: + (or + (attribute pre) (let ([pre (or (let ([dat (syntax-e #'base-lang)]) - (and (string? dat) (extract-filename dat))) + (and (or (string? dat) (symbol? dat)) + (extract-filename dat))) #'base-lang)]) - (format-id #'base-lang "~a:" pre)) + (format-id #'base-lang "~a:" pre))) #:with internal-pre (generate-temporary) #:with non-excluded-imports #'(except-in base-lang x ... old ...) #:with conflicted? #'(λ (n) (member (string->symbol n) '(#%app λ #%datum begin let let* letrec if define)))