<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"> <channel><title>Foognostic blogs</title> <link>http://blogs.foognostic.net</link> <description>Seeking knowledge of foo</description> <lastBuildDate>Thu, 24 Feb 2011 23:17:24 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/foognostic" /><feedburner:info uri="foognostic" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><item><title>Parens in uncomfortable places</title><link>http://feedproxy.google.com/~r/foognostic/~3/SGQlMw8rJ4Y/</link> <comments>http://blogs.foognostic.net/2011/01/parens-in-uncomfortable-places/#comments</comments> <pubDate>Thu, 20 Jan 2011 04:12:23 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[clojure]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=399</guid> <description><![CDATA[Because my chances of writing Clojure code increase as the number of my peers writing Clojure increases, I have put time, energy, and money into encouraging others to write more Clojure code. This doesn't mean cramming Clojure into every possible nook and cranny. In some environments it's easy to become persona non grata by introducing [...]]]></description> <content:encoded><![CDATA[<p>Because my chances of writing Clojure code increase as the number of my peers
writing Clojure increases, I have put time, energy, and money into
encouraging others to write more Clojure code.</p><p>This doesn't mean cramming Clojure into every possible nook and
cranny. In some environments it's easy to become persona non grata by
introducing ANYthing which is perceived to be relatively difficult to
find support for.</p><p>I will also not back down from my opinion that any programming language
biased towards immutability should not be learned in production,
especially a language with parentheses in uncomfortable places. I will
claim that spending time with a Clojure REPL will lead to a series of quiet
a-HA! moments... just not as predictably as needed in production.</p><p>So why care? Because those lusty, quiet epiphanies are really
valuable. They are quick leaps towards a broader perspective on
programming. One where the paradox of a high-level low-level language
is put to good use. Don't take my word on it, check out what ESR <a
href="http://www.catb.org/~esr/faqs/hacker-howto.html#skills1">says
about Lisp</a>.</p><p>As one of the proud 429 <a
href="http://clojure.org/funders">funders</a> of Clojure, I encourage you to <a
href="http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started">get
started learning</a> Clojure. Or, if you know some already then try
to become a <a
href="http://lotrepls.appspot.com/">lord of the REPL</a>.</p> <img src="http://feeds.feedburner.com/~r/foognostic/~4/SGQlMw8rJ4Y" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2011/01/parens-in-uncomfortable-places/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2011/01/parens-in-uncomfortable-places/</feedburner:origLink></item> <item><title>A quick tour of labrepl</title><link>http://feedproxy.google.com/~r/foognostic/~3/9VCxn6Y741Y/</link> <comments>http://blogs.foognostic.net/2010/04/a-quick-tour-of-labrepl/#comments</comments> <pubDate>Fri, 23 Apr 2010 12:45:34 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[clojure]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=388</guid> <description><![CDATA[A quick tour of labrepl is something I put together for the Washington DC Clojure meetup. Relevance did a great job with labrepl and graciously made it freely available. It works great for instructor-led training and is clearly designed to work in a self-study context. I added a little bit of background describing it and [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://foognostic.net/labrepl-summary/">A quick tour of labrepl</a> is something I put together for the Washington DC <a
target="top" href="http://www.meetup.com/Cap-Clug">Clojure meetup</a>. Relevance did a great job with <a
target="top" href="http://github.com/relevance/labrepl/">labrepl</a> and graciously made it freely available. It works great for instructor-led training and is clearly designed to work in a self-study context. I added a little bit of background describing it and a couple of ways you could take different paths through it to cover just the basics, go far enough to actually write some code, or even jump straight to some of the more interesting topics of Clojure which labrepl features.</p><p>Many thanks to the awesome @<a
target="top" href="http://twitter.com/brweber2">brweber2</a> for presenting <a
href="http://foognostic.net/labrepl-summary/">a quick tour of labrepl</a>.</p> <img src="http://feeds.feedburner.com/~r/foognostic/~4/9VCxn6Y741Y" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2010/04/a-quick-tour-of-labrepl/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2010/04/a-quick-tour-of-labrepl/</feedburner:origLink></item> <item><title>Want to get started with Clojure?</title><link>http://feedproxy.google.com/~r/foognostic/~3/-KpM-_u-o0c/</link> <comments>http://blogs.foognostic.net/2010/04/want-to-get-started-with-clojure/#comments</comments> <pubDate>Wed, 07 Apr 2010 12:22:59 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[clojure]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=383</guid> <description><![CDATA[Randomly curious about Clojure, but not quite sure how to get started? Members of the Clojure community have established this page as the best place to find current, complete instructions for using Clojure in your favorite IDE. Unless of course NOTEPAD.EXE is your thing... and who wants to go down the path of manually adding [...]]]></description> <content:encoded><![CDATA[<p>Randomly curious about <a
href="http://clojure.org/">Clojure</a>, but not quite sure how to get started? Members of the Clojure community have established <a
href="http://www.assembla.com/wiki/show/clojure/Getting_Started">this page</a> as the best place to find current, complete instructions for using Clojure in your favorite IDE.</p><p>Unless of course NOTEPAD.EXE is your thing... and who wants to go down the path of manually adding ))))))? Let an editor manage that for you!</p> <img src="http://feeds.feedburner.com/~r/foognostic/~4/-KpM-_u-o0c" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2010/04/want-to-get-started-with-clojure/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2010/04/want-to-get-started-with-clojure/</feedburner:origLink></item> <item><title>A swank growl</title><link>http://feedproxy.google.com/~r/foognostic/~3/c2FnvOjgx0o/</link> <comments>http://blogs.foognostic.net/2010/02/a-swank-growl/#comments</comments> <pubDate>Tue, 09 Feb 2010 03:55:32 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[clojure]]></category> <category><![CDATA[code]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=373</guid> <description><![CDATA[I ran into a frustrating puzzle while learning about agents in Clojure. The problem was with a tool, not Clojure itself but a few neat things shook out along the way. Agents in Clojure are a high level concept for concurrency. They are intended for independent, asynchronous data munging. They're pretty easy to use... basically [...]]]></description> <content:encoded><![CDATA[<p>I ran into a frustrating puzzle while learning about <a
href="http://clojure.org/agents">agents</a> in Clojure. The problem was with a tool, not Clojure itself but a few neat things shook out along the way.</p><p>Agents in Clojure are a high level concept for concurrency. They are intended for independent, asynchronous data munging. They're pretty easy to use... basically a value is associated with an agent when it is created, and then when a function is applied to the agent the result becomes its new value.</p><p>Here is the definition of a banana agent:</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure 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;">def</span> banana <span
style="color: #66cc66;">&#40;</span>agent <span
style="color: #ff0000;">&quot;ba&quot;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span></div></div><p>Here is the function which produces its new value:</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure 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;">defn</span> tally-man <span
style="color: #66cc66;">&#91;</span>berry<span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">let</span> <span
style="color: #66cc66;">&#91;</span>input berry, output <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">str</span> berry <span
style="color: #ff0000;">&quot;na&quot;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; &nbsp; <span
style="color: #66cc66;">&#40;</span>println <span
style="color: #66cc66;">&#40;</span>format <span
style="color: #ff0000;">&quot;input:output %s:%s&quot;</span> input output<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp; output<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span></div></div><p>Here it is in action:</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">user&gt; <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">def</span> banana <span
style="color: #66cc66;">&#40;</span>agent <span
style="color: #ff0000;">&quot;ba&quot;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> <span
style="color: #66cc66;">&#40;</span>await <span
style="color: #66cc66;">&#40;</span>send banana tally-man<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> @banana<br
/> <br
/> <span
style="color: #ff0000;">&quot;bana&quot;</span><br
/> user&gt; <span
style="color: #66cc66;">&#40;</span>await <span
style="color: #66cc66;">&#40;</span>send banana tally-man<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> @banana<br
/> <br
/> <span
style="color: #ff0000;">&quot;banana&quot;</span></div></div><p>The debug statements are missing! Code invoked by (send) doesn't yield output to the REPL -- it went to a different buffer.</p><p>The major symptom of my pernicious problem was that my precious debug statements weren't printing anything. This was a major problem since that was the only way I had to know what was happening. At this point it's important to disclose that I am an unrepentant GNU/Emacs user. This leads to using <a
href="http://github.com/technomancy/swank-clojure">swank-clojure</a> since a symbiotic REPL is really, really cool.</p><p>After much confusion I finally found my precious debug statements! They were hiding in the rarely-used <b><em>inferior-lisp</em></b> buffer. It's awkward for me to keep this buffer open so I looked for something... cooler.</p><p><a
href="http://growl.info/">Growl</a> is a MacOS X utility which displays notifications in self-dismissing windows. The gap between Clojure and Growl is little more than implementing java.io.Writer. Clojure actually makes it easier than it should be.</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure 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;">defn</span> growl <span
style="color: #66cc66;">&#91;</span>msg<span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; <span
style="color: #66cc66;">&#40;</span>.exec <span
style="color: #66cc66;">&#40;</span>Runtime/getRuntime<span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">str</span> <span
style="color: #ff0000;">&quot;/path/to/growlnotify -a emacs -m &quot;</span> msg<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> <br
/> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">def</span> growler<br
/> &nbsp; <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">proxy</span><br
/> &nbsp; &nbsp; <span
style="color: #66cc66;">&#91;</span>java.io.Writer<span
style="color: #66cc66;">&#93;</span> <span
style="color: #66cc66;">&#91;</span><span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; &nbsp; <span
style="color: #66cc66;">&#40;</span>flush <span
style="color: #66cc66;">&#91;</span><span
style="color: #66cc66;">&#93;</span> <span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp; <span
style="color: #66cc66;">&#40;</span>write <span
style="color: #66cc66;">&#91;</span>text<span
style="color: #66cc66;">&#93;</span> <span
style="color: #66cc66;">&#40;</span>growl text<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span></div></div><p>It's worth taking a close look at the proxy statement, specifically the write method. It is an abstract, overloaded method in <a
href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Writer.html">Writer</a>. Only one of those overloads is abstract, and it's <b>NOT</b> the one implemented above. The one implemented above is the only one actually called. Or, you know, <a
href="http://en.wikipedia.org/wiki/Duck_typing">quacked</a>. That's neat! I didn't even have to implement all of the abstract methods! All I had to do is what I actually needed to do.</p><p>The last piece of the puzzle was making Clojure use the Growl bridge. The <a
href="http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/binding">binding</a> function made this happen with <b>one line of code</b>. <em>out</em> is the &quot;variable&quot; which Clojure uses for writing to standard out. A call to (binding) gives <em>out</em> a new value. and the old value is restored when (binding) exits. All of the compiled references to <em>out</em> within Clojure automatically use my binding. TOO COOL.</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure 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;">defn</span> tally-man <span
style="color: #66cc66;">&#91;</span>berry<span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">let</span> <span
style="color: #66cc66;">&#91;</span>input berry, output <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">str</span> berry <span
style="color: #ff0000;">&quot;na&quot;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; &nbsp; <span
style="color: #66cc66;">&#40;</span>binding <span
style="color: #66cc66;">&#91;</span>*out* growler<span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #66cc66;">&#40;</span>println <span
style="color: #66cc66;">&#40;</span>format <span
style="color: #ff0000;">&quot;input:output %s:%s&quot;</span> input output<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; output<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span></div></div><p>Ta DA! <img
alt="" src="http://static.foognostic.net/growl.png" title="Growl" class="alignnone" width="286" height="57" /></p> <img src="http://feeds.feedburner.com/~r/foognostic/~4/c2FnvOjgx0o" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2010/02/a-swank-growl/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2010/02/a-swank-growl/</feedburner:origLink></item> <item><title>My week of Clojure and Emacs</title><link>http://feedproxy.google.com/~r/foognostic/~3/K_ce1Zaqzu4/</link> <comments>http://blogs.foognostic.net/2010/01/my-week-of-clojure-and-emacs/#comments</comments> <pubDate>Wed, 27 Jan 2010 04:59:29 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[clojure]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=362</guid> <description><![CDATA[This week has been very busy and useful for me with Clojure and Emacs. Clojure I continued to mature Pokerepl. The interfaces/defprotocols were reorganized into one file. Implementations/deftypes each have their own file. Switched Leiningen branch from stable to master (think 1.1 alpha) and chopped out all those :gen-class warts Lightly adopted @cemerick's very cool [...]]]></description> <content:encoded><![CDATA[<p>This week has been very busy and useful for me with Clojure and Emacs.</p><h3>Clojure</h3><ul><li>I continued to mature <a
href="http://bitbucket.org/seths/pokerepl/src/">Pokerepl</a>. The interfaces/defprotocols were reorganized into one file. Implementations/deftypes each have their own file.</li><li>Switched <a
href="http://github.com/technomancy/leiningen">Leiningen</a> branch from stable to master (think 1.1 alpha) and chopped out all those :gen-class warts</li><li>Lightly adopted <a
href="http://twitter.com/cemerick">@cemerick</a>'s <strong>very cool</strong> <a
href="http://muckandbrass.com/web/display/~cemerick/2009/12/04/String+Interpolation+in+Clojure">string interpolation</a> macro -- it's the #{bar} in "foo #{bar}".<li>Got Nailgun working to <a
href="http://groups.google.com/group/leiningen/browse_thread/thread/66c6c72dba4bbd47">speed up unit tests</a>.</li><li>But <a
href="http://twitter.com/technomancy">@technomancy</a> pointed out that I could use TONS less memory and have a better experience with <a
href="http://github.com/technomancy/clojure-mode/blob/master/clojure-test-mode.el">clojure-test-mode</a>. It runs instantly and highlights errors:</li></ul><p><img
src="http://foognostic.net/clojure-test-mode.png" alt="Image of a test failing" /></p><h3>Emacs</h3><ul><li>I~ stopped~ backup~ files~ from~ appearing~ everywhere~ (thanks to <a
href="http://github.com/technomancy/emacs-starter-kit">ESK</a> for clueing me in to backup-directory-alist)</li><li>Stopped avoiding <a
href="http://gnuemacscolorthemetest.googlecode.com/svn/html/index-el.html">color-theme</a> <strong>finally</strong>. Using the rotor and late-night themes mostly, but will probably have to write my own at some point. It will be ugly, but such are my aesthetics.</li><li>Now using and happy with the <a
href="http://www.levien.com/type/myfonts/inconsolata.html">Inconsolata</a> typeface.</li><li>I installed but still shy away from paredit-mode. It's my own fault for not having watched this <a
href="http://www.slideshare.net/mudphone/paredit-preso">awesome preso</a> yet.</li></ul> <img src="http://feeds.feedburner.com/~r/foognostic/~4/K_ce1Zaqzu4" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2010/01/my-week-of-clojure-and-emacs/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2010/01/my-week-of-clojure-and-emacs/</feedburner:origLink></item> <item><title>Wrapping deftype factory methods</title><link>http://feedproxy.google.com/~r/foognostic/~3/-tYPLry9xK4/</link> <comments>http://blogs.foognostic.net/2010/01/wrapping-deftype-factory-methods/#comments</comments> <pubDate>Tue, 19 Jan 2010 02:35:47 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[clojure]]></category> <category><![CDATA[code]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=349</guid> <description><![CDATA[(Standard disclaimer: Clojure is a new hobby.) I'm exploring the upcoming feature in Clojure called deftype. Similar to defining a class in Java, deftype is a way of grouping related data and methods. Actually, it's quite an improvement over the old (defstruct) way. defstruct only groups related data together. As ever, code examples are based [...]]]></description> <content:encoded><![CDATA[<p>(Standard disclaimer: <a
href="http://blogs.foognostic.net/disclaimer-clojure-is-a-new-hobby/">Clojure is a new hobby.</a>)</p><p>I'm exploring the upcoming feature in Clojure called <a
href="http://www.assembla.com/wiki/show/clojure/Datatypes">deftype</a>. Similar to defining a class in Java, deftype is a way of grouping related data and methods. Actually, it's quite an improvement over the old (defstruct) way. defstruct only groups related data together.</p><p>As ever, code examples are based on my side project <a
href="http://bitbucket.org/seths/pokerepl/src/">pokerepl</a>. This entire post focuses on the suits and values in a deck of playing cards.</p><p>Here's the old way of doing things:</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #808080; font-style: italic;">;; define the struct</span><br
/> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">defstruct</span> Card :value :suit<span
style="color: #66cc66;">&#41;</span><br
/> <br
/> <span
style="color: #808080; font-style: italic;">;; instantiate it</span><br
/> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">def</span> card <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">struct</span> Card :ace :spades<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span></div></div><p>Here's my first baby step down the new path:</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #66cc66;">&#40;</span>deftype Card <span
style="color: #66cc66;">&#91;</span>#^clojure.lang.Keyword value<br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#^clojure.lang.Keyword suit<span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; Object<br
/> &nbsp; <span
style="color: #66cc66;">&#40;</span>toString <span
style="color: #66cc66;">&#91;</span><span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">str</span> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">get</span> value-<span
style="color: #b1b100;">map</span> value <span
style="color: #ff0000;">&quot;?&quot;</span><span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">get</span> suit-<span
style="color: #b1b100;">map</span> suit <span
style="color: #ff0000;">&quot;?&quot;</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><br
/> <br
/> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">def</span> card <span
style="color: #66cc66;">&#40;</span>Card :ace :spades<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span></div></div><p>It's longer, but it does more. We get <strong>optional</strong> type hinting for the data (seen here as #^clojure.lang.Keyword). The type being extended is listed (Object in this case). The override of Object.toString means all instances will be pretty printed automatically.</p><p>What you don't see is a &quot;constructor&quot;. There's no need because Clojure provides reasonable defaults here; the values for &quot;value&quot; and &quot;suit&quot; are passed to new instances of Card.</p><p>Unfortunately that wasn't good enough. Fortunately Clojure is a very dynamic programming language, so I could <strong>easily</strong> replace the implicitly defined factory function with my own code. To summarize, a call to (deftype Foo [bar]) generates two factory functions (Foo [bar]) and (Foo [bar meta-map ext-map]). It's possible to overwrite these but unclear how to honor the postconditions... exactly what gets returned?</p><p>So rather than replace the factory function entirely, I decided to embrace and extend it!</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure 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;">def</span> old-Card Card<span
style="color: #66cc66;">&#41;</span><br
/> <br
/> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">defn</span> Card<br
/> &nbsp; <span
style="color: #66cc66;">&#40;</span><span
style="color: #66cc66;">&#91;</span>two-chars<span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; &nbsp; &nbsp;<span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">apply</span> Card <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">map</span> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">partial</span> <span
style="color: #b1b100;">nth</span> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">seq</span> two-chars<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span> <span
style="color: #66cc66;">&#91;</span>0 1<span
style="color: #66cc66;">&#93;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> <br
/> &nbsp; <span
style="color: #66cc66;">&#40;</span><span
style="color: #66cc66;">&#91;</span>value suit<span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; &nbsp; &nbsp;<span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">let</span> <span
style="color: #66cc66;">&#91;</span>value-sym <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">if</span> <span
style="color: #66cc66;">&#40;</span>= clojure.lang.Keyword <span
style="color: #66cc66;">&#40;</span>class value<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value<br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">get</span> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">zipmap</span> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">vals</span> value-<span
style="color: #b1b100;">map</span><span
style="color: #66cc66;">&#41;</span> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">keys</span> value-<span
style="color: #b1b100;">map</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span> value<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;suit-sym <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">if</span> <span
style="color: #66cc66;">&#40;</span>= clojure.lang.Keyword <span
style="color: #66cc66;">&#40;</span>class suit<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; suit<br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">get</span> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">zipmap</span> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">vals</span> suit-<span
style="color: #b1b100;">map</span><span
style="color: #66cc66;">&#41;</span> <span
style="color: #66cc66;">&#40;</span><span
style="color: #b1b100;">keys</span> suit-<span
style="color: #b1b100;">map</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span> suit<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #66cc66;">&#40;</span>old-Card value-sym suit-sym<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span></div></div><p>So that's a bit of a mess, but the requirements were too. I needed syntactical sugar to make dealing with this code palatable. And now I have said sugar. The following is now true:</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure 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: #66cc66;">&#40;</span>Card :ace :spades<span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp;<span
style="color: #66cc66;">&#40;</span>Card <span
style="color: #ff0000;">&quot;AS&quot;</span><span
style="color: #66cc66;">&#41;</span><br
/> &nbsp; &nbsp;<span
style="color: #66cc66;">&#40;</span>Card \A \S<span
style="color: #66cc66;">&#41;</span><span
style="color: #66cc66;">&#41;</span></div></div><p>My main gripe with (deftype) is that it complicates editor support. Previously, &quot;defn&quot; and a relatively small list of keywords meant a list was a function definition. Functions indent differently than other types of lists. deftype means the editor is going to have to understand the source better. But, it's a small and good problem to have IMO. Also hoping for destructuring support in vector for param arguments.</p> <img src="http://feeds.feedburner.com/~r/foognostic/~4/-tYPLry9xK4" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2010/01/wrapping-deftype-factory-methods/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2010/01/wrapping-deftype-factory-methods/</feedburner:origLink></item> <item><title>Presenting on Leiningen to Cap-Clug</title><link>http://feedproxy.google.com/~r/foognostic/~3/5QKnwGXxFfE/</link> <comments>http://blogs.foognostic.net/2010/01/presenting-on-leiningen-to-cap-clug/#comments</comments> <pubDate>Wed, 13 Jan 2010 00:44:24 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[clojure]]></category> <category><![CDATA[leiningen]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=341</guid> <description><![CDATA[I'm excited to present Leiningen to a Wash. DC metro area Clojure meetup, a.k.a. Cap-Clug. Leiningen is a Clojure-friendly build tool, and I've been very happy using it on Pokerepl. In the presentation I am going to spend most of my time explaining how to build a minimal yet friendly jar file starting from scratch. [...]]]></description> <content:encoded><![CDATA[<p>I'm excited to present <a
href="http://github.com/technomancy/leiningen/tree/stable">Leiningen</a> to a Wash. DC metro area <a
href="http://www.meetup.com/Cap-Clug/">Clojure meetup</a>, a.k.a. Cap-Clug. Leiningen is a Clojure-friendly build tool, and I've been very happy using it on <a
href="http://bitbucket.org/seths/pokerepl/src/">Pokerepl</a>.</p><p>In the presentation I am going to spend most of my time explaining how to build a minimal yet friendly jar file starting from scratch. Time permitting we will be able to cover more spiffy features like integration with <a
href="http://clojars.org">Clojars</a>.</p><p>The other scheduled presentation is going to be great; <a
href="http://twitter.com/fogus">@Fogus</a> is co-writing <a
href="http://blog.fogus.me/2010/01/11/writing-the-next-clojure-book/">the next Clojure book</a> and he will be presenting on features new in version 1.1.</p><p>If you are in the Washington DC metro area and have any sort of interest in Clojure, run don't walk to <a
href="http://www.meetup.com/Cap-Clug/">register</a> -- the first meeting is Thurs Jan 14th, 2010. See you there!</p> <img src="http://feeds.feedburner.com/~r/foognostic/~4/5QKnwGXxFfE" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2010/01/presenting-on-leiningen-to-cap-clug/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2010/01/presenting-on-leiningen-to-cap-clug/</feedburner:origLink></item> <item><title>Juggling versions of Clojure?</title><link>http://feedproxy.google.com/~r/foognostic/~3/JqFtpfskFGc/</link> <comments>http://blogs.foognostic.net/2010/01/juggling-versions-of-clojure/#comments</comments> <pubDate>Sun, 03 Jan 2010 23:35:15 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[clojure]]></category> <category><![CDATA[code]]></category> <category><![CDATA[GPLv3]]></category> <category><![CDATA[clojuggle]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=297</guid> <description><![CDATA[Clojuggle is a small tool to help people track and use various versions of Clojure with Slime/Swank.]]></description> <content:encoded><![CDATA[<p>(Standard disclaimer: <a
href="http://blogs.foognostic.net/disclaimer-clojure-is-a-new-hobby/">Clojure is a new hobby.</a>)</p><p>EDIT: also try rake clojure:new:repl</p><p>I am looking forward to trying <a
href="http://www.assembla.com/wiki/show/clojure/Datatypes">datatypes</a> on <a
href="http://bitbucket.org/seths/pokerepl/">Pokerepl</a>. However, that means using the <a
href="http://github.com/richhickey/clojure/tree/new">new branch of Clojure</a>, and indirectly, more work on my part to clone/track/build/deploy the new branch.</p><p>Almost everyone would and should use <a
href="http://github.com/technomancy/leiningen">Leiningen</a> to experiment with the new branch. Simply update your project.clj something like this:</p><div
class="codecolorer-container clojure vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="clojure codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp;:dependencies <span
style="color: #66cc66;">&#91;</span><span
style="color: #66cc66;">&#91;</span>org.clojure/clojure <span
style="color: #ff0000;">&quot;1.1.0-new-SNAPSHOT&quot;</span><span
style="color: #66cc66;">&#93;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #66cc66;">&#91;</span>org.clojure/clojure-contrib <span
style="color: #ff0000;">&quot;1.1.0-new-SNAPSHOT&quot;</span><span
style="color: #66cc66;">&#93;</span><span
style="color: #66cc66;">&#93;</span></div></div><p>At the moment though, updating ~/.clojure was beyond the ken of any automated tool I knew of. So I wrote a Rakefile and gave it a cheesy name... juggling Clojure... hmm... howzabout <a
href="http://bitbucket.org/seths/clojuggle/src/">Clojuggle</a>? Well... yeah...  sorry for that.</p><p>Back to the point: automating thorough (~/.m2 and ~/.clojure) updates and deployments of various versions of Clojure. Supporting common tasks (wipe, clone, build, &amp;c.) for several branches of several repositories means a thousand tasks will bloom and make the tool hard to use.</p><p>Ruby and the Rake API make it easy to define or show tasks only when relevant. I really enjoyed writing this code. Anyways, typing rake brings you to this:</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ rake<br
/> Welcome<span
style="color: #000000; font-weight: bold;">!</span> Try <span
style="color: #ff0000;">'rake -T'</span> <span
style="color: #000000; font-weight: bold;">for</span> a list of useful tasks, or try<br
/> &nbsp; &nbsp; rake clojure:master:all clojure-contrib:master:all</div></div><p>The default task provides some basic usage. Let's take a look at the initial set of tasks:</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ rake <span
style="color: #660033;">-T</span><br
/> rake clojure-contrib:master:all &nbsp;<span
style="color: #666666; font-style: italic;"># Do everything for master branch of clojure-contrib</span><br
/> rake clojure-contrib:new:all &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;"># Do everything for new branch of clojure-contrib</span><br
/> rake clojure:master:all &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #666666; font-style: italic;"># Do everything for master branch of clojure</span><br
/> rake clojure:new:all &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;"># Do everything for new branch of clojure</span><br
/> rake default &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;"># HOWTO use this file</span></div></div><p>Fine, let's give it a whirl.</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span
style="color: #000000; font-weight: bold;">time</span> rake clojure:new:all<br
/> <span
style="color: #666666; font-style: italic;"># oodles of lines omitted</span><br
/> ci-build:<br
/> <br
/> BUILD SUCCESSFUL<br
/> Total <span
style="color: #000000; font-weight: bold;">time</span>: 25 seconds<br
/> <span
style="color: #c20cb9; font-weight: bold;">rm</span> <span
style="color: #660033;">-f</span> <span
style="color: #000000; font-weight: bold;">/</span>...<span
style="color: #000000; font-weight: bold;">/</span>.clojure<span
style="color: #000000; font-weight: bold;">/</span>clojure.jar<br
/> <span
style="color: #c20cb9; font-weight: bold;">ln</span> <span
style="color: #660033;">-s</span> <span
style="color: #000000; font-weight: bold;">/</span>...<span
style="color: #000000; font-weight: bold;">/</span>clojuggle<span
style="color: #000000; font-weight: bold;">/</span>src<span
style="color: #000000; font-weight: bold;">/</span>clojure-new<span
style="color: #000000; font-weight: bold;">/</span>clojure.jar <span
style="color: #000000; font-weight: bold;">/</span>...<span
style="color: #000000; font-weight: bold;">/</span>.clojure<span
style="color: #000000; font-weight: bold;">/</span>clojure.jar<br
/> <br
/> real&nbsp; &nbsp; 0m55.306s<br
/> user&nbsp; &nbsp; 1m10.544s<br
/> sys 0m6.873s</div></div><p>Three subtle points here. First, the "ci-build" line is the clue that the local Maven2 repository was updated:</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span
style="color: #c20cb9; font-weight: bold;">ls</span> <span
style="color: #660033;">-l</span> ~<span
style="color: #000000; font-weight: bold;">/</span>.m2<span
style="color: #000000; font-weight: bold;">/</span>repository<span
style="color: #000000; font-weight: bold;">/</span>org<span
style="color: #000000; font-weight: bold;">/</span>clojure<span
style="color: #000000; font-weight: bold;">/</span>clojure<span
style="color: #000000; font-weight: bold;">/</span><br
/> total 8<br
/> drwxr-xr-x &nbsp;7 seths &nbsp;staff &nbsp;238 Jan &nbsp;3 17:57 1.1.0-new-SNAPSHOT<br
/> <span
style="color: #660033;">-rw-r--r--</span> &nbsp;<span
style="color: #000000;">1</span> seths &nbsp;staff &nbsp;<span
style="color: #000000;">322</span> Jan &nbsp;<span
style="color: #000000;">3</span> <span
style="color: #000000;">17</span>:<span
style="color: #000000;">57</span> maven-metadata-local.xml</div></div><p>Point #2: the ~/.clojure directory has a symlink pointing into the clojuggle/src/clojure-new directory.</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span
style="color: #c20cb9; font-weight: bold;">ls</span> <span
style="color: #660033;">-l</span> ~<span
style="color: #000000; font-weight: bold;">/</span>.clojure<span
style="color: #000000; font-weight: bold;">/</span><br
/> total <span
style="color: #000000;">8</span><br
/> lrwxr-xr-x &nbsp;<span
style="color: #000000;">1</span> seths &nbsp;staff &nbsp;<span
style="color: #000000;">70</span> Jan &nbsp;<span
style="color: #000000;">3</span> <span
style="color: #000000;">17</span>:<span
style="color: #000000;">57</span> clojure.jar -<span
style="color: #000000; font-weight: bold;">&gt;</span> <span
style="color: #000000; font-weight: bold;">/</span>...<span
style="color: #000000; font-weight: bold;">/</span>clojuggle<span
style="color: #000000; font-weight: bold;">/</span>src<span
style="color: #000000; font-weight: bold;">/</span>clojure-new<span
style="color: #000000; font-weight: bold;">/</span>clojure.jar</div></div><p>Point #3: a few more commands have surfaced from the Rakefile (e.g. clojure:new:update)</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ rake <span
style="color: #660033;">-T</span><br
/> <span
style="color: #666666; font-style: italic;"># ... omitted</span><br
/> rake clojure:blast:it &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #666666; font-style: italic;"># Removes files for clojure from $HOME/.clojure and .m2</span><br
/> rake clojure:new:publish &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;"># Push build to local m2 repo and ~/.clojure</span><br
/> rake clojure:new:update &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #666666; font-style: italic;"># Update the new branch of clojure</span></div></div><p>So that's all well and good, but what if you wanted to support <a
href="http://technomancy.us/">Technomancy's</a> <a
href="http://github.com/technomancy/clojure">fork</a> of Clojure? You would do two things. First this:</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span
style="color: #c20cb9; font-weight: bold;">cat</span> <span
style="color: #000000; font-weight: bold;">&gt;</span> user.yml<br
/> technomancy-clojure:<br
/> &nbsp; clone-from: git:<span
style="color: #000000; font-weight: bold;">//</span>github.com<span
style="color: #000000; font-weight: bold;">/</span>technomancy<span
style="color: #000000; font-weight: bold;">/</span>clojure.git<br
/> &nbsp; branches: <span
style="color: #7a0874; font-weight: bold;">&#91;</span>master, new<span
style="color: #7a0874; font-weight: bold;">&#93;</span><br
/> &nbsp; use-jar: clojure.jar</div></div><p>And then something like this:</p><div
class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ rake <span
style="color: #660033;">-T</span><br
/> &nbsp;<span
style="color: #666666; font-style: italic;"># ... omitted</span><br
/> rake technomancy-clojure:master:all &nbsp;<span
style="color: #666666; font-style: italic;"># Do everything for master branch of technomancy-clojure</span><br
/> rake technomancy-clojure:new:all &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;"># Do everything for new branch of technomancy-clojure</span></div></div><h1>DANGER!</h1><p>Do <b>NOT</b> use this tool to develop on various versions of Clojure. The wipe task always deletes files, so eventually you will lose changes unintentionally. Eventually 'git status' will be used to prevent wiping changes but not yet.</p><p>Penultimately, despite all this I still don't have the new branch working with Slime/Swank. It doesn't help that the pom.xml of contrib on the new branch wants 1.1.0-alpha of Clojure. Minor nits though that can be worked out.</p><p>Finally, if anyone is still reading <b>and</b> cares about these sort of things, I picked Ruby, v3 of the GPL, and Mercurial/BitBucket because I have strong feelings about those things.</p><p>Please respond in some way if you have any questions!</p><p>tl;dr: Leiningen is great -- try using it with the new branch of Clojure!</p> <img src="http://feeds.feedburner.com/~r/foognostic/~4/JqFtpfskFGc" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2010/01/juggling-versions-of-clojure/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2010/01/juggling-versions-of-clojure/</feedburner:origLink></item> <item><title>Why Clojure is worth it to me</title><link>http://feedproxy.google.com/~r/foognostic/~3/ZK8IKbEKf-0/</link> <comments>http://blogs.foognostic.net/2009/12/why-clojure-is-worth-it-to-me/#comments</comments> <pubDate>Thu, 17 Dec 2009 02:37:44 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[clojure]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=294</guid> <description><![CDATA[I was glad to see Rich Hickey ask the Clojure community to financially support his dedicated time and energy during 2010. Much better this than unraveling with very little warning and causing a thousand forks to bloom. The asking price was very reasonable when you compare it to any large, respectable software development book. I [...]]]></description> <content:encoded><![CDATA[<p>I was glad to see Rich Hickey <a
href="http://groups.google.com/group/clojure/browse_thread/thread/cc77df25e98ce46b/5f40e7048e1f774e">ask the Clojure community</a> to financially support his dedicated time and energy during 2010. Much better this than unraveling with very little warning and causing a thousand forks to bloom.</p><p>The asking price was very reasonable when you compare it to any large, respectable software development book. I have many of those (well, maybe not all <a
href="http://soafacts.com/">10 volumes of SOA in a nutshell</a>)... but even my favorite books cover very narrow topics in great depth. That's it, just some dead trees waiting to be used as references for types of problems I don't run into often.</p><p>Clojure covers many topics in depth with consistent pragmatism. No time to bootstrap libraries? Use the plethora of .jar files out there. No time/focus to sustain a world-class virtual machine? Use Sun's! Not interested in churning out another keyword-heavy language grammar? Use Lisp... but thanks for cleaning it up first <img
src='http://blogs.foognostic.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p><p>The rest of the time can go writing a compiler sufficiently smart to avoid head holding by implementing <a
href="http://github.com/richhickey/clojure/commit/76c8f45293987b80e3599535dd86482e1180661d">fine-grained local clearing</a>... add some high level concepts for concurrency via software transactional memory? Sure!</p><p>Another tangible reason I'm happy to pay real money is the Clojure community. It has been helpful in many ways. Every major editor has some level of support... the IRC channel is <b>great</b>. People are even building infrastructure (looking at you <a
href="http://github.com/technomancy/leiningen">Leiningen</a> and <a
href="http://clojars.org/">Clojars</a>!)</p><p>Ultimately I'm just being selfish. Swearing at the REPL until enlightenment conks you on the head is a rush... it's a minor victory with a thousand similar battles on the horizon. I like supporting <a
href="http://www.openbsd.org/donations.html">good projects</a> and I'm looking forward to spending lots more time with <a
href="http://clojure.org">Clojure</a>.</p> <img src="http://feeds.feedburner.com/~r/foognostic/~4/ZK8IKbEKf-0" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2009/12/why-clojure-is-worth-it-to-me/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2009/12/why-clojure-is-worth-it-to-me/</feedburner:origLink></item> <item><title>Flabber. Gasted.</title><link>http://feedproxy.google.com/~r/foognostic/~3/JCtkA-IkQLY/</link> <comments>http://blogs.foognostic.net/2009/11/flabber-gasted/#comments</comments> <pubDate>Mon, 30 Nov 2009 04:11:49 +0000</pubDate> <dc:creator>Seth Schroeder</dc:creator> <category><![CDATA[Uncategorized]]></category> <guid isPermaLink="false">http://blogs.foognostic.net/?p=284</guid> <description><![CDATA[The previous post got a LOT of attention: constructive criticism (yay!), confusion, doubt, and even vivid scorn. After a LOT of thinking I think it's worth taking a new look at the way I blog. Reviewing the technical flaws of the previous post will have to wait -- my broader personal flaws will do for [...]]]></description> <content:encoded><![CDATA[<p>The <a
href="http://blogs.foognostic.net/2009/11/the-path-of-least-resistance-in-clojure/">previous post</a> got a LOT of attention: constructive criticism (<strong>yay!</strong>), confusion, doubt, and even vivid scorn. After a LOT of thinking I think it's worth taking a new look at the way I blog.</p><p>Reviewing the technical flaws of the previous post will have to wait -- my broader personal flaws will do for now.</p><p>Before Web 2.0 brought rounded corners and AJAX I blogged at <a
href="http://zezu.livejournal.com/">LiveJournal</a>. Eventually one of my programmer acquaintances <a
href="http://zezu.livejournal.com/21082.html?thread=23898#t23898">politely suggested</a> I find a new place for some of the nerdier stuff. After overreacting for a few days, I finally saw the logic and created a blog where I could nerd out shamelessly: <a
href="http://community.livejournal.com/foognostic/1766.html">foognostic</a>.</p><p>Six years later LiveJournal has given way to WordPress. I'm still using Emacs but finally I have found a Lisp I want to learn. It will be a slow painful process, but I don't really care. Clojure is the language I want to use for its own sake.</p><p>If people are going to pay attention at random times then these posts need to be more specific and narrowly focused. Code samples with explanations do not trump rambling generalizations and lack of focus.</p><p>Thanks for reading alllll the way down here. I'll buy you a beer tomorrow!</p> <img src="http://feeds.feedburner.com/~r/foognostic/~4/JCtkA-IkQLY" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://blogs.foognostic.net/2009/11/flabber-gasted/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://blogs.foognostic.net/2009/11/flabber-gasted/</feedburner:origLink></item> </channel> </rss><!-- Dynamic page generated in 1.088 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-01 17:16:45 --><!-- Compression = gzip -->

