40 lines
1.0 KiB
Racket
40 lines
1.0 KiB
Racket
#lang typed/racket
|
|
|
|
(require "graph-6-rich-returns.lp2.rkt"
|
|
"../lib/low.rkt"
|
|
"graph.lp2.rkt"
|
|
"get.lp2.rkt"
|
|
"../type-expander/type-expander.lp2.rkt"
|
|
(for-syntax (submod "../type-expander/type-expander.lp2.rkt" expander))
|
|
"../type-expander/multi-id.lp2.rkt"
|
|
"structure.lp2.rkt" ; debug
|
|
"variant.lp2.rkt" ; debug
|
|
"fold-queues.lp2.rkt"; debug
|
|
"rewrite-type.lp2.rkt"; debug
|
|
"meta-struct.rkt"; debug
|
|
racket/splicing
|
|
(for-syntax syntax/parse)
|
|
(for-syntax syntax/parse/experimental/template))
|
|
|
|
(define-syntax (d-exp stx)
|
|
(syntax-case stx ()
|
|
[(_ T)
|
|
(displayln (expand-type #'T))
|
|
#'(begin (: x T)
|
|
(define x 1))]))
|
|
|
|
(define-syntax (frozen stx)
|
|
(syntax-parse stx
|
|
[(_ def a)
|
|
#'(begin
|
|
(splicing-let ()
|
|
def
|
|
(d-exp a)))]))
|
|
|
|
(define-syntax (goo stx)
|
|
(syntax-case stx ()
|
|
[(_ T)
|
|
#`(frozen (define-type-expander (#,(datum->syntax #'T #'te) stx) #'Number)
|
|
T)]))
|
|
|
|
(goo te) |