<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Porting Perl&#8217;s qq to Common Lisp</title>
	<atom:link href="http://blog.viridian-project.de/2008/07/07/porting-perls-qq-to-common-lisp/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.viridian-project.de/2008/07/07/porting-perls-qq-to-common-lisp/</link>
	<description>Leslie P. Polzer on code, music, literature, design and free software business.</description>
	<lastBuildDate>Fri, 09 Dec 2011 14:52:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: budden</title>
		<link>http://blog.viridian-project.de/2008/07/07/porting-perls-qq-to-common-lisp/comment-page-1/#comment-20035</link>
		<dc:creator>budden</dc:creator>
		<pubDate>Fri, 03 Apr 2009 10:39:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.viridian-project.de/?p=84#comment-20035</guid>
		<description>Hi Leslie!
  What about 
http://paste.lisp.org/display/77963
  This way, you won&#039;t mislead emacs.</description>
		<content:encoded><![CDATA[<p>Hi Leslie!<br />
  What about<br />
<a href="http://paste.lisp.org/display/77963" rel="nofollow">http://paste.lisp.org/display/77963</a><br />
  This way, you won&#8217;t mislead emacs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Bensen</title>
		<link>http://blog.viridian-project.de/2008/07/07/porting-perls-qq-to-common-lisp/comment-page-1/#comment-16384</link>
		<dc:creator>Dan Bensen</dc:creator>
		<pubDate>Tue, 17 Feb 2009 18:55:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.viridian-project.de/?p=84#comment-16384</guid>
		<description>If you don&#039;t want to deal with variable capture, you can always specify the variable&#039;s name:
&lt;pre&gt;
  (defmacro if-let (var test then else)
    `(let ((,var ,test))
       (if ,var
         ,then
         ,else)))
&lt;/pre&gt;
Nice code, Leslie.  It&#039;s good to see Lisp stealing useful features from other languages :)</description>
		<content:encoded><![CDATA[<p>If you don&#8217;t want to deal with variable capture, you can always specify the variable&#8217;s name:</p>
<pre>
  (defmacro if-let (var test then else)
    `(let ((,var ,test))
       (if ,var
         ,then
         ,else)))
</pre>
<p>Nice code, Leslie.  It&#8217;s good to see Lisp stealing useful features from other languages :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leslie</title>
		<link>http://blog.viridian-project.de/2008/07/07/porting-perls-qq-to-common-lisp/comment-page-1/#comment-4909</link>
		<dc:creator>Leslie</dc:creator>
		<pubDate>Wed, 09 Jul 2008 07:35:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.viridian-project.de/?p=84#comment-4909</guid>
		<description>A small change in the parser, the definition of the balanced characters. I also took the liberty of using anaphoric if.

&lt;pre lang=&quot;lisp&quot;&gt;
(defparameter *balanced-chars* &#039;((#\( . #\))
                                 (#\[ . #\])
                                 (#\{ . #\})))

(defmacro aif (test then else)
  `(let ((it ,test))
     (if it
       ,then
       ,else)))

(defun &#124;#q-reader&#124; (stream sub-char numarg)
  (declare (ignore sub-char numarg))
  (let* ((terminator (read-char stream))
         (terminator (aif (assoc terminator *balanced-chars*)
                          (cdr it)
                          terminator)))
    (loop for ch = (read-char stream)
          until (eql ch terminator)
          collect ch into chars
          finally (return (coerce chars &#039;string)))))

(set-dispatch-macro-character
    #\# #\q #&#039;&#124;#q-reader&#124;)
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>A small change in the parser, the definition of the balanced characters. I also took the liberty of using anaphoric if.</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>defparameter *balanced-chars* '<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>#\<span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">.</span> #\<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
                                 <span style="color: #66cc66;">&#40;</span>#\<span style="color: #66cc66;">&#91;</span> <span style="color: #66cc66;">.</span> #\<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
                                 <span style="color: #66cc66;">&#40;</span>#\<span style="color: #66cc66;">&#123;</span> <span style="color: #66cc66;">.</span> #\<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defmacro</span> aif <span style="color: #66cc66;">&#40;</span>test then else<span style="color: #66cc66;">&#41;</span>
  `<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>it <span style="color: #66cc66;">,</span>test<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
     <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> it
       <span style="color: #66cc66;">,</span>then
       <span style="color: #66cc66;">,</span>else<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> <span style="color: #66cc66;">|</span>#q-reader<span style="color: #66cc66;">|</span> <span style="color: #66cc66;">&#40;</span>stream sub-char numarg<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>declare <span style="color: #66cc66;">&#40;</span>ignore sub-char numarg<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span>* <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>terminator <span style="color: #66cc66;">&#40;</span>read-char stream<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
         <span style="color: #66cc66;">&#40;</span>terminator <span style="color: #66cc66;">&#40;</span>aif <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">assoc</span> terminator *balanced-chars*<span style="color: #66cc66;">&#41;</span>
                          <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cdr</span> it<span style="color: #66cc66;">&#41;</span>
                          terminator<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>loop for ch <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>read-char stream<span style="color: #66cc66;">&#41;</span>
          until <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">eql</span> ch terminator<span style="color: #66cc66;">&#41;</span>
          collect ch into chars
          finally <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span>coerce chars 'string<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>set-dispatch-macro-character
    #\# #\q #'<span style="color: #66cc66;">|</span>#q-reader<span style="color: #66cc66;">|</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Jarkko Hietaniemi</title>
		<link>http://blog.viridian-project.de/2008/07/07/porting-perls-qq-to-common-lisp/comment-page-1/#comment-4906</link>
		<dc:creator>Jarkko Hietaniemi</dc:creator>
		<pubDate>Wed, 09 Jul 2008 03:23:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.viridian-project.de/?p=84#comment-4906</guid>
		<description>How much more trickery would be needed to allow also for balanced delimiters?

qq()
qq[]
qq{}
qq</description>
		<content:encoded><![CDATA[<p>How much more trickery would be needed to allow also for balanced delimiters?</p>
<p>qq()<br />
qq[]<br />
qq{}<br />
qq</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leslie</title>
		<link>http://blog.viridian-project.de/2008/07/07/porting-perls-qq-to-common-lisp/comment-page-1/#comment-4896</link>
		<dc:creator>Leslie</dc:creator>
		<pubDate>Tue, 08 Jul 2008 12:55:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.viridian-project.de/?p=84#comment-4896</guid>
		<description>That&#039;s nice. I know about CL-INTERPOL, but I thought it just interpolates strings via its read macro.</description>
		<content:encoded><![CDATA[<p>That&#8217;s nice. I know about CL-INTERPOL, but I thought it just interpolates strings via its read macro.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Davis</title>
		<link>http://blog.viridian-project.de/2008/07/07/porting-perls-qq-to-common-lisp/comment-page-1/#comment-4894</link>
		<dc:creator>Ryan Davis</dc:creator>
		<pubDate>Tue, 08 Jul 2008 12:39:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.viridian-project.de/?p=84#comment-4894</guid>
		<description>CL-INTERPOL (http://www.weitz.de/cl-interpol/) is a library for string interpolation, and has this flexible quoting you lay out here.</description>
		<content:encoded><![CDATA[<p>CL-INTERPOL (<a href="http://www.weitz.de/cl-interpol/" rel="nofollow">http://www.weitz.de/cl-interpol/</a>) is a library for string interpolation, and has this flexible quoting you lay out here.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

