bound/c test

pull/9/head
Matthew Butterick 11 years ago
parent f7f5a10694
commit 02e9f5cf4f

@ -0,0 +1,13 @@
#lang racket
(provide bound/c (rename-out (top~ #%top)))
(define-syntax-rule (top~ . id)
(λ x `(id ,@x)))
(define-syntax (bound/c stx)
(syntax-case stx ()
[(_ x)
(if (identifier-binding #'x )
#'x
#'(#%top . x))]))

@ -0,0 +1,5 @@
#lang racket
(require "bound.rkt")
(bar "hello") ; bar is unbound
((bound/c bar) "hello")
Loading…
Cancel
Save