Re: In favor of explicit argument Marc Nieper-Wißkirchen (16 Aug 2020 07:55 UTC)
Re: In favor of explicit argument Jim Rees (18 Aug 2020 15:02 UTC)
Re: In favor of explicit argument Marc Nieper-Wißkirchen (18 Aug 2020 15:46 UTC)
Re: In favor of explicit argument Jim Rees (18 Aug 2020 20:21 UTC)
Re: In favor of explicit argument Marc Nieper-Wißkirchen (18 Aug 2020 20:36 UTC)
Re: In favor of explicit argument Alex Shinn (19 Aug 2020 03:38 UTC)
Explicit "define-auxiliary-syntax" Marc Nieper-Wißkirchen (19 Aug 2020 05:59 UTC)
Re: Explicit "define-auxiliary-syntax" Alex Shinn (19 Aug 2020 06:23 UTC)
Re: Explicit "define-auxiliary-syntax" Marc Nieper-Wißkirchen (19 Aug 2020 07:02 UTC)
Re: Explicit "define-auxiliary-syntax" Alex Shinn (21 Aug 2020 14:01 UTC)
Re: Explicit "define-auxiliary-syntax" Marc Nieper-Wißkirchen (24 Aug 2020 15:19 UTC)

Re: Explicit "define-auxiliary-syntax" Marc Nieper-Wißkirchen 24 Aug 2020 15:18 UTC

Am Fr., 21. Aug. 2020 um 16:01 Uhr schrieb Alex Shinn <xxxxxx@gmail.com>:

> Yes, this is a perennial danger.  That doesn't mean we should throw up our hands
> and stop trying to write portable code.  And it certainly doesn't mean we should
> encourage features which make otherwise portable code unportable.

Agreed. While no part of SRFI 206 is implementable portably at all,
the poor man's version is. Thus the use of the "magic" library should
be encouraged if in doubt and I will add such language to the SRFI.
(For the few cases where one really needs "define-auxiliary-syntax",
R7RS-portable code is not possible anyway, so in these cases, it
doesn't matter.)

>> My use case is the following one:
>>
>> Given (call/kw-symbolic foo key1 val1 key2 val2), where key1 and key2 are (possibly) unbound symbols, rewrite this into (call/kw-hygienic foo %key1 val1 %key2 val2) where %key1 and %key2 are auxiliary syntax corresponding with the names key1 and key2, respectively.
>>
>> For adapters between different keyword argument models as discussing on the mailing list of SRFI 177, we want a macro that does this rewrite. The macro, however, cannot know the set of all keywords in advance.

> It doesn't need to.  It doesn't matter what %key1 and %key2 are bound to, or if they are bound at all.
> They will still match in a local keyword definition and its uses.  That's why R5RS never had nor needed
> auxiliary syntax.  The only conflict occurs when you have separate modules, and R5RS had no modules.

I am still not sure whether we are talking about the same thing here
(maybe it is just me and I am stuck).

In the above example, the rewriting macro (which I haven't given a
name) does not have access to the lexical environment of the macro
definition of "foo". The definition of "foo" has the global auxiliary
keyword bindings of key1 and key2 (in the sense of the "magic"
library) in scope. This is not the case for the rewriting macro. Only
when instantiated, it knows the symbolic names of the needed auxiliary
keyword bindings (namely 'key1 and 'key2), which it then has to
generate somehow on the fly. For that, define-auxiliary-syntax can be
used.