You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pollen/pollen/top.rkt

16 lines
417 B
Racket

#lang racket/base
6 years ago
(require (for-syntax racket/base pollen/setup) pollen/tag)
(provide def/c (rename-out (top~ #%top)))
10 years ago
6 years ago
(define-syntax (top~ stx)
(syntax-case stx ()
[(_ . ID)
6 years ago
(setup:allow-unbound-ids)
#'(#%app make-default-tag-function 'ID)]
6 years ago
[(_ . ID)
6 years ago
#'(def/c ID)]))
10 years ago
(define-syntax (def/c stx)
(syntax-case stx ()
6 years ago
[(_ ID) (identifier-binding #'ID) #'ID]
[(_ ID) #'(#%top . ID)]))