Re: define-library-alias Marc Nieper-Wißkirchen 26 Sep 2020 21:22 UTC

Am Sa., 26. Sept. 2020 um 23:11 Uhr schrieb Jim Rees <xxxxxx@gmail.com>:
>>
>> #,> (define x 1)
>> #,> (import (srfi 211 syntax-case))
>> #,> (free-identifier=? #'x (datum->syntax #'public 'x))
>>
>> This last example shows that the syntactic environment of the
>> *imported* identifier public is the one of the importing
>> library/module.
>
>
> I don't see that.
>
> Provided neither x nor public are bound as pattern variables, that last line is always true regardless of what has or hasn't been imported or defined.

Neglecting the case that any of the identifiers is unbound,
free-identifier=? compares the labels of the identifiers that are
resolved by applying all the substitutions. My point is that if the
identifier #'public *were* the same (including its set of
substitutions) as the top-level identifier with the same name inside
the test library, (datum->syntax #'public x) would carry the
substitutions of the top-level environment of the library and not of
interactive environment of the REPL.

(Or is it already too late for me and have I just produced another brain fart?)