<?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"
	>
<channel>
	<title>Comments on: Simple SparkLine Generator in Clojure</title>
	<atom:link href="http://jonathanwatmough.com/2008/02/simple-sparkline-generator-in-clojure/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanwatmough.com/2008/02/simple-sparkline-generator-in-clojure/</link>
	<description>Jonathan</description>
	<pubDate>Thu, 09 Sep 2010 22:35:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: Michael Mellinger</title>
		<link>http://jonathanwatmough.com/2008/02/simple-sparkline-generator-in-clojure/#comment-111396</link>
		<dc:creator>Michael Mellinger</dc:creator>
		<pubDate>Wed, 02 Sep 2009 13:14:59 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanwatmough.com/?p=220#comment-111396</guid>
		<description>Diff file:
----------------------------------------
30,33c30,33
&#60;     (do (doto g (setColor (. java.awt.Color white))
&#60;                 (fillRect 0 0 w h)
&#60;                 (setColor (. java.awt.Color gray)))
     (do (doto g (.setColor (. java.awt.Color white))
&#62;                 (.fillRect 0 0 w h)
&#62;                 (.setColor (. java.awt.Color gray)))
&#62;         (dotimes [idx (dec (count v))]
43,44c43,44
&#60;               (doto g (setColor (. java.awt.Color red))
               (doto g (.setColor (. java.awt.Color red))
&#62;                       (.fillOval bx by 2 2))))
57,59c57,59
&#60;       (add (new javax.swing.JLabel icon))
&#60;       (pack)
       (.add (new javax.swing.JLabel icon))
&#62;       (.pack)
&#62;       (.setVisible true))))</description>
		<content:encoded><![CDATA[<p>Diff file:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
30,33c30,33<br />
&lt;     (do (doto g (setColor (. java.awt.Color white))<br />
&lt;                 (fillRect 0 0 w h)<br />
&lt;                 (setColor (. java.awt.Color gray)))<br />
     (do (doto g (.setColor (. java.awt.Color white))<br />
&gt;                 (.fillRect 0 0 w h)<br />
&gt;                 (.setColor (. java.awt.Color gray)))<br />
&gt;         (dotimes [idx (dec (count v))]<br />
43,44c43,44<br />
&lt;               (doto g (setColor (. java.awt.Color red))<br />
               (doto g (.setColor (. java.awt.Color red))<br />
&gt;                       (.fillOval bx by 2 2))))<br />
57,59c57,59<br />
&lt;       (add (new javax.swing.JLabel icon))<br />
&lt;       (pack)<br />
       (.add (new javax.swing.JLabel icon))<br />
&gt;       (.pack)<br />
&gt;       (.setVisible true))))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aron</title>
		<link>http://jonathanwatmough.com/2008/02/simple-sparkline-generator-in-clojure/#comment-96150</link>
		<dc:creator>Aron</dc:creator>
		<pubDate>Sat, 21 Mar 2009 23:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanwatmough.com/?p=220#comment-96150</guid>
		<description>Hi. Thanks for writing this sample code. I ran into two problems running sparklines.clj as written (against clojure-20090320).

1. Calls against Java objects within (doto ..) needed to be .method.
    (setColor ...) -&#62; (.setColor ...)
Changed: setColor, fillRect, fillOval, add, pack, setVisible

2. dotimes takes a vector.
    (dotimes idx (count v) ...)
becomes
    (dotimes [idx (dec (count v))] ...)
The (dec ...) was necessary to avoid an out-of-bounds index exception from:
    this-val (nth v (inc idx))
on the last iteration.</description>
		<content:encoded><![CDATA[<p>Hi. Thanks for writing this sample code. I ran into two problems running sparklines.clj as written (against clojure-20090320).</p>
<p>1. Calls against Java objects within (doto ..) needed to be .method.<br />
    (setColor &#8230;) -&gt; (.setColor &#8230;)<br />
Changed: setColor, fillRect, fillOval, add, pack, setVisible</p>
<p>2. dotimes takes a vector.<br />
    (dotimes idx (count v) &#8230;)<br />
becomes<br />
    (dotimes [idx (dec (count v))] &#8230;)<br />
The (dec &#8230;) was necessary to avoid an out-of-bounds index exception from:<br />
    this-val (nth v (inc idx))<br />
on the last iteration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavin</title>
		<link>http://jonathanwatmough.com/2008/02/simple-sparkline-generator-in-clojure/#comment-85412</link>
		<dc:creator>Gavin</dc:creator>
		<pubDate>Wed, 07 Jan 2009 23:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanwatmough.com/?p=220#comment-85412</guid>
		<description>Cool.  Good to see some well-written example code out there to learn from.

One thing I noticed is that it was written before the Java interop macros were implemented.  You could shorted probably every s-exp containing Java.  E.g. (. bitmap (getGraphics))  --&#62;  (.getGraphics bitmap)

Whether it's worthwhile is up to you.</description>
		<content:encoded><![CDATA[<p>Cool.  Good to see some well-written example code out there to learn from.</p>
<p>One thing I noticed is that it was written before the Java interop macros were implemented.  You could shorted probably every s-exp containing Java.  E.g. (. bitmap (getGraphics))  &#8211;&gt;  (.getGraphics bitmap)</p>
<p>Whether it&#8217;s worthwhile is up to you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: newlisper</title>
		<link>http://jonathanwatmough.com/2008/02/simple-sparkline-generator-in-clojure/#comment-28060</link>
		<dc:creator>newlisper</dc:creator>
		<pubDate>Fri, 29 Feb 2008 23:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanwatmough.com/?p=220#comment-28060</guid>
		<description>Nice - I've only seen a few positive references to Clojure, and it looks fascinating. It's interesting to see the way you mix Lisp and Java together - even if the class names look a bit scary. 

You might be interested to see the sparkline generator I did. I only saw your version after I did mine, so I may be able to improve my code after seeing yours.

Will have to look at Clojure soon.</description>
		<content:encoded><![CDATA[<p>Nice - I&#8217;ve only seen a few positive references to Clojure, and it looks fascinating. It&#8217;s interesting to see the way you mix Lisp and Java together - even if the class names look a bit scary. </p>
<p>You might be interested to see the sparkline generator I did. I only saw your version after I did mine, so I may be able to improve my code after seeing yours.</p>
<p>Will have to look at Clojure soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hitesh</title>
		<link>http://jonathanwatmough.com/2008/02/simple-sparkline-generator-in-clojure/#comment-27997</link>
		<dc:creator>hitesh</dc:creator>
		<pubDate>Fri, 29 Feb 2008 06:43:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanwatmough.com/?p=220#comment-27997</guid>
		<description>Nice.  I like the Lispishness of Clojure.  It might be something I'd consider if I had to write code running on the JVM.</description>
		<content:encoded><![CDATA[<p>Nice.  I like the Lispishness of Clojure.  It might be something I&#8217;d consider if I had to write code running on the JVM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich Hickey</title>
		<link>http://jonathanwatmough.com/2008/02/simple-sparkline-generator-in-clojure/#comment-27923</link>
		<dc:creator>Rich Hickey</dc:creator>
		<pubDate>Thu, 28 Feb 2008 14:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanwatmough.com/?p=220#comment-27923</guid>
		<description>You might want to try destructuring in let:

(let [{w :width h :height v :values} data] ...</description>
		<content:encoded><![CDATA[<p>You might want to try destructuring in let:</p>
<p>(let [{w :width h :height v :values} data] &#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
