var syntax Felix Thibault (21 Jan 2021 14:50 UTC)
Re: var syntax Marc Nieper-Wißkirchen (21 Jan 2021 15:06 UTC)
(missing)
(missing)
Fwd: var syntax Felix Thibault (21 Jan 2021 15:37 UTC)
Re: var syntax Marc Nieper-Wißkirchen (21 Jan 2021 15:57 UTC)
Re: var syntax Felix Thibault (21 Jan 2021 16:31 UTC)
Re: var syntax Marc Nieper-Wißkirchen (22 Jan 2021 12:58 UTC)
Re: var syntax Felix Thibault (22 Jan 2021 23:34 UTC)
Re: var syntax John Cowan (23 Jan 2021 06:02 UTC)
Re: var syntax Marc Nieper-Wißkirchen (23 Jan 2021 09:03 UTC)
Re: var syntax Felix Thibault (23 Jan 2021 14:22 UTC)
Re: var syntax Marc Nieper-Wißkirchen (23 Jan 2021 14:41 UTC)
(missing)
Fwd: var syntax Felix Thibault (25 Jan 2021 10:52 UTC)

Fwd: var syntax Felix Thibault 21 Jan 2021 15:37 UTC

---------- Forwarded message ---------
From: Felix Thibault <xxxxxx@gmail.com>
Date: Thu, Jan 21, 2021 at 10:36 AM
Subject: Re: var syntax
To: Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de>

On Thu, Jan 21, 2021 at 10:29 AM Felix Thibault <xxxxxx@gmail.com> wrote:
>
> On Thu, Jan 21, 2021 at 10:06 AM Marc Nieper-Wißkirchen
> <xxxxxx@nieper-wisskirchen.de> wrote:
> >
> > Am Do., 21. Jan. 2021 um 15:50 Uhr schrieb Felix Thibault <xxxxxx@gmail.com>:
> >>
> >> There are a few issues I want to work out with the var syntax:
> >> 1. is there a better name (like hide or wrap) that will describe it's function but is less likely to clash with existing code?
> >
> >
> > Racket uses "var" for this purpose. As the feature would be compatible, I wouldn't invent a new name but would stick to the established keyword.
> >
> >>
> >> 2. It works better inside macros (which I think was its intended purpose) but I don't think it's acceptable for ((var var) (var var)) to match '(1 (1 1)) and not '(1 1) outside of macros.
> >
> >
> > What do you mean by inside/outside of macros?
> >
> > If `var` is bound late (which I still think it should be) and non-linear patterns are allowed, the correct match would always be '(1 1), wouldn't it?
>
>
> This macro:

This was supposed to say this test

>
> (test 1 (match '(1 1) (((var syn) (var syn)) syn)))
>
> where syn is one of the operators fails when syn is var. On the other hand:
>
> (let-syntax ((test-var (syntax-rules ()
>                                    ((test-var syn ...)
>                                      (begin (test-equal
>                                                    (string-append "var
> " (symbol->string 'syn) " in macro")
>                                                    1
>                                                    (match '(1 1)
> (((var syn) (var syn)) syn)
>
>  (_ 'fail)))
>                                                 ...)))))
>   (test-var ...  =.. *.. **1 _ quote $ struct @ object =
>     and or not ? set! get! quasiquote ___ unquote
>     unquote-splicing var))
>
> passes all tests, except in Gauche, where I have to comment out the ellipsis.