From b4d5c710b396ccd1499e0b61d93a108a04a1d493 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Mon, 31 Oct 2016 15:34:44 -0400 Subject: [PATCH] use current-host-lang in define-primop and typed-out --- macrotypes/typecheck.rkt | 5 +++-- turnstile/examples/mlish+adhoc.rkt | 3 ++- turnstile/examples/mlish.rkt | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/macrotypes/typecheck.rkt b/macrotypes/typecheck.rkt index a01ec03..81aeac6 100644 --- a/macrotypes/typecheck.rkt +++ b/macrotypes/typecheck.rkt @@ -721,7 +721,8 @@ (lambda (stx modes) (syntax-parse stx #:datum-literals (:) ;; cannot write ty:type bc provides might precede type def - [(_ (~and (~or (~and [out-x:id (~optional :) ty] (~parse x #'out-x)) + [(_ (~and (~or (~and [out-x:id (~optional :) ty] + (~parse x ((current-host-lang) #'out-x))) [[x:id (~optional :) ty] out-x:id])) ...) #:with (x/tc ...) (generate-temporaries #'(x ...)) #:when (stx-map @@ -735,7 +736,7 @@ (define-syntax define-primop (syntax-parser #:datum-literals (:) [(define-primop op:id (~optional :) τ) - #:with op- (format-id #'op "~a-" #'op) + #:with op- ((current-host-lang) #'op) #'(define-primop op op- τ)] [(define-primop op/tc:id (~optional #:as) op:id (~optional :) τ:type) ; rename-transformer doesnt seem to expand at the right time diff --git a/turnstile/examples/mlish+adhoc.rkt b/turnstile/examples/mlish+adhoc.rkt index 7665d48..8efa6f9 100644 --- a/turnstile/examples/mlish+adhoc.rkt +++ b/turnstile/examples/mlish+adhoc.rkt @@ -1,5 +1,6 @@ #lang turnstile -(require racket/fixnum racket/flonum) +(require (postfix-in - racket/fixnum) + (postfix-in - racket/flonum)) (extends "ext-stlc.rkt" diff --git a/turnstile/examples/mlish.rkt b/turnstile/examples/mlish.rkt index b134612..24e0c91 100644 --- a/turnstile/examples/mlish.rkt +++ b/turnstile/examples/mlish.rkt @@ -1,6 +1,7 @@ #lang turnstile/lang (require - racket/fixnum racket/flonum + (postfix-in - racket/fixnum) + (postfix-in - racket/flonum) (for-syntax macrotypes/type-constraints macrotypes/variance-constraints)) (extends