<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nklein software &#187; TeX</title>
	<atom:link href="http://nklein.com/tags/tex/feed/" rel="self" type="application/rss+xml" />
	<link>http://nklein.com</link>
	<description>software development and consulting</description>
	<lastBuildDate>Thu, 22 Dec 2011 04:42:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How I Know I Don&#8217;t Know Enough About Lisp Macros</title>
		<link>http://nklein.com/2009/06/how-i-know-i-dont-know-enough-about-lisp-macros/</link>
		<comments>http://nklein.com/2009/06/how-i-know-i-dont-know-enough-about-lisp-macros/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 05:40:02 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[m4]]></category>
		<category><![CDATA[macros]]></category>
		<category><![CDATA[nroff]]></category>
		<category><![CDATA[TeX]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=584</guid>
		<description><![CDATA[I have a pretty good grasp on macros in Lisp, C/C++, TeX, m4, and nroff. Lisp macros are, far and away, the most powerful in that set. In fact, Lisp macros get a bad rap by sharing a name with macros in those other languages. Still, I often hit the same wall when trying to [...]]]></description>
			<content:encoded><![CDATA[<p>I have a pretty good grasp on macros in Lisp, C/C++, TeX, m4, and nroff.  Lisp macros are, far and away, the most powerful in that set.  In fact, Lisp macros get a bad rap by sharing a name with macros in those other languages.  Still, I often hit the same wall when trying to write a Lisp macro so I know that there&#8217;s more I have to learn.</p>
<h3>A Quick Look at Macros</h3>
<p>First, let&#8217;s review macros for a moment to make sure we&#8217;re all on the same page.  The C/C++ macros are the simplest to understand so we&#8217;ll start there.  The C and C++ compilers run in two stages.  First, the C preprocessor runs to expand all of your macros.  Then, the compiler runs to actually compile your code.  In C and C++, macros are declared using the <em>#define</em> command to the preprocessor.  For example, you might do something like the following:<br />
<span id="more-584"></span></p>
<div class="codecolorer-container c blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">#define START_TIMER  __start_time__ = get_current_time();</span>
<span style="color: #339933;">#define END_TIMER    __elapsed__ = get_current_time() - __start_time__;</span></pre></div>
<p>Then, later in you code, you might do something like:</p>
<div class="codecolorer-container c blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">START_TIMER
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>ii <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> ii <span style="color: #339933;">&lt;</span> MAX_ITERATIONS<span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        do_foo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
END_TIMER</pre></div>
<p>The C preprocessor will replace the <em>START_TIMER</em> and <em>END_TIMER</em> with the code you declared in the <em>#define</em>.  Your resulting code would then go into the actual compile phase looking like this:</p>
<div class="codecolorer-container c blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">__start_time__ <span style="color: #339933;">=</span> get_current_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>ii <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> ii <span style="color: #339933;">&lt;</span> MAX_ITERATIONS<span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        do_foo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
__elapsed__ <span style="color: #339933;">=</span> get_current_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> __start_time__<span style="color: #339933;">;</span></pre></div>
<p>The preprocessor did some simple string replacements on your behalf.  [Actually, it is somewhat helpful to think of it as doing <b>token</b> replacement instead since the name of your macro has to be a valid C token and you have to jump through some ugly, implementation-specific hoops to get it to concatenate things rather than whitespace separate them.]  You can also create macros with arguments like:</p>
<div class="codecolorer-container c blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">#define WARN(x,y)     log_message( __LOG_LEVEL_WARN__, x, y )</span>
...
<span style="color: #202020;">WARN</span><span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;buffer_copy()&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Output buffer is not properly aligned&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div>
<p>If you look back at the <em>START_TIMER</em> and <em>END_TIMER</em> macros above, you will notice that the semicolons, which delimit statements in C and C++, are included in the macro definitions.  As such, they aren&#8217;t used explicitly where the macros are invoked.  So?  Well, that means that your program needn&#8217;t bear any resemblance to compilable C before the preprocessor is run.  Some sets of macros exploit this to make your C code look like FORTRAN or Bourne Shell or PASCAL or C++.</p>
<p>Lisp macros are a different beast entirely.  Invoking a macro in Lisp looks just like everything else in Lisp.  [To be fair, some macros (like <em>(LOOP&nbsp;...)</em>) go a little nutty and make things look like a Lisp wrapper around some non-Lisp.  Most macros are much more Lispy.  Additionally, Lisp has two different sorts of macros: macros and reader macros.  With reader macros, you could probably make your Lisp code look something like PASCAL if you were exceedingly ambitious and exceedingly misguided.  But, from there on out, when I say <q>macro</q>, I specifically mean just <q>macro</q> as distinguished from <q>reader macro</q>.]</p>
<p>For pedagogic purposes, let&#8217;s look at those same macros defined in Lisp:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defmacro</span> START_TIMER <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> '<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setf</span> *start-time* <span style="color: #66cc66;">&#40;</span>get-current-time<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defmacro</span> END_TIMER <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> '<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setf</span> *elapsed* <span style="color: #66cc66;">&#40;</span>- <span style="color: #66cc66;">&#40;</span>get-current-time<span style="color: #66cc66;">&#41;</span> *start-time*<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defmacro</span> WARN <span style="color: #66cc66;">&#40;</span>x y<span style="color: #66cc66;">&#41;</span> `<span style="color: #66cc66;">&#40;</span>log_message +log-level-warn+ <span style="color: #66cc66;">,</span>x <span style="color: #66cc66;">,</span>y<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>The first two macros are straight substitutions:  wherever you find the Lisp form <em>(START_TIMER)</em>, substitute the form <em>(setf *start-time* (get-current-time))</em>, and similarly for the <em>(END_TIMER)</em> form.  The single quote in front of the <em>(SETF&nbsp;&#8230;)</em> forms in those first two macros indicates that the following form, while parsed, is not to be evaluated at the time the macro is expanded.  In the <em>(WARN&nbsp;&#8230;)</em> macro, things are a bit more complicated.  The backquote before the <em>(LOG_MESSAGE&nbsp;&#8230;)</em> form indicates that the form itself is not to be evaluated at expansion time, but that some portions within it (those demarcated with commas) will need to be substituted.  As you would expect:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span>WARN <span style="color: #ff0000;">&quot;square-root&quot;</span> <span style="color: #ff0000;">&quot;Not interested in handling negative arguments today&quot;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>would expand into:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span>log_message +log-level-warning+ <span style="color: #ff0000;">&quot;square-root&quot;</span> <span style="color: #ff0000;">&quot;Not interested in handling negative arguments today&quot;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<h3>What makes Lisp macros so great?</h3>
<p>From what I&#8217;ve shown you so far, you might be thinking: <q>What make Lisp macros so great?  Everything you&#8217;ve done with Lisp macros, I can do with the C preprocessor.  Further, I can do things with the C preprocessor that are syntactically nothing at all like C.  You already said you can&#8217;t do Lisp macros that are syntactically nothing like Lisp.</q></p>
<p>There is, of course, an aesthetic argument about why it would be better if the C preprocessor enforced some semblance of C on you.  I wouldn&#8217;t respect that argument much either if someone were poking at my language.  Aesthetics is good.  Aesthetics is important.  Should the compiler enforce them?  Only if it&#8217;s going to give me something much better in return.</p>
<p>What do Lisp macros give you?  They give you Lisp!  What more could you possible want?</p>
<p>Let&#8217;s say that you&#8217;ve written code in Assembly Language or BASIC so long that the code you&#8217;re writing today screams for a <a href="http://en.wikipedia.org/wiki/Jump_table">Jump table or computed GOTO</a>.  Heck, the code you wrote yesterday used a jump table, too?  Maybe you could factor out jump tables.  You could do this in C by creating a function:</p>
<div class="codecolorer-container c blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333;">void</span> do_jump_table<span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> choice<span style="color: #339933;">,</span> <span style="color: #993333;">void</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>array_of_functions<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span> <span style="color: #993333;">void</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span>array_of_functions<span style="color: #009900;">&#91;</span>choice<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
...
<span style="color: #993333;">void</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>my_jump_table<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span> <span style="color: #993333;">void</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> foo<span style="color: #339933;">,</span> bar<span style="color: #339933;">,</span> baz<span style="color: #339933;">,</span> cat<span style="color: #339933;">,</span> dog<span style="color: #339933;">,</span> horse<span style="color: #339933;">,</span> tick <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
do_jump_table<span style="color: #009900;">&#40;</span> choice<span style="color: #339933;">,</span> my_jump_table <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div>
<p>That will work for you as long it&#8217;s okay that all of your functions have the same signature, you don&#8217;t mind the overhead of the extra function call to <em>do_jump_table()</em>, you don&#8217;t mind making a separate function for each different jump table option, and your choice never stumbles past the end of the jump table.  You can do it this way in Lisp if you like, too (without having to write a different <em>do_jump_table</em> for every different return-type you might like from your jump tables.</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> do-jump-table <span style="color: #66cc66;">&#40;</span>choice array-of-functions<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">funcall</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">aref</span> array-of-functions choice<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">...</span>
<span style="color: #66cc66;">&#40;</span>do-jump-table choice #<span style="color: #66cc66;">&lt;</span> #'foo<span style="color: #66cc66;">,</span> #'bar<span style="color: #66cc66;">,</span> #'baz<span style="color: #66cc66;">,</span> #'cat<span style="color: #66cc66;">,</span> #'dog<span style="color: #66cc66;">,</span> #'horse<span style="color: #66cc66;">,</span> #'tick <span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>What if you do care about the overhead of the extra function call to <em>do_jump_table()</em>, you do mind making a separate function for each different jump table option, or you are concerned about doing something graceful when your choice stumbles past the end of the jump table?   You could address that last concern with more error checking and, in the C case, more parameters to the function.  The other concerns are tougher though.</p>
<p>If we don&#8217;t want to have to write separate <em>foo</em>, <em>bar</em>, <em>baz</em>, etc. functions, then we want to try this with macros.  Rather than taking an array of function pointers, we&#8217;re going to let it take some variable number of statements&#8212;one for each case in the jump table.  Let&#8217;s start with the Lisp version:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defmacro</span> do-jump-table <span style="color: #66cc66;">&#40;</span> choice <span style="color: #66cc66;">&amp;</span>rest options <span style="color: #66cc66;">&#41;</span>
  `<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">case</span> <span style="color: #66cc66;">,</span>choice
     <span style="color: #66cc66;">,</span>@<span style="color: #66cc66;">&#40;</span>loop for ii from <span style="color: #cc66cc;">0</span>
            for oo in options
            collecting <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">list</span> ii oo<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
     <span style="color: #66cc66;">&#40;</span>otherwise <span style="color: #66cc66;">&#40;</span>do-something-graceful<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>Then, we could use it with some code like this:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span>do-jump-table op-code
               <span style="color: #66cc66;">&#40;</span>write <span style="color: #ff0000;">&quot;NOOP&quot;</span><span style="color: #66cc66;">&#41;</span>
               <span style="color: #66cc66;">&#40;</span>write <span style="color: #ff0000;">&quot;SYNC&quot;</span><span style="color: #66cc66;">&#41;</span>
               <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">when</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&gt;=</span> +protocol-version+ <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
                 <span style="color: #66cc66;">&#40;</span>write <span style="color: #ff0000;">&quot;QUIT&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>This would expand to:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">case</span> op-code
  <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#40;</span>write <span style="color: #ff0000;">&quot;NOOP&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#40;</span>write <span style="color: #ff0000;">&quot;SYNC&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">when</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&gt;=</span> +protocol-version+ <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
       <span style="color: #66cc66;">&#40;</span>write <span style="color: #ff0000;">&quot;QUIT&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>otherwise <span style="color: #66cc66;">&#40;</span>do-something-graceful<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>I challenge you to make such a macro in C, C++, TeX, m4, or nroff.  I&#8217;ve written lots of custom C programs in the past to preprocess my code before sending it to the C preprocessor and the C compiler.  In Lisp, it&#8217;s all right there.  I can use all of Lisp&#8217;s magic to turn my code into the code I want it to become.  No temporary files.  No fancy Makefile tricks to get everything squared away.  It&#8217;s just all there.</p>
<h3>What don&#8217;t I know?</h3>
<p>The <em>do-jump-table</em> macro we just defined expands to one statement (one lisp form): <em>(CASE&nbsp;&#8230;)</em>.  There are many times when I want my macro to expand to more than one form, however.  This isn&#8217;t legit.  I still end up wanting to do it.  For example, I might think that since I&#8217;m doing things with macros, that I might want the whole <em>(CASE&nbsp;&#8230;)</em> construct to be in the main code and just have the macro expand the different cases:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">case</span> op-code
    <span style="color: #66cc66;">&#40;</span>do-jump-table-cases <span style="color: #66cc66;">&#40;</span>write <span style="color: #ff0000;">&quot;NOOP&quot;</span><span style="color: #66cc66;">&#41;</span>
                         <span style="color: #66cc66;">&#40;</span>write <span style="color: #ff0000;">&quot;SYNC&quot;</span><span style="color: #66cc66;">&#41;</span>
                         <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">when</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&gt;=</span> +protocol-version+ <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
                             <span style="color: #66cc66;">&#40;</span>write <span style="color: #ff0000;">&quot;QUIT&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>otherwise <span style="color: #66cc66;">&#40;</span>do-something-especially-graceful<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>Lisp says no.  I can understand why it says that.  In this case, it&#8217;s easy enough to work around.  But, in other cases, I end up flailing.</p>
<p>I feel that once I understand Lisp macros more completely, I won&#8217;t keep trying to jam that gorgeous, round peg into all of these square holes in my logic.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/06/how-i-know-i-dont-know-enough-about-lisp-macros/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

