Re: with-syntax return error in Guile, not in Kawa or Racket

Damien Mattei <[email protected]>
Newsgroups gmane.lisp.guile.user
Message-ID <CADEOadeAkpU5q9iN1p8KBcs1RdE80BqjJuAponSq2UYEapeeLg@mail.gmail.com>
it worked now removing the syntax->datum but not in all programs , i do not
know why, program it fails was overloading some operator so i think the
syntax symbol of operator was not correlated with the good function
overloaded. So i keep the code as is.
for the cloned macro i did not succeed in other solution than duplicating
the macro and replace <- by ←, stupid but it works now in all codes.
In fact it is a general question, how to clone a macro? for a procedure it
is more simple.

a solution which does not worked:

(define-syntax ←

   (syntax-rules ()

     ((_ ( ) expr) (<- ( ) expr))

     ((_ (var) expr) (<- (var) expr))

     ((_ (brket-applynext container index ...) expr) (<- (brket-applynext
container index ...) expr))

     ((_ var expr) (<- var expr))

     ((_ var var1 ... expr) (<- var var1 ... expr))))

notice that for each case the expression is the same as the left pattern.
i hoped it should clone all the case of the original macro but it fails too

i have no explaination

On Thu, May 9, 2024 at 11:21 AM Maxime Devos <[email protected]> wrote:

> >do you mean just replacing 'list by #'list ?
>
>
>
> No, I mean doing that, _and_ doing the same inside this
> optimizer-parse-square-brackets-arguments-lister procedure and removing the
> syntax->datum used here.
>
>
>
> I don’t know parse-square-brackets-arguments-lister so maybe it’s not
> necessary here (e.g. if the code it produces doesn’t contain any
> identifiers), but going by the name of it, it probably is.
>
>
>
> > another strange thing perheaps related to macro is that the compile
> warns me always that the optimizer-parse-square-brackets-arguments-lister
> procedure is not found:
>
>
>
> See eval-when. It’s mentioned somewhere in the documentation of macros,
> perhaps close to eval-when.
>
>
>
> Best regards,
>
> Maxime DEvos
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.