Good questions!
> The 'unbound' case is interesting, and leads me to ask the question -- what's supposed to happen here?
>
> (let ((x 0))
> (alias x y)
> x)
This is an error (assume that `y' was unbound.
> Does an alias to an unbound identifier "hide" a surrounding binding?
>
> If not, then (alias x y) is a no-op. If so, it makes for an interesting new tool for locally turning-off identifiers.
Exactly. If you want to make sure that a block of your code doesn't
use a specific identifier, you can define
(define-syntax forget
(syntax-rules ()
((forget id) (alias id unbound-identifier))))
in a module, in which `unbound-identifier' is unbound.
And then you can say
(forget x)
to make sure `x' is unbound.
> And 2nd question -- w.r.t. to free-identifier=?, what's the name of an alias to an unbound identifier? It's own name, or the name of the original source id?
The name of an identifier is a property of the identifier, not of its
binding. In particular, syntax->datum won't return the name of the
other identifier.
> ;; pre-conditions: x and y are not bound
>
> (define (is-x? id) (free-identifier=? id #'x))
>
> (let ()
> (alias x y)
> (is-x? x))
This should return `#f' (after adding (syntax ...) as you wrote in
your next email).