<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi,<br><br></div><div class="gmail_default" style="font-size:small">I've been meaning to try Racket for years, and finally got around to it when I found myself wanting to program a presentation, rather than laboriously copy lots of slides in a similar format.<br><br></div><div class="gmail_default" style="font-size:small">I'm using Racket 6.1.1, and I'm pretty new to Scheme.<br><br></div><div class="gmail_default" style="font-size:small">I'm trying to illustrate editing fixes in short samples of writing. The following simple code works fine:<br><br>#lang slideshow<br><br>(require slideshow/step)<br><br>(void<br> (with-steps<br> (before after)<br> (slide<br> (lt-superimpose<br> ((vonly before) (t "With"))<br> ((vonly after) (t "By"))))))<br><br></div><div class="gmail_default" style="font-size:small">First I see "With", then "By".<br><br></div><div class="gmail_default" style="font-size:small">Since I have a lot of slides like this, I want to write a macro. I tried:<br><br></div><div class="gmail_default" style="font-size:small">#lang slideshow<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">(require slideshow/step)<br><br>(define-syntax-rule (correct from to)<br> (lt-superimpose<br> ((vonly before) (t from))<br> ((vonly after) (t to))))<br><br>(void<br> (with-steps<br> (before after)<br> (slide<br> (correct "With" "By"))))<br></div><div class="gmail_default" style="font-size:small">but I get the error: <br></div><br><div class="gmail_default" style="font-size:small">vonly: unbound identifier in module in: vonly</div><br><div class="gmail_default" style="font-size:small">I've experimented with various types of quoting and unquoting, and tried define-simple-macro instead of define-syntax-rule, but I'm forced to admit I don't know what I'm doing!<br><br></div><div class="gmail_default" style="font-size:small">I know that vonly is special and is bound non-hygienically inside the scope of the with-steps; how do I reference it correctly in a macro?</div><br><br>-- <br><div class="gmail_signature"><a href="http://rrt.sc3d.org">http://rrt.sc3d.org</a></div>
</div>