Recursive Macros generating Definitions

2022-10-03 Thread Frank Terbeck
Good day, good people! There might be a bug in recursive macro expansion, at least when the definition of parameters, using (define …) and similar is involved. Here is a slightly simplified example. The purpose of this macro is to define a couple of short-hands for a generic encoder/decod

Re: Recursive Macros generating Definitions

2022-10-03 Thread Maxime Devos
On 03-10-2022 13:32, Frank Terbeck wrote: When looking at this, I also saw the following, which might be related if ‘syntax-rules’ is implemented using ‘syntax-case’ It is, IIRC. (I didn't check if this is the case): (define-syntax-rule (foobar n) (define quux n)) ,exp (foobar

Re: Recursive Macros generating Definitions

2022-10-03 Thread Frank Terbeck
Hey Maxime! Maxime Devos wrote: > On 03-10-2022 13:32, Frank Terbeck wrote: >> When looking at this, I also saw the following, which might be related >> if ‘syntax-rules’ is implemented using ‘syntax-case’ > > It is, IIRC. > >> (I didn't check if >> this is the case): >> (define-syntax-rul

Re: Recursive Macros generating Definitions

2022-10-03 Thread Jean Abou Samra
Le 03/10/2022 à 15:41, Frank Terbeck a écrit : I get the point, but I think it's sort of surprising, when everything in the macro-language is otherwise quite literal, to my understanding. It may be warranted to point this out in the documentation that this is a side effect of hygienic macr

Re: Recursive Macros generating Definitions

2022-10-03 Thread Frank Terbeck
Hey! Jean Abou Samra wrote: > Le 03/10/2022 à 15:41, Frank Terbeck a écrit : >> I get the point, but I think it's sort of surprising, when everything in >> the macro-language is otherwise quite literal, to my understanding. It >> may be warranted to point this out in the documentation that thi