From 4dcb1230b895ba5dd896eb069c6ffebec05aa972 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Fri, 15 Aug 2014 16:21:58 -0400 Subject: [PATCH] stlc: add extensibility note in define-type --- stlc.rkt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stlc.rkt b/stlc.rkt index ba7defa..ab9b7a1 100644 --- a/stlc.rkt +++ b/stlc.rkt @@ -201,6 +201,15 @@ (begin-for-syntax + ;; EXTENSIBILITY NOTE: + ;; Originally, define-type was a #:literal instead of a #:datum-literal, but + ;; this became a problem when sysf extended define-type (but not modul-begin). + ;; Putting define-type in the #:literals list makes it always expect the stlc + ;; version of define-type, so it wasnt getting properly parsed in sysf. + ;; + ;; Similarly, I had to define the define-type pattern below to avoid explicitly + ;; mentioning define-type on the rhs, otherwise it would again lock in the stlc + ;; version of define-type. (define-syntax-class maybe-def #:datum-literals (: define variant define-type) (pattern (define (f:id [x:id : τx] ...) body ...) #:with τ_result (generate-temporary #'f)