stlc: add extensibility note in define-type

This commit is contained in:
Stephen Chang 2014-08-15 16:21:58 -04:00
parent caeda2ff0d
commit 4dcb1230b8

View File

@ -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)