Compare commits
3 Commits
master
...
dev-top-in
Author | SHA1 | Date |
---|---|---|
Matthew Butterick | 74c8913be9 | 6 years ago |
Matthew Butterick | fc74af114f | 6 years ago |
Matthew Butterick | 0c0a78606f | 6 years ago |
@ -1 +1 @@
|
||||
1542295809
|
||||
1542679573
|
||||
|
@ -1,11 +1,16 @@
|
||||
#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)))
|
||||
|
||||
(define-syntax-rule (top~ . ID)
|
||||
(#%app make-default-tag-function 'ID))
|
||||
(define-syntax (top~ stx)
|
||||
(syntax-case stx ()
|
||||
[(_ . ID)
|
||||
(setup:allow-unbound-ids)
|
||||
#'(#%app make-default-tag-function 'ID)]
|
||||
[(_ . ID)
|
||||
#'(def/c ID)]))
|
||||
|
||||
(define-syntax (def/c stx)
|
||||
(syntax-case stx ()
|
||||
[(_ X) (identifier-binding #'X) #'X]
|
||||
[(_ X) #'(#%top . X)]))
|
||||
[(_ ID) (identifier-binding #'ID) #'ID]
|
||||
[(_ ID) #'(#%top . ID)]))
|
Loading…
Reference in New Issue