add `allow-unbound-ids` (partially resolves #183)
parent
69df80d115
commit
78aefc7c1f
@ -1 +1 @@
|
|||||||
1542295809
|
1542696684
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require (for-syntax racket/base) pollen/tag)
|
(require (for-syntax racket/base pollen/setup) pollen/tag)
|
||||||
(provide def/c (rename-out (top~ #%top)))
|
(provide def/c (rename-out (top~ #%top)))
|
||||||
|
|
||||||
(define-syntax-rule (top~ . ID)
|
(define-syntax (top~ stx)
|
||||||
(#%app make-default-tag-function 'ID))
|
(syntax-case stx ()
|
||||||
|
[(_ . ID)
|
||||||
|
(setup:allow-unbound-ids)
|
||||||
|
#'(#%app make-default-tag-function 'ID)]
|
||||||
|
[(_ . ID)
|
||||||
|
#'(def/c ID)]))
|
||||||
|
|
||||||
(define-syntax (def/c stx)
|
(define-syntax (def/c stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ X) (identifier-binding #'X) #'X]
|
[(_ ID) (identifier-binding #'ID) #'ID]
|
||||||
[(_ X) #'(#%top . X)]))
|
[(_ ID) #'(#%top . ID)]))
|
Loading…
Reference in New Issue