I'm considering of porting to guile this paragraph (Transform!)
ans when I reach 3.3 I can't reproduce the reversion of an expression
Maybe I can try something tonight.
(If only I had Guile on my Android phone...)
The eval call smells bad to me haha
((reverse-me args args* ...)
(eval (reverse (list args args* ... values)) (interaction-environment)))))
What's with interaction-environment ?
Well I'll investigate tomorrow
Thanks ! 🙂
@AbbieNormal Don't know, I picked it up from the Guile ref haha
Can you please point me where exactly ?
this solutions does work, I guess, but I'm afraid it's not idiomatic Guile or Scheme
Do you really need to involve environments and eval to reverse an expression ?
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 👍
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
(reverse (syntax stx))
@AbbieNormal I can't make it to work in my REPL 😕
I call i tlike this
(reverse-me ("mom!" "hi"))
it's a bit naive, admittedly 😐
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.
Le réseau social de l'avenir : Pas d'annonces, pas de surveillance institutionnelle, conception éthique et décentralisation ! Possédez vos données avec Mastodon !