diff --git a/main.rkt b/main.rkt index d84f4fa..a9bf5c3 100644 --- a/main.rkt +++ b/main.rkt @@ -242,7 +242,7 @@ Let's start by looking closely at what the input actually @italic{is}: (define-syntax (show-me stx) (print stx) #'(void)) -(show-me '(i am a list)) +(show-me '(+ 1 2)) ] The @racket[(print stx)] shows what our transformer is given: a syntax @@ -674,8 +674,9 @@ but not be scared of, or confused about, that for which it's shorthand. Most of the materials I found for learning macros, including the -Racket @italic{Guide}, do a very good job explaining how patterns -and templates work. I'm not going to regurgitate that here. +Racket @italic{Guide}, do a very good job explaining +@hyperlink["http://docs.racket-lang.org/guide/pattern-macros.html" "how +patterns and templates work"]. So I won't regurgitate that here. Sometimes, we need to go a step beyond the pattern and template. Let's look at some examples, how we can get confused, and how to get it @@ -890,8 +891,10 @@ Using @racket[format-id] is convenient as it handles the tedium of converting from syntax to symbol datum to string ... and all the way back. -Finally, here's a variation that accepts any number of name parts that -are joined with hyphens: +@subsubsection{Another example} + +Finally, here's a variation that accepts an arbitary number of name +parts to be joined with hyphens: @i[ (require (for-syntax racket/string racket/syntax)) @@ -909,6 +912,7 @@ are joined with hyphens: (foo-bar-baz 50) ] + To review: @itemize[