Hi all,<br><br>Still having difficulties with (hygienic) macros...<br><br>I have the following (simplified) code :<br><br>(define (f1 x)<br> (let ([y (foo x)])<br> (bar x y y)<br> (plop y x y)<br> (baz x y)))<br>
<br>(define (f2 x)<br> (let ([y (foo x)])<br> (baz x y)))<br><br>As I dislike code repetitions, I want to make a macro that could generate either f1 or f2 or any function that has a body between the `let' and the `(baz'.<br>
I want the generated code to be as fast as without using macro. This (as I understand it) is the case for `define-syntax' et al.<br><br>Since `bar' has some arguments that are defined inside the function, my first (probably bad) guess was to use an unhygienic macro with `define-macro'. That was simple and worked. However my code was quite slower so I suspect the transformation is not syntactic but is rather done on the fly with an eval. And I don't want to be beaten to death by hygienic macro programmers either.<br>
<br>So what is the correct way to (generically) compress this code without losing run-time, i.e. to have a syntactical transformation?<br>Is it possible to define an hygienic macro without loss of genericity?<br>Is there a hygienic macro programming style that I could automatically use?<br>
<br>Thanks,<br>Laurent<br><br><br>