Also, there are some more modern alternatives to `with-steps`. I particularly like the `staged` and `slide/staged` macros, which you can read about here: <a href="http://docs.racket-lang.org/unstable-gui/Slideshow_Presentations.html#%28part._.Staged_.Slides%29">http://docs.racket-lang.org/unstable-gui/Slideshow_Presentations.html#%28part._.Staged_.Slides%29</a><br><div><br></div><div>Sam</div><br><div class="gmail_quote">On Wed Jan 21 2015 at 9:47:28 AM Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">At Wed, 21 Jan 2015 13:04:11 +0000, Reuben Thomas wrote:<br>
> Since I have a lot of slides like this, I want to write a macro. I tried:<br>
><br>
> #lang slideshow<br>
><br>
> ​(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>
> ​<br>
> ​but I get the error:<br>
><br>
> ​vonly: unbound identifier in module in: vonly​<br>
><br>
> ​I've experimented with various types of quoting and unquoting, and tried<br>
> define-simple-macro instead of define-syntax-rule, but I'm forced to admit<br>
> I don't know what I'm doing!<br>
><br>
> I know that vonly is special and is bound non-hygienically inside the scope<br>
> of the with-steps; how do I reference it correctly in a macro?​<br>
<br>
You're right that the essential problem is that `with-steps` introduces<br>
binding no-hygienically. Non-hygienic macros don't compose nicely.<br>
<br>
If `with-steps` were written in modern Racket, then it would be<br>
hygienic, where `vonly`, etc., are bindings that take their meaning<br>
as syntax parameters from an enclosing `with-steps`. Fortunately, it's<br>
possible to implement a more modern `with-steps` using the existing one.<br>
<br>
Use the enclosed "new-step.rkt" in place of `slideshow/step`, and then<br>
your `correct` macro will work.<br>
____________________<br>
  Racket Users list:<br>
  <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
</blockquote></div>