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: Jean Abou Samra
Subject: Re: with-syntax return error in Guile, not in Kawa or Racket
Date: Sat, 11 May 2024 21:14:39 +0200
User-agent: Evolution 3.52.1 (3.52.1-1.fc40)

> the problem when pre-compiling/pre-computing those lists is that with #' ,
> i mean syntax, the optimizer-parse-square-brackets-arguments-lister no
> more receiveĀ  lists but this sort of expression:
> 
> scheme@(guile-user)> (define T (make-vector 7))
> scheme@(guile-user)> {T[2 + 1] <- 7}
> <- : #'(index ...) = (#<syntax:unknown file:3:3 2> #<syntax:unknown file:3:5 
> +> #<syntax:unknown file:3:7 1>)
> <- : (syntax->datum #'(index ...)) = (2 + 1)
> optimizer-parse-square-brackets-arguments-lister : 
> args-brackets=(#<syntax:unknown file:3:3 2> #<syntax:unknown file:3:5 +> 
> #<syntax:unknown file:3:7 1>)

Yes, these are wrapped syntax objects.

> my question is how to deal with that?

There are a variety of tools to work with syntax objects, just like
there are tools to work with lists. Among them: syntax (#'),
quasisyntax (#`), unsyntax (#,), unsyntax-splicing (#,@),
identifier?, free-identifier=?, bound-identifier=?, and of
course syntax-case.

> becaue in the parser i check ,for example for + being '+ not some sort of 
> #<syntax:unknown file:3:5 +> 
> i suppose the problem come from here 
> should i modify the parser to check for #'+ #'- #'* #'/ #'expt #'and #'or 
> etc... or is there something to do when i pass arguments in the macro?

Use (free-identifier=? the-identifier #'+)

> also i pass #'(index ...) creating a sort of ( ) list ,how to pass th index 
> and ellipsis in a syntax form ?? should i put that in a list with list 
> procedure?

#'(index ...) is a traditional list (not a wrapped syntax object), so you
can work with it directly (its elements are wrapped syntax objects).



Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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