Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
* master:
  Regen HTML.
  Update copyright years.
  Fix #4: Clarify attempt to define syntax param id as normal var.
  • Loading branch information
Greg Hendershott committed Jan 20, 2013
2 parents e5198d1 + a2f79e7 commit 2f5f53f
Show file tree
Hide file tree
Showing 14 changed files with 188 additions and 159 deletions.
6 changes: 3 additions & 3 deletions Epilogue.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Our_plan_of_attack.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text-html; charset=utf-8" /><title>2&nbsp;Our plan of attack</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default" /><link rel="stylesheet" type="text/css" href="racket.css" title="default" /><link rel="stylesheet" type="text/css" href="scribble-style.css" title="default" /><link rel="stylesheet" type="text/css" href="gh.css" title="default" /><script type="text/javascript" src="scribble-common.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--><meta name="keywords" content="Racket,macros,Scheme"><meta name="description" content="Practical Racket macros"><meta name="author" content="Greg Hendershott"><meta name="charset" content="utf-8"><link href='http://fonts.googleapis.com/css?family=Fenix' rel='stylesheet' type='text/css'><script type="text/javascript">var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-29709446-1']);_gaq.push(['_setDomainName', 'greghendershott.com']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist" style="margin-bottom: 1em;"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9660;</a></td><td></td><td><a href="index.html" class="tocviewlink" pltdoc="x">Fear of Macros</a></td></tr></table></div><div class="tocviewsublistonly" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="Preface.html" class="tocviewlink" pltdoc="x">Preface</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="" class="tocviewselflink" pltdoc="x">Our plan of attack</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="Transform_.html" class="tocviewlink" pltdoc="x">Transform!</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="pattern-matching.html" class="tocviewlink" pltdoc="x">Pattern matching:<span class="mywbr"> </span> syntax-<wbr></wbr>case and syntax-<wbr></wbr>rules</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="Syntax_parameters.html" class="tocviewlink" pltdoc="x">Syntax parameters</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="What_s_the_point_of_splicing-let_.html" class="tocviewlink" pltdoc="x">What&rsquo;s the point of <span class="RktSym"><span class="RktStxLink">splicing-<wbr></wbr>let</span></span>?</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="Robust_macros__syntax-parse.html" class="tocviewlink" pltdoc="x">Robust macros:<span class="mywbr"> </span> syntax-<wbr></wbr>parse</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="References_and_Acknowledgments.html" class="tocviewlink" pltdoc="x">References and Acknowledgments</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="Epilogue.html" class="tocviewlink" pltdoc="x">Epilogue</a></td></tr></table></div></div></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft">&nbsp;&nbsp;</span><span class="navright"><a href="Preface.html" title="backward to &quot;1 Preface&quot;" pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Fear of Macros&quot;" pltdoc="x">up</a>&nbsp;&nbsp;<a href="Transform_.html" title="forward to &quot;3 Transform!&quot;" pltdoc="x">next &rarr;</a></span>&nbsp;</div><h3>2<tt>&nbsp;</tt><a name="(part._.Our_plan_of_attack)"></a>Our plan of attack</h3><p>The macro system you will mostly want to use for production-quality
macros is called <span class="RktSym"><a href="http://docs.racket-lang.org/syntax/Parsing_Syntax.html#(form._((lib._syntax%2Fparse..rkt)._syntax-parse))" class="RktStxLink" pltdoc="x">syntax-parse</a></span>. And don&rsquo;t worry, we&rsquo;ll get to
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><title>2&nbsp;Our plan of attack</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default" /><link rel="stylesheet" type="text/css" href="racket.css" title="default" /><link rel="stylesheet" type="text/css" href="scribble-style.css" title="default" /><link rel="stylesheet" type="text/css" href="gh.css" title="default" /><script type="text/javascript" src="scribble-common.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--><meta name="keywords" content="Racket,macros,Scheme"><meta name="description" content="Practical Racket macros"><meta name="author" content="Greg Hendershott"><meta name="charset" content="utf-8"><link href='http://fonts.googleapis.com/css?family=Fenix' rel='stylesheet' type='text/css'><script type="text/javascript">var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-29709446-1']);_gaq.push(['_setDomainName', 'greghendershott.com']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist" style="margin-bottom: 1em;"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9660;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Fear of Macros</a></td></tr></table></div><div class="tocviewsublistonly" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="Preface.html" class="tocviewlink" data-pltdoc="x">Preface</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">Our plan of attack</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="Transform_.html" class="tocviewlink" data-pltdoc="x">Transform!</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="pattern-matching.html" class="tocviewlink" data-pltdoc="x">Pattern matching:<span class="mywbr"> </span> syntax-<wbr></wbr>case and syntax-<wbr></wbr>rules</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="Syntax_parameters.html" class="tocviewlink" data-pltdoc="x">Syntax parameters</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="What_s_the_point_of_splicing-let_.html" class="tocviewlink" data-pltdoc="x">What&rsquo;s the point of <span class="RktSym"><span class="RktStxLink">splicing-<wbr></wbr>let</span></span>?</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="Robust_macros__syntax-parse.html" class="tocviewlink" data-pltdoc="x">Robust macros:<span class="mywbr"> </span> syntax-<wbr></wbr>parse</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="References_and_Acknowledgments.html" class="tocviewlink" data-pltdoc="x">References and Acknowledgments</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="Epilogue.html" class="tocviewlink" data-pltdoc="x">Epilogue</a></td></tr></table></div></div></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft">&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="Preface.html" title="backward to &quot;1 Preface&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Fear of Macros&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="Transform_.html" title="forward to &quot;3 Transform!&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h3>2<tt>&nbsp;</tt><a name="(part._.Our_plan_of_attack)"></a>Our plan of attack</h3><p>The macro system you will mostly want to use for production-quality
macros is called <span class="RktSym"><a href="http://docs.racket-lang.org/syntax/Parsing_Syntax.html#%28form._%28%28lib._syntax%2Fparse..rkt%29._syntax-parse%29%29" class="RktStxLink" data-pltdoc="x">syntax-parse</a></span>. And don&rsquo;t worry, we&rsquo;ll get to
that soon.</p><p>But if we start there, you&rsquo;re likely to feel overwhelmed by concepts
and terminology, and get very confused. I did.</p><p>1. Instead let&rsquo;s start with the basics: A syntax object and a function
to change it&#8212;<wbr></wbr>a "transformer". We&rsquo;ll work at that level for awhile to
get comfortable and to de-mythologize this whole macro business.</p><p>2. Soon we&rsquo;ll realize that pattern-matching would make life
easier. We&rsquo;ll learn about <span class="RktSym"><a href="http://docs.racket-lang.org/reference/stx-patterns.html#(form._((lib._racket%2Fprivate%2Fstxcase-scheme..rkt)._syntax-case))" class="RktStxLink" pltdoc="x">syntax-case</a></span> and its shorthand
cousin, <span class="RktSym"><a href="http://docs.racket-lang.org/reference/stx-patterns.html#(form._((lib._racket%2Fprivate%2Fmisc..rkt)._define-syntax-rule))" class="RktStxLink" pltdoc="x">define-syntax-rule</a></span>. We&rsquo;ll discover we can get
easier. We&rsquo;ll learn about <span class="RktSym"><a href="http://docs.racket-lang.org/reference/stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fstxcase-scheme..rkt%29._syntax-case%29%29" class="RktStxLink" data-pltdoc="x">syntax-case</a></span> and its shorthand
cousin, <span class="RktSym"><a href="http://docs.racket-lang.org/reference/stx-patterns.html#%28form._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._define-syntax-rule%29%29" class="RktStxLink" data-pltdoc="x">define-syntax-rule</a></span>. We&rsquo;ll discover we can get
confused if we want to munge pattern variables before sticking them
back in the template, and learn how to do that.</p><p>3. At this point we&rsquo;ll be able to write many useful macros. But, what
if we want to write the ever-popular anaphoric if, with a "magic
Expand All @@ -19,4 +19,4 @@
contracts and types. These catch usage mistakes and provide clear,
useful error messages. It would be great if there were something
similar for macro. There is. One of the more-recent Racket macro
enhancements is <span class="RktSym"><a href="http://docs.racket-lang.org/syntax/Parsing_Syntax.html#(form._((lib._syntax%2Fparse..rkt)._syntax-parse))" class="RktStxLink" pltdoc="x">syntax-parse</a></span>.</p><div class="navsetbottom"><span class="navleft">&nbsp;&nbsp;</span><span class="navright"><a href="Preface.html" title="backward to &quot;1 Preface&quot;" pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Fear of Macros&quot;" pltdoc="x">up</a>&nbsp;&nbsp;<a href="Transform_.html" title="forward to &quot;3 Transform!&quot;" pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>
enhancements is <span class="RktSym"><a href="http://docs.racket-lang.org/syntax/Parsing_Syntax.html#%28form._%28%28lib._syntax%2Fparse..rkt%29._syntax-parse%29%29" class="RktStxLink" data-pltdoc="x">syntax-parse</a></span>.</p><div class="navsetbottom"><span class="navleft">&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="Preface.html" title="backward to &quot;1 Preface&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Fear of Macros&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="Transform_.html" title="forward to &quot;3 Transform!&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>
Loading

0 comments on commit 2f5f53f

Please sign in to comment.