<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: Clojure: Where&#8217;s the Elegance?</title>
	<atom:link href="http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=clojure-wheres-the-elegance</link>
	<description>Rants that are usually about technology</description>
	<lastBuildDate>Sun, 25 Jul 2010 16:58:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Eric TF Bat</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-8299</link>
		<dc:creator>Eric TF Bat</dc:creator>
		<pubDate>Sat, 10 Jul 2010 22:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-8299</guid>
		<description>Original post: &quot;This refrigerator smells funny.&quot;

Comments: &quot;Don&#039;t worry about it, mine smells even worse.&quot; &quot;Yeah, just put a peg on your nose and ignore it.&quot; &quot;Other fridges don&#039;t have nearly as much stuff in them.&quot; &quot;Why don&#039;t you mention the ugly fridge magnets on the front door?&quot; &quot;Clean it yourself!&quot;</description>
		<content:encoded><![CDATA[<p>Original post: &#8220;This refrigerator smells funny.&#8221;</p>
<p>Comments: &#8220;Don&#8217;t worry about it, mine smells even worse.&#8221; &#8220;Yeah, just put a peg on your nose and ignore it.&#8221; &#8220;Other fridges don&#8217;t have nearly as much stuff in them.&#8221; &#8220;Why don&#8217;t you mention the ugly fridge magnets on the front door?&#8221; &#8220;Clean it yourself!&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sys</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-8298</link>
		<dc:creator>sys</dc:creator>
		<pubDate>Sat, 10 Jul 2010 17:44:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-8298</guid>
		<description>Well Eric, thanks for another pointless rant :)</description>
		<content:encoded><![CDATA[<p>Well Eric, thanks for another pointless rant <img src='http://www.pointlessrants.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stand</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-5704</link>
		<dc:creator>stand</dc:creator>
		<pubDate>Mon, 09 Nov 2009 21:35:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-5704</guid>
		<description>Part of the issue here I think is that wrt to computer languages we are accustomed to looking at them from the perspective of &quot;what does language x provide?&quot; With languages like clojure (i.e. homoiconic, macros) the language really only provides you with the primitives and relies on *you* to provide yourself with the rest (or get it from the community).

Me: &quot;What? there&#039;s no tenth function?&quot; Clojure: &quot;Write it yourself. (defn tenth [seq] (nth seq 10))&quot; 

Write it yourself is pretty much clojure&#039;s answer for any question. You got a problem with the language? Change it. You don&#039;t want to change it? Fine, don&#039;t use clojure.</description>
		<content:encoded><![CDATA[<p>Part of the issue here I think is that wrt to computer languages we are accustomed to looking at them from the perspective of &#8220;what does language x provide?&#8221; With languages like clojure (i.e. homoiconic, macros) the language really only provides you with the primitives and relies on *you* to provide yourself with the rest (or get it from the community).</p>
<p>Me: &#8220;What? there&#8217;s no tenth function?&#8221; Clojure: &#8220;Write it yourself. (defn tenth [seq] (nth seq 10))&#8221; </p>
<p>Write it yourself is pretty much clojure&#8217;s answer for any question. You got a problem with the language? Change it. You don&#8217;t want to change it? Fine, don&#8217;t use clojure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Bitdiddle</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-5697</link>
		<dc:creator>Ben Bitdiddle</dc:creator>
		<pubDate>Mon, 09 Nov 2009 01:34:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-5697</guid>
		<description>Was this rant meant as satire? The sequence functions were your clue to Clojure&#039;s bad design? Nothing about the cons of immutability, higher order functions, lazy evaluation or any of those other bad design choices that Clojure has?  What gives?</description>
		<content:encoded><![CDATA[<p>Was this rant meant as satire? The sequence functions were your clue to Clojure&#8217;s bad design? Nothing about the cons of immutability, higher order functions, lazy evaluation or any of those other bad design choices that Clojure has?  What gives?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Halloway</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-5678</link>
		<dc:creator>Stuart Halloway</dc:creator>
		<pubDate>Fri, 06 Nov 2009 18:02:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-5678</guid>
		<description>As other commenters have mentioned, Pythonic &quot;one way&quot; is not the normal style in a Lisp. But here are a few Clojure things that are cool because many languages provide *zero* ways to do them.
 
* dosync
* alter
* macros
* auto-gensyms
* defmulti
* destructuring
* persistent data structures
* the *-in functions
* maps as functions
* *warn-on-reflection*
* metadata that is just data

Cheers!</description>
		<content:encoded><![CDATA[<p>As other commenters have mentioned, Pythonic &#8220;one way&#8221; is not the normal style in a Lisp. But here are a few Clojure things that are cool because many languages provide *zero* ways to do them.</p>
<p>* dosync<br />
* alter<br />
* macros<br />
* auto-gensyms<br />
* defmulti<br />
* destructuring<br />
* persistent data structures<br />
* the *-in functions<br />
* maps as functions<br />
* *warn-on-reflection*<br />
* metadata that is just data</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: piggybox</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-5666</link>
		<dc:creator>piggybox</dc:creator>
		<pubDate>Thu, 05 Nov 2009 06:10:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-5666</guid>
		<description>Well, you can use nth(0) for first, nth(1) for second and nth(-1) for last, but which ones are more *readable*? There&#039;re many ways to say in our own human languages for one thing, but we can still understand each other.</description>
		<content:encoded><![CDATA[<p>Well, you can use nth(0) for first, nth(1) for second and nth(-1) for last, but which ones are more *readable*? There&#8217;re many ways to say in our own human languages for one thing, but we can still understand each other.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anon</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-5664</link>
		<dc:creator>Anon</dc:creator>
		<pubDate>Wed, 04 Nov 2009 21:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-5664</guid>
		<description>If you wanted to do Python-like slicing in Clojure, though granted not as concisely, you could make your own slice function - I am thinking maybe as an inline function via definline instead of as a regular function or macro.

Usage variations could be like the following:
(slice coll [index])
;; and/or simply: (slice coll index)
(slice coll [start end])
(slice coll [start end stride])

And, to get the equivalent of Python slices
where the numeric values are not supplied,
like coll[::-1] and such, you could use any non-numeric such as :_ as a placeholder, like:
(slice coll [:_ :_ -1]).

After thinking about this, I searched and found the following thread that talks about similar stuff - not exactly the same, but has some implementation ideas:
http://www.mail-archive.com/clojure@googlegroups.com/msg17443.html

Python&#039;s my favorite language, but I&#039;ve been learning about Clojure because of the way it handles concurrency.  It has its own elegance and consistency in other ways.

Consider this, just to focus on some of what is mentioned in this post: In Python you can slice lists and tuples and strings and even the &quot;generator-like&quot; xrange, but not generators.  In Python, if you have a list of lists like:

x = [[&#039;a&#039;, &#039;b&#039;, &#039;c&#039;], [&#039;d&#039;, &#039;e&#039;, &#039;f&#039;], [&#039;g&#039;, &#039;h&#039;, &#039;i&#039;]]

You can do:
 x[0][0]
to get &#039;a&#039;, whereas in Clojure you might do:
(ffirst x).

Similarly:
x[0][1:]

would give you [&#039;b&#039;, &#039;c&#039;], whereas in Clojure,
you might do:
(nfirst x)

And:
x[2]
Would give you 
[&#039;g&#039;, &#039;h&#039;, &#039;i&#039;]
similar to (nth x 2) in Clojure.

But if you had, say, a generator that returned generators instead... consider the following toy example that returns the same values as above:

x2 = ((chr(x+i) for i in xrange(3)) for x in (97, 100, 103))

You couldn&#039;t handle it the same way in Python since trying to slice x2 (or the generators it produces) would give you:
TypeError: &#039;generator&#039; object is unsubscriptable

But, you can (arguably more consistently than Python in this respect), use those same Clojure functions on Clojure&#039;s lazy equivalent:

(def x2 (for [x [97 100 103]]
  (for [i (range 3)] (char (+ x i)))))

(for creates &quot;list comprehensions&quot; in Clojure, but unlike in Python, list comprehensions are lazy in Clojure.)

I am not saying here that Python should have slicing of generators.  It works in its own way with generators getting consumed as you call next().  But Clojure has its own goodness going on with its immutable and persistent data structures.  Python is awesome, but Clojure is worth delving more into.</description>
		<content:encoded><![CDATA[<p>If you wanted to do Python-like slicing in Clojure, though granted not as concisely, you could make your own slice function &#8211; I am thinking maybe as an inline function via definline instead of as a regular function or macro.</p>
<p>Usage variations could be like the following:<br />
(slice coll [index])<br />
;; and/or simply: (slice coll index)<br />
(slice coll [start end])<br />
(slice coll [start end stride])</p>
<p>And, to get the equivalent of Python slices<br />
where the numeric values are not supplied,<br />
like coll[::-1] and such, you could use any non-numeric such as :_ as a placeholder, like:<br />
(slice coll [:_ :_ -1]).</p>
<p>After thinking about this, I searched and found the following thread that talks about similar stuff &#8211; not exactly the same, but has some implementation ideas:<br />
<a href="http://www.mail-archive.com/clojure@googlegroups.com/msg17443.html" rel="nofollow">http://www.mail-archive.com/clojure@googlegroups.com/msg17443.html</a></p>
<p>Python&#8217;s my favorite language, but I&#8217;ve been learning about Clojure because of the way it handles concurrency.  It has its own elegance and consistency in other ways.</p>
<p>Consider this, just to focus on some of what is mentioned in this post: In Python you can slice lists and tuples and strings and even the &#8220;generator-like&#8221; xrange, but not generators.  In Python, if you have a list of lists like:</p>
<p>x = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]</p>
<p>You can do:<br />
 x[0][0]<br />
to get &#8216;a&#8217;, whereas in Clojure you might do:<br />
(ffirst x).</p>
<p>Similarly:<br />
x[0][1:]</p>
<p>would give you ['b', 'c'], whereas in Clojure,<br />
you might do:<br />
(nfirst x)</p>
<p>And:<br />
x[2]<br />
Would give you<br />
['g', 'h', 'i']<br />
similar to (nth x 2) in Clojure.</p>
<p>But if you had, say, a generator that returned generators instead&#8230; consider the following toy example that returns the same values as above:</p>
<p>x2 = ((chr(x+i) for i in xrange(3)) for x in (97, 100, 103))</p>
<p>You couldn&#8217;t handle it the same way in Python since trying to slice x2 (or the generators it produces) would give you:<br />
TypeError: &#8216;generator&#8217; object is unsubscriptable</p>
<p>But, you can (arguably more consistently than Python in this respect), use those same Clojure functions on Clojure&#8217;s lazy equivalent:</p>
<p>(def x2 (for [x [97 100 103]]<br />
  (for [i (range 3)] (char (+ x i)))))</p>
<p>(for creates &#8220;list comprehensions&#8221; in Clojure, but unlike in Python, list comprehensions are lazy in Clojure.)</p>
<p>I am not saying here that Python should have slicing of generators.  It works in its own way with generators getting consumed as you call next().  But Clojure has its own goodness going on with its immutable and persistent data structures.  Python is awesome, but Clojure is worth delving more into.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Shull</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-5661</link>
		<dc:creator>Eric Shull</dc:creator>
		<pubDate>Wed, 04 Nov 2009 14:33:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-5661</guid>
		<description>While I like the ideas behind Clojure (stateless, functional programming), I find the execution wanting. It seems to me that the creators wanted a functional programming language for the JVM more than they wanted a better functional programming language, yet the only thing anyone seems to be talking about is that it&#039;s a better functional programming language.

I could do without the JVM, but a better functional programming language would be something to talk about.</description>
		<content:encoded><![CDATA[<p>While I like the ideas behind Clojure (stateless, functional programming), I find the execution wanting. It seems to me that the creators wanted a functional programming language for the JVM more than they wanted a better functional programming language, yet the only thing anyone seems to be talking about is that it&#8217;s a better functional programming language.</p>
<p>I could do without the JVM, but a better functional programming language would be something to talk about.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jneira</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-5658</link>
		<dc:creator>jneira</dc:creator>
		<pubDate>Wed, 04 Nov 2009 07:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-5658</guid>
		<description>well if its a cuestion of tastes i think clojure is one of the most elegant languages (maybe haskell is more beautiful but i think the compiler is more complicated)
One of the keys of python is the identation and that makes it simple and elegant  but parentheses dont disturb once you get used to them.
With them clojure can have not operators or setences, the core of the compiler is a few special forms. With them clojure.core builds a set of funtions and you can use only one way but yo can choose which one!!</description>
		<content:encoded><![CDATA[<p>well if its a cuestion of tastes i think clojure is one of the most elegant languages (maybe haskell is more beautiful but i think the compiler is more complicated)<br />
One of the keys of python is the identation and that makes it simple and elegant  but parentheses dont disturb once you get used to them.<br />
With them clojure can have not operators or setences, the core of the compiler is a few special forms. With them clojure.core builds a set of funtions and you can use only one way but yo can choose which one!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Logan</title>
		<link>http://www.pointlessrants.com/2009/11/clojure-wheres-the-elegance/comment-page-1/#comment-5656</link>
		<dc:creator>Patrick Logan</dc:creator>
		<pubDate>Wed, 04 Nov 2009 06:34:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.pointlessrants.com/?p=641#comment-5656</guid>
		<description>On all those functions, that&#039;s the lisp way...

&quot;It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.&quot; -Alan Perlis

Matter of fact, that&#039;s the same for namespaces/packages.

Good news for a n00b is they can just ignore all that for the most part. You just need to learn the base functions. Then you add more over time.

e.g. you can learn to use (first seq) and (rest seq) and combine those to your hearts content. Then when you stumble upon (ffirst seq) you realize you no longer have to write (first (first seq)) How often do you need ffirst -well, not nearly as much as first or nth.

Lisp programmers like a large library of composable variations on a base set of functions. That is kind of a highlight of functional programming. But in OOP the Smalltalk language takes a similar approach: many variation of base methods, e.g. the collection API.

I am not sure why Python would prefer a &quot;one way for one thing&quot; approach, but that would certainly not be the Lisp way.</description>
		<content:encoded><![CDATA[<p>On all those functions, that&#8217;s the lisp way&#8230;</p>
<p>&#8220;It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.&#8221; -Alan Perlis</p>
<p>Matter of fact, that&#8217;s the same for namespaces/packages.</p>
<p>Good news for a n00b is they can just ignore all that for the most part. You just need to learn the base functions. Then you add more over time.</p>
<p>e.g. you can learn to use (first seq) and (rest seq) and combine those to your hearts content. Then when you stumble upon (ffirst seq) you realize you no longer have to write (first (first seq)) How often do you need ffirst -well, not nearly as much as first or nth.</p>
<p>Lisp programmers like a large library of composable variations on a base set of functions. That is kind of a highlight of functional programming. But in OOP the Smalltalk language takes a similar approach: many variation of base methods, e.g. the collection API.</p>
<p>I am not sure why Python would prefer a &#8220;one way for one thing&#8221; approach, but that would certainly not be the Lisp way.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
