so how would I wrote a macro that reverses an expression using sysntax rules only in #guile ?
@AbbieNormal
Can you provide an example of what you are looking for?
I'm considering of porting to guile this paragraph (Transform!)
https://www.greghendershott.com/fear-of-macros/Transform_.html
ans when I reach 3.3 I can't reproduce the reversion of an expression
@AbbieNormal
Maybe I can try something tonight.
(If only I had Guile on my Android phone...)
in fact I think I got it 👀
I'm not sure this is what I wanted, as I'm a bit confused now
But this seems to do the job
(define-syntax-rule
(reverse-me stx)
(reverse (syntax stx))
@AbbieNormal I can't make it to work in my REPL 😕
the thing is I'm reading that Racket tutorial and parallely also the Guile manual
But the mismatches are more and wider than I thought
there were some misunderstandings on my side
Now, I think I mapped most of the Racket tutorial on Guile things
Notably, the Racket tutorial doesn't treat syntax-rules because Racket hasn't them
It jumps durectly to syntax-case
And the define-syntax-rule in Racket is for syntax-case, in Guile is for syntax-rules, as far as I understand
ah, it's 2 different chapters in the official documentation, good to know
But I was referring to this tutorial
> It’s called syntax-case, and has a shorthand for simple situations called define-syntax-rule.
Oh, I see. The author forgot the intermediate step: syntax-rules is a shorthand of syntax-case for simple (the vast majority of) situations, and define-syntax-rule is for the simplest case of syntax-rules.
@AbbieNormal
Haha there are surely other ways. I don't really know what idiomatic means.
I just hacked in the REPL for 10 minutes. Trying to get the same output as the exercise example 👍