Compare commits
54 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8883f6182f | ||
![]() |
b3d8b7b31e | ||
![]() |
faf6f2ad35 | ||
![]() |
14c7cc6719 | ||
![]() |
bf621b2d73 | ||
![]() |
7652f3403b | ||
![]() |
43086e3029 | ||
![]() |
09577114cd | ||
![]() |
9b4077135d | ||
![]() |
d470593784 | ||
![]() |
c40d7149c7 | ||
![]() |
d5551303e3 | ||
![]() |
8e8a836ddc | ||
![]() |
2f5f53f0a2 | ||
![]() |
e5198d18bd | ||
![]() |
85b7d23325 | ||
![]() |
5bc7969732 | ||
![]() |
3d2cb14309 | ||
![]() |
10461e0c89 | ||
![]() |
424a223802 | ||
![]() |
38fe0893c2 | ||
![]() |
4d5fb76f1f | ||
![]() |
f3c74eefbd | ||
![]() |
c41afe8d42 | ||
![]() |
8246a2fc7f | ||
![]() |
05a411d83d | ||
![]() |
fb93e6baeb | ||
![]() |
0b34428730 | ||
![]() |
d0c4b36cac | ||
![]() |
5574a65f87 | ||
![]() |
f8c2737f08 | ||
![]() |
a37309dbbc | ||
![]() |
0f2a73f6a7 | ||
![]() |
6d66bef742 | ||
![]() |
77354688b9 | ||
![]() |
50d1a69dcc | ||
![]() |
68648f2842 | ||
![]() |
a2735aac87 | ||
![]() |
e6151665e9 | ||
![]() |
da843ae7fa | ||
![]() |
72c8759a48 | ||
![]() |
e141823bfd | ||
![]() |
f7078c3e08 | ||
![]() |
9651526447 | ||
![]() |
0b5dab7305 | ||
![]() |
f0b194370e | ||
![]() |
c4314a4bf2 | ||
![]() |
c94aad777c | ||
![]() |
ee59ffb8e9 | ||
![]() |
4b3681b2a4 | ||
![]() |
f835bd396b | ||
![]() |
8f8db84259 | ||
![]() |
5e9c6a6e23 | ||
![]() |
ec5558cc6f |
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<!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 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="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.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 tocviewlisttopspace"><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,"tocview_0");">▼</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 </td><td><a href="Preface.html" class="tocviewlink" data-pltdoc="x">Preface</a></td></tr><tr><td align="right">2 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Our plan of attack</a></td></tr><tr><td align="right">3 </td><td><a href="Transform_.html" class="tocviewlink" data-pltdoc="x">Transform!</a></td></tr><tr><td align="right">4 </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 </td><td><a href="Syntax_parameters.html" class="tocviewlink" data-pltdoc="x">Syntax parameters</a></td></tr><tr><td align="right">6 </td><td><a href="What_s_the_point_of_splicing-let_.html" class="tocviewlink" data-pltdoc="x">What’s the point of <span class="RktSym"><span class="RktStxLink">splicing-<wbr></wbr>let</span></span>?</a></td></tr><tr><td align="right">7 </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 </td><td><a href="References_and_Acknowledgments.html" class="tocviewlink" data-pltdoc="x">References and Acknowledgments</a></td></tr><tr><td align="right">9 </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"> </span><span class="navright"> <a href="Preface.html" title="backward to "1 Preface"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Transform_.html" title="forward to "3 Transform!"" data-pltdoc="x">next →</a></span> </div><h3>2<tt> </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
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>2 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="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="gh.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><script type="text/javascript" src="manual-racket.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 tocviewlisttopspace"><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,"tocview_0");">▼</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 </td><td><a href="Preface.html" class="tocviewlink" data-pltdoc="x">Preface</a></td></tr><tr><td align="right">2 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Our plan of attack</a></td></tr><tr><td align="right">3 </td><td><a href="Transform_.html" class="tocviewlink" data-pltdoc="x">Transform!</a></td></tr><tr><td align="right">4 </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 </td><td><a href="Syntax_parameters.html" class="tocviewlink" data-pltdoc="x">Syntax parameters</a></td></tr><tr><td align="right">6 </td><td><a href="What_s_the_point_of_splicing-let_.html" class="tocviewlink" data-pltdoc="x">What’s the point of <span class="RktSym"><span class="RktStxLink">splicing-<wbr></wbr>let</span></span>?</a></td></tr><tr><td align="right">7 </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 </td><td><a href="References_and_Acknowledgments.html" class="tocviewlink" data-pltdoc="x">References and Acknowledgments</a></td></tr><tr><td align="right">9 </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"><div class="nosearchform"></div> </span><span class="navright"> <a href="Preface.html" title="backward to "1 Preface"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Transform_.html" title="forward to "3 Transform!"" data-pltdoc="x">next →</a></span> </div><h3>2<tt> </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’t worry, we’ll get to
|
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’t worry, we’ll get to
|
||||||
that soon.</p><p>But if we start there, you’re likely to feel overwhelmed by concepts
|
that soon.</p><p>But if we start there, you’re likely to feel overwhelmed by concepts
|
||||||
and terminology, and get very confused. I did.</p><p>1. Instead let’s start with the basics: A syntax object and a function
|
and terminology, and get very confused. I did.</p><p>1. Instead let’s start with the basics: A syntax object and a function
|
||||||
|
@ -19,4 +19,4 @@ they’re used in error. Normal Racket functions optionally can have
|
||||||
contracts and types. These catch usage mistakes and provide clear,
|
contracts and types. These catch usage mistakes and provide clear,
|
||||||
useful error messages. It would be great if there were something
|
useful error messages. It would be great if there were something
|
||||||
similar for macro. There is. One of the more-recent Racket macro
|
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#%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"> </span><span class="navright"> <a href="Preface.html" title="backward to "1 Preface"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Transform_.html" title="forward to "3 Transform!"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </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"><div class="nosearchform"></div> </span><span class="navright"> <a href="Preface.html" title="backward to "1 Preface"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Transform_.html" title="forward to "3 Transform!"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<!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>1 Preface</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.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 tocviewlisttopspace"><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,"tocview_0");">▼</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 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Preface</a></td></tr><tr><td align="right">2 </td><td><a href="Our_plan_of_attack.html" class="tocviewlink" data-pltdoc="x">Our plan of attack</a></td></tr><tr><td align="right">3 </td><td><a href="Transform_.html" class="tocviewlink" data-pltdoc="x">Transform!</a></td></tr><tr><td align="right">4 </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 </td><td><a href="Syntax_parameters.html" class="tocviewlink" data-pltdoc="x">Syntax parameters</a></td></tr><tr><td align="right">6 </td><td><a href="What_s_the_point_of_splicing-let_.html" class="tocviewlink" data-pltdoc="x">What’s the point of <span class="RktSym"><span class="RktStxLink">splicing-<wbr></wbr>let</span></span>?</a></td></tr><tr><td align="right">7 </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 </td><td><a href="References_and_Acknowledgments.html" class="tocviewlink" data-pltdoc="x">References and Acknowledgments</a></td></tr><tr><td align="right">9 </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"> </span><span class="navright"> <a href="index.html" title="backward to "Fear of Macros"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Our_plan_of_attack.html" title="forward to "2 Our plan of attack"" data-pltdoc="x">next →</a></span> </div><h3>1<tt> </tt><a name="(part._.Preface)"></a>Preface</h3><p>I learned Racket after 25 years of mostly using C and C++.</p><p>Some psychic whiplash resulted.</p><p>"All the parentheses" was actually not a big deal. Instead, the first
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>1 Preface</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="gh.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><script type="text/javascript" src="manual-racket.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 tocviewlisttopspace"><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,"tocview_0");">▼</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 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Preface</a></td></tr><tr><td align="right">2 </td><td><a href="Our_plan_of_attack.html" class="tocviewlink" data-pltdoc="x">Our plan of attack</a></td></tr><tr><td align="right">3 </td><td><a href="Transform_.html" class="tocviewlink" data-pltdoc="x">Transform!</a></td></tr><tr><td align="right">4 </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 </td><td><a href="Syntax_parameters.html" class="tocviewlink" data-pltdoc="x">Syntax parameters</a></td></tr><tr><td align="right">6 </td><td><a href="What_s_the_point_of_splicing-let_.html" class="tocviewlink" data-pltdoc="x">What’s the point of <span class="RktSym"><span class="RktStxLink">splicing-<wbr></wbr>let</span></span>?</a></td></tr><tr><td align="right">7 </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 </td><td><a href="References_and_Acknowledgments.html" class="tocviewlink" data-pltdoc="x">References and Acknowledgments</a></td></tr><tr><td align="right">9 </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"><div class="nosearchform"></div> </span><span class="navright"> <a href="index.html" title="backward to "Fear of Macros"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Our_plan_of_attack.html" title="forward to "2 Our plan of attack"" data-pltdoc="x">next →</a></span> </div><h3>1<tt> </tt><a name="(part._.Preface)"></a>Preface</h3><p>I learned Racket after 25 years of mostly using C and C++.</p><p>Some psychic whiplash resulted.</p><p>"All the parentheses" was actually not a big deal. Instead, the first
|
||||||
mind warp was functional programming. Before long I wrapped my brain
|
mind warp was functional programming. Before long I wrapped my brain
|
||||||
around it, and went on to become comfortable and effective with many
|
around it, and went on to become comfortable and effective with many
|
||||||
other aspects and features of Racket.</p><p>But two final frontiers remained: Macros and continuations.</p><p>I found that simple macros were easy and understandable, plus there
|
other aspects and features of Racket.</p><p>But two final frontiers remained: Macros and continuations.</p><p>I found that simple macros were easy and understandable, plus there
|
||||||
|
@ -21,4 +21,4 @@ problems or annoyances. I learn more quickly and deeply when I
|
||||||
discover the answer to a question I already have, or find the solution
|
discover the answer to a question I already have, or find the solution
|
||||||
to a problem whose pain I already feel. Therefore I’ll give you the
|
to a problem whose pain I already feel. Therefore I’ll give you the
|
||||||
questions and problems first, so that you can better appreciate and
|
questions and problems first, so that you can better appreciate and
|
||||||
understand the answers and solutions.</p><div class="navsetbottom"><span class="navleft"> </span><span class="navright"> <a href="index.html" title="backward to "Fear of Macros"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Our_plan_of_attack.html" title="forward to "2 Our plan of attack"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|
understand the answers and solutions.</p><div class="navsetbottom"><span class="navleft"><div class="nosearchform"></div> </span><span class="navright"> <a href="index.html" title="backward to "Fear of Macros"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Our_plan_of_attack.html" title="forward to "2 Our plan of attack"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|
17
README.md
17
README.md
|
@ -1,17 +0,0 @@
|
||||||

|
|
||||||
|
|
||||||
## What it is
|
|
||||||
|
|
||||||
This is a rough draft of a practical guide to Racket macros.
|
|
||||||
|
|
||||||
I started to write it not because I understand macros very well, but
|
|
||||||
because I don't.
|
|
||||||
|
|
||||||
## Where to read it
|
|
||||||
|
|
||||||
- [Multiple HTML files](http://www.greghendershott.com/fear-of-macros)
|
|
||||||
- [One big HTML file](http://www.greghendershott.com/fear-of-macros/all.html)
|
|
||||||
|
|
||||||
## Feeback
|
|
||||||
|
|
||||||
Feedback is welcome; please use Issues page here on GitHub.
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<!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>8 References and Acknowledgments</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="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.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 tocviewlisttopspace"><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,"tocview_0");">▼</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 </td><td><a href="Preface.html" class="tocviewlink" data-pltdoc="x">Preface</a></td></tr><tr><td align="right">2 </td><td><a href="Our_plan_of_attack.html" class="tocviewlink" data-pltdoc="x">Our plan of attack</a></td></tr><tr><td align="right">3 </td><td><a href="Transform_.html" class="tocviewlink" data-pltdoc="x">Transform!</a></td></tr><tr><td align="right">4 </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 </td><td><a href="Syntax_parameters.html" class="tocviewlink" data-pltdoc="x">Syntax parameters</a></td></tr><tr><td align="right">6 </td><td><a href="What_s_the_point_of_splicing-let_.html" class="tocviewlink" data-pltdoc="x">What’s the point of <span class="RktSym"><span class="RktStxLink">splicing-<wbr></wbr>let</span></span>?</a></td></tr><tr><td align="right">7 </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 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">References and Acknowledgments</a></td></tr><tr><td align="right">9 </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"> </span><span class="navright"> <a href="Robust_macros__syntax-parse.html" title="backward to "7 Robust macros: syntax-parse"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Epilogue.html" title="forward to "9 Epilogue"" data-pltdoc="x">next →</a></span> </div><h3>8<tt> </tt><a name="(part._.References_and_.Acknowledgments)"></a>References and Acknowledgments</h3><p>Eli Barzliay’s blog post,
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>8 References and Acknowledgments</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="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="gh.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><script type="text/javascript" src="manual-racket.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 tocviewlisttopspace"><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,"tocview_0");">▼</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 </td><td><a href="Preface.html" class="tocviewlink" data-pltdoc="x">Preface</a></td></tr><tr><td align="right">2 </td><td><a href="Our_plan_of_attack.html" class="tocviewlink" data-pltdoc="x">Our plan of attack</a></td></tr><tr><td align="right">3 </td><td><a href="Transform_.html" class="tocviewlink" data-pltdoc="x">Transform!</a></td></tr><tr><td align="right">4 </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 </td><td><a href="Syntax_parameters.html" class="tocviewlink" data-pltdoc="x">Syntax parameters</a></td></tr><tr><td align="right">6 </td><td><a href="What_s_the_point_of_splicing-let_.html" class="tocviewlink" data-pltdoc="x">What’s the point of <span class="RktSym"><span class="RktStxLink">splicing-<wbr></wbr>let</span></span>?</a></td></tr><tr><td align="right">7 </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 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">References and Acknowledgments</a></td></tr><tr><td align="right">9 </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"><div class="nosearchform"></div> </span><span class="navright"> <a href="Robust_macros__syntax-parse.html" title="backward to "7 Robust macros: syntax-parse"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Epilogue.html" title="forward to "9 Epilogue"" data-pltdoc="x">next →</a></span> </div><h3>8<tt> </tt><a name="(part._.References_and_.Acknowledgments)"></a>References and Acknowledgments</h3><p>Eli Barzilay’s blog post,
|
||||||
<a href="http://blog.racket-lang.org/2011/04/writing-syntax-case-macros.html">Writing
|
<a href="http://blog.racket-lang.org/2011/04/writing-syntax-case-macros.html">Writing
|
||||||
‘syntax-case’ Macros</a>, helped me understand many key details and
|
‘syntax-case’ Macros</a>, helped me understand many key details and
|
||||||
concepts, and inspired me to use a "bottom-up" approach.</p><p>Eli wrote another blog post,
|
concepts, and inspired me to use a "bottom-up" approach.</p><p>Eli wrote another blog post,
|
||||||
|
@ -25,4 +25,4 @@ improved since I last read it. Of course, it was the same; I’d
|
||||||
changed. It’s interesting how much of what we already know is
|
changed. It’s interesting how much of what we already know is
|
||||||
projected between the lines. My point is, the Racket documentation is
|
projected between the lines. My point is, the Racket documentation is
|
||||||
very good. The <span style="font-style: italic">Guide</span> provides helpful examples and
|
very good. The <span style="font-style: italic">Guide</span> provides helpful examples and
|
||||||
tutorials. The <span style="font-style: italic">Reference</span> is very clear and precise.</p><div class="navsetbottom"><span class="navleft"> </span><span class="navright"> <a href="Robust_macros__syntax-parse.html" title="backward to "7 Robust macros: syntax-parse"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Epilogue.html" title="forward to "9 Epilogue"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|
tutorials. The <span style="font-style: italic">Reference</span> is very clear and precise.</p><div class="navsetbottom"><span class="navleft"><div class="nosearchform"></div> </span><span class="navright"> <a href="Robust_macros__syntax-parse.html" title="backward to "7 Robust macros: syntax-parse"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Fear of Macros"" data-pltdoc="x">up</a> <a href="Epilogue.html" title="forward to "9 Epilogue"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,57 +0,0 @@
|
||||||
#lang racket
|
|
||||||
|
|
||||||
;; Realm of kludge:
|
|
||||||
;;
|
|
||||||
;; AFIK no way via Scribble to put something into the <head> section.
|
|
||||||
;;
|
|
||||||
;; This reads all HTML files and injects some stuff immediately before the
|
|
||||||
;; </head> closing tag.
|
|
||||||
|
|
||||||
(define web-font
|
|
||||||
"<link href='http://fonts.googleapis.com/css?family=Fenix' rel='stylesheet' type='text/css'>")
|
|
||||||
|
|
||||||
(define ga-code
|
|
||||||
#<<EOF
|
|
||||||
<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>
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
|
|
||||||
(define (meta k v)
|
|
||||||
(format "<meta name=\"~a\" content=\"~a\">" k v))
|
|
||||||
|
|
||||||
(define metas
|
|
||||||
(string-append
|
|
||||||
(meta "keywords" "Racket,macros,Scheme")
|
|
||||||
(meta "description" "Practical Racket macros")
|
|
||||||
(meta "author" "Greg Hendershott")
|
|
||||||
(meta "charset" "utf-8")))
|
|
||||||
|
|
||||||
(define </head> "</head>")
|
|
||||||
|
|
||||||
(define all (string-append metas web-font ga-code </head>))
|
|
||||||
(define subst (regexp-replace* "\n" all "")) ;minify
|
|
||||||
|
|
||||||
(define (do-file path)
|
|
||||||
(define old (file->string path))
|
|
||||||
(define new (regexp-replace </head> old subst))
|
|
||||||
(with-output-to-file path
|
|
||||||
(lambda () (display new))
|
|
||||||
#:mode 'text
|
|
||||||
#:exists 'replace))
|
|
||||||
|
|
||||||
(require racket/runtime-path)
|
|
||||||
(define-runtime-path here ".")
|
|
||||||
(for ([path (find-files (lambda (path)
|
|
||||||
(regexp-match? #rx"\\.html" path))
|
|
||||||
here)])
|
|
||||||
(do-file path))
|
|
File diff suppressed because one or more lines are too long
12
make-doc.sh
12
make-doc.sh
|
@ -1,12 +0,0 @@
|
||||||
# Multiple HTML files
|
|
||||||
# Note: I can't seem to make Scribble generate these in the current
|
|
||||||
# directory, so, generate to an `index' subdir then `cp' them up.
|
|
||||||
scribble --htmls ++style gh.css ++xref-in setup/xref load-collections-xref --redirect-main "http://docs.racket-lang.org/" index.rkt
|
|
||||||
cp index/* ./
|
|
||||||
rm -rf index/
|
|
||||||
|
|
||||||
# All in one HTML file
|
|
||||||
scribble --html ++style gh.css ++xref-in setup/xref load-collections-xref --redirect-main "http://docs.racket-lang.org/" --dest-name all.html index.rkt
|
|
||||||
|
|
||||||
# Update <head> of HTML files
|
|
||||||
racket add-to-head.rkt
|
|
File diff suppressed because one or more lines are too long
|
@ -306,3 +306,14 @@ tbody > tr:first-child > td > .together {
|
||||||
top: 0px;
|
top: 0px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------- */
|
||||||
|
/* For section source modules & tags */
|
||||||
|
|
||||||
|
.RPartExplain {
|
||||||
|
background: #eee;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
margin-top: 0.2rem;
|
||||||
|
padding: 0.2rem;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
98
manual-racket.js
Normal file
98
manual-racket.js
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
/* For the Racket manual style */
|
||||||
|
|
||||||
|
AddOnLoad(function() {
|
||||||
|
/* Look for header elements that have x-source-module and x-part tag.
|
||||||
|
For those elements, add a hidden element that explains how to
|
||||||
|
link to the section, and set the element's onclick() to display
|
||||||
|
the explanation. */
|
||||||
|
var tag_names = ["h1", "h2", "h3", "h4", "h5"];
|
||||||
|
for (var j = 0; j < tag_names.length; j++) {
|
||||||
|
elems = document.getElementsByTagName(tag_names[j]);
|
||||||
|
for (var i = 0; i < elems.length; i++) {
|
||||||
|
var elem = elems.item(i);
|
||||||
|
AddPartTitleOnClick(elem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function AddPartTitleOnClick(elem) {
|
||||||
|
var mod_path = elem.getAttribute("x-source-module");
|
||||||
|
var tag = elem.getAttribute("x-part-tag");
|
||||||
|
if (mod_path && tag) {
|
||||||
|
// Might not be present:
|
||||||
|
var prefixes = elem.getAttribute("x-part-prefixes");
|
||||||
|
|
||||||
|
var info = document.createElement("div");
|
||||||
|
info.className = "RPartExplain";
|
||||||
|
|
||||||
|
/* The "top" tag refers to a whole document: */
|
||||||
|
var is_top = (tag == "\"top\"");
|
||||||
|
info.appendChild(document.createTextNode("Link to this "
|
||||||
|
+ (is_top ? "document" : "section")
|
||||||
|
+ " with "));
|
||||||
|
|
||||||
|
/* Break `secref` into two lines if the module path and tag
|
||||||
|
are long enough: */
|
||||||
|
var is_long = (is_top ? false : ((mod_path.length
|
||||||
|
+ tag.length
|
||||||
|
+ (prefixes ? (16 + prefixes.length) : 0))
|
||||||
|
> 60));
|
||||||
|
|
||||||
|
var line1 = document.createElement("div");
|
||||||
|
var line1x = ((is_long && prefixes) ? document.createElement("div") : line1);
|
||||||
|
var line2 = (is_long ? document.createElement("div") : line1);
|
||||||
|
|
||||||
|
function add(dest, str, cn) {
|
||||||
|
var s = document.createElement("span");
|
||||||
|
s.className = cn;
|
||||||
|
s.style.whiteSpace = "nowrap";
|
||||||
|
s.appendChild(document.createTextNode(str));
|
||||||
|
dest.appendChild(s);
|
||||||
|
}
|
||||||
|
/* Construct a `secref` call with suitable syntax coloring: */
|
||||||
|
add(line1, "\xA0@", "RktRdr");
|
||||||
|
add(line1, (is_top ? "other-doc" : "secref"), "RktSym");
|
||||||
|
add(line1, "[", "RktPn");
|
||||||
|
if (!is_top)
|
||||||
|
add(line1, tag, "RktVal");
|
||||||
|
if (is_long) {
|
||||||
|
/* indent additional lines: */
|
||||||
|
if (prefixes)
|
||||||
|
add(line1x, "\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0", "RktPn");
|
||||||
|
add(line2, "\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0", "RktPn");
|
||||||
|
}
|
||||||
|
if (prefixes) {
|
||||||
|
add(line1x, " #:tag-prefixes ", "RktPn");
|
||||||
|
add(line1x, "'", "RktVal");
|
||||||
|
add(line1x, prefixes, "RktVal");
|
||||||
|
}
|
||||||
|
if (!is_top)
|
||||||
|
add(line2, " #:doc ", "RktPn");
|
||||||
|
add(line2, "'", "RktVal");
|
||||||
|
add(line2, mod_path, "RktVal");
|
||||||
|
add(line2, "]", "RktPn");
|
||||||
|
|
||||||
|
info.appendChild(line1);
|
||||||
|
if (is_long)
|
||||||
|
info.appendChild(line1x);
|
||||||
|
if (is_long)
|
||||||
|
info.appendChild(line2);
|
||||||
|
|
||||||
|
info.style.display = "none";
|
||||||
|
|
||||||
|
/* Add the new element afterthe header: */
|
||||||
|
var n = elem.nextSibling;
|
||||||
|
if (n)
|
||||||
|
elem.parentNode.insertBefore(info, n);
|
||||||
|
else
|
||||||
|
elem.parentNode.appendChild(info);
|
||||||
|
|
||||||
|
/* Clicking the header shows the explanation element: */
|
||||||
|
elem.onclick = function () {
|
||||||
|
if (info.style.display == "none")
|
||||||
|
info.style.display = "block";
|
||||||
|
else
|
||||||
|
info.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -88,6 +88,9 @@ p, .SIntrapara {
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.compact {
|
||||||
|
padding: 0 0 1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
list-style-position: outside;
|
list-style-position: outside;
|
||||||
|
@ -241,6 +244,12 @@ a:hover {
|
||||||
height: 4rem;
|
height: 4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nosearchform {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
height: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
.searchbox {
|
.searchbox {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
width: 12rem;
|
width: 12rem;
|
||||||
|
@ -304,7 +313,20 @@ a:hover {
|
||||||
border-left: 0.4rem solid #ccb;
|
border-left: 0.4rem solid #ccb;
|
||||||
}
|
}
|
||||||
|
|
||||||
.refcontent p {
|
|
||||||
|
/* slightly different handling for margin-note* on narrow screens */
|
||||||
|
@media all and (max-width:1260px) {
|
||||||
|
span.refcolumn {
|
||||||
|
float: right;
|
||||||
|
width: 50%;
|
||||||
|
margin-left: 1rem;
|
||||||
|
margin-bottom: 0.8rem;
|
||||||
|
margin-top: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.refcontent, .refcontent p {
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
@ -517,13 +539,10 @@ table.tocsublist {
|
||||||
|
|
||||||
.toptoclink {
|
.toptoclink {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 110%
|
font-size: 110%;
|
||||||
}
|
margin-bottom: 0.5rem;
|
||||||
|
margin-top: 1.5rem;
|
||||||
/* hack to add space around .toptoclink because markup is all td */
|
display: inline-block;
|
||||||
.toptoclink:after {
|
|
||||||
content: " ";
|
|
||||||
font-size: 3rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.toclink {
|
.toclink {
|
||||||
|
|
File diff suppressed because one or more lines are too long
7
push.sh
7
push.sh
|
@ -1,7 +0,0 @@
|
||||||
# Simply make gh-pages branch a mirror of master branch.
|
|
||||||
git checkout master && \
|
|
||||||
git push origin master && \
|
|
||||||
git checkout gh-pages && \
|
|
||||||
git merge master && \
|
|
||||||
git push origin gh-pages && \
|
|
||||||
git checkout master
|
|
10
racket.css
10
racket.css
|
@ -144,9 +144,6 @@
|
||||||
.prototype td {
|
.prototype td {
|
||||||
vertical-align: text-top;
|
vertical-align: text-top;
|
||||||
}
|
}
|
||||||
.longprototype td {
|
|
||||||
vertical-align: bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
.RktBlk {
|
.RktBlk {
|
||||||
white-space: inherit;
|
white-space: inherit;
|
||||||
|
@ -243,3 +240,10 @@
|
||||||
top: 0px;
|
top: 0px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------- */
|
||||||
|
/* History */
|
||||||
|
|
||||||
|
.SHistory {
|
||||||
|
font-size: 82%;
|
||||||
|
}
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
// Page Parameters ------------------------------------------------------------
|
// Page Parameters ------------------------------------------------------------
|
||||||
|
|
||||||
var page_query_string =
|
var page_query_string = location.search.substring(1);
|
||||||
(location.href.search(/\?([^#]+)(?:#|$)/) >= 0) && RegExp.$1;
|
|
||||||
|
|
||||||
var page_args =
|
var page_args =
|
||||||
((function(){
|
((function(){
|
||||||
|
@ -20,7 +19,7 @@ var page_args =
|
||||||
|
|
||||||
function GetPageArg(key, def) {
|
function GetPageArg(key, def) {
|
||||||
for (var i=0; i<page_args.length; i++)
|
for (var i=0; i<page_args.length; i++)
|
||||||
if (page_args[i][0] == key) return unescape(page_args[i][1]);
|
if (page_args[i][0] == key) return decodeURIComponent(page_args[i][1]);
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,13 +27,20 @@ function MergePageArgsIntoLink(a) {
|
||||||
if (page_args.length == 0 ||
|
if (page_args.length == 0 ||
|
||||||
(!a.attributes["data-pltdoc"]) || (a.attributes["data-pltdoc"].value == ""))
|
(!a.attributes["data-pltdoc"]) || (a.attributes["data-pltdoc"].value == ""))
|
||||||
return;
|
return;
|
||||||
a.href.search(/^([^?#]*)(?:\?([^#]*))?(#.*)?$/);
|
a.href = MergePageArgsIntoUrl(a.href);
|
||||||
if (RegExp.$2.length == 0) {
|
}
|
||||||
a.href = RegExp.$1 + "?" + page_query_string + RegExp.$3;
|
|
||||||
} else {
|
function MergePageArgsIntoUrl(href) {
|
||||||
|
var mtch = href.match(/^([^?#]*)(?:\?([^#]*))?(#.*)?$/);
|
||||||
|
if (mtch == undefined) { // I think this never happens
|
||||||
|
return "?" + page_query_string;
|
||||||
|
}
|
||||||
|
if (!mtch[2]) {
|
||||||
|
return mtch[1] + "?" + page_query_string + (mtch[3] || "");
|
||||||
|
}
|
||||||
// need to merge here, precedence to arguments that exist in `a'
|
// need to merge here, precedence to arguments that exist in `a'
|
||||||
var i, j;
|
var i, j;
|
||||||
var prefix = RegExp.$1, str = RegExp.$2, suffix = RegExp.$3;
|
var prefix = mtch[1], str = mtch[2] || "", suffix = mtch[3] || "";
|
||||||
var args = str.split(/[&;]/);
|
var args = str.split(/[&;]/);
|
||||||
for (i=0; i<args.length; i++) {
|
for (i=0; i<args.length; i++) {
|
||||||
j = args[i].indexOf('=');
|
j = args[i].indexOf('=');
|
||||||
|
@ -47,8 +53,7 @@ function MergePageArgsIntoLink(a) {
|
||||||
if (args[j] == page_args[i][0]) { exists = true; break; }
|
if (args[j] == page_args[i][0]) { exists = true; break; }
|
||||||
if (!exists) str += "&" + page_args[i][0] + "=" + page_args[i][1];
|
if (!exists) str += "&" + page_args[i][0] + "=" + page_args[i][1];
|
||||||
}
|
}
|
||||||
a.href = prefix + "?" + str + suffix;
|
return prefix + "?" + str + suffix;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cookies --------------------------------------------------------------------
|
// Cookies --------------------------------------------------------------------
|
||||||
|
@ -127,8 +132,8 @@ function DoSearchKey(event, field, ver, top_path) {
|
||||||
if (event && event.keyCode == 13) {
|
if (event && event.keyCode == 13) {
|
||||||
var u = GetCookie("PLT_Root."+ver, null);
|
var u = GetCookie("PLT_Root."+ver, null);
|
||||||
if (u == null) u = top_path; // default: go to the top path
|
if (u == null) u = top_path; // default: go to the top path
|
||||||
u += "search/index.html?q=" + escape(val);
|
u += "search/index.html?q=" + encodeURIComponent(val);
|
||||||
if (page_query_string) u += "&" + page_query_string;
|
u = MergePageArgsIntoUrl(u);
|
||||||
location = u;
|
location = u;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,10 @@ table td {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nosearchform {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.searchbox {
|
.searchbox {
|
||||||
width: 16em;
|
width: 16em;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user