guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Damien Mattei
Subject: Re: with-syntax return error in Guile, not in Kawa or Racket
Date: Thu, 9 May 2024 23:56:08 +0200

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 <maximedevos@telenet.be> 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
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]