[plt-scheme] identifier binding to undefined identifier
The docs say identifier-binding returns #f is the binding is a top-level
binding but what if there is no binding at all?
;; (define y 2)
(define-syntax (bar stx)
(syntax-case stx ()
((_ id)
(begin
(printf "binding at ~a\n" (identifier-binding #'id))
#'id))))
(define-syntax foo
(syntax-rules ()
((_) (let ((x 1))
(bar y)))))
(foo)
This program prints "binding at #f" when (define y 2) is uncommented or
not. What is the rationale for this? It seems more logical to return
'top-level if the identifier is bound at the top-level.