What I'm thinking is that define-auxiliary-syntax creates a binding in the srfi.207 module and then imports it to the current module (with the same mechanism as renaming import).

Actually, is there a case that the difference between 'defining a syntactic binding' and 'importing a binding' matter?  Internally they are different in Gauche, and there are edge cases that can reveal the difference, but as far as the code is valid in R7RS and srifs I suppose there's no difference.


On Tue, Oct 13, 2020 at 11:00 PM Marc Nieper-Wißkirchen <xxxxxx@gmail.com> wrote:
Am Mi., 14. Okt. 2020 um 10:53 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:
>
> On Tue, Oct 13, 2020 at 10:46 PM Marc Nieper-Wißkirchen <xxxxxx@gmail.com> wrote:
>>
>>
>> How does Gauche implement "free-identifier=?"?
>
>
> We have an internal object that represents a binding.  Two identifiers resolve to the same binding, or both resolves to no binding, returns #t for free-identifier=?.

So I think to implement define-auxiliary-syntax you need a
distinguished type of binding that is only parameterized by the name,
a symbol, right?

E.g.: (same-binding? (auxiliary-syntax-binding 'foo)
(auxiliary-syntax-binding 'foo)) => #t where
"auxiliary-syntax-binding" is a procedure return this type of binding.