<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Looping Syntax in Various Languages</title>
	<atom:link href="http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/</link>
	<description>Leveraging Perl and Emacs</description>
	<lastBuildDate>Sat, 15 Jun 2013 02:12:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jared</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7639</link>
		<dc:creator><![CDATA[Jared]]></dc:creator>
		<pubDate>Thu, 04 Jun 2009 20:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7639</guid>
		<description><![CDATA[Hi Liang,

That makes sense as the gcd is the only piece that actually does any work (although obviously it is best to measure to be sure - thanks!).  The other part is just iterating around some loops.]]></description>
		<content:encoded><![CDATA[<p>Hi Liang,</p>
<p>That makes sense as the gcd is the only piece that actually does any work (although obviously it is best to measure to be sure &#8211; thanks!).  The other part is just iterating around some loops.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Liang</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7635</link>
		<dc:creator><![CDATA[Liang]]></dc:creator>
		<pubDate>Wed, 03 Jun 2009 14:14:38 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7635</guid>
		<description><![CDATA[I profile perl version.  Three statements in until block in gcd function take most of time.]]></description>
		<content:encoded><![CDATA[<p>I profile perl version.  Three statements in until block in gcd function take most of time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7618</link>
		<dc:creator><![CDATA[Jared]]></dc:creator>
		<pubDate>Fri, 29 May 2009 21:38:44 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7618</guid>
		<description><![CDATA[Hi Stuart,

Basically the process was the following:


1. I implemented my solution in emacs lisp using (while ...) and (setq ...)
I didn&#039;t like it so I had a look at looping in other languages.

2. I liked the look of eager comprehensions so I tried those and I&#039;m possibly interested in learning Ocaml so I tried that.  I added the Perl as a reference.

3. I added the benchmarks as I thought other people might be interested (and it looks like I was right - it has had the third most number of visitors in the last 30 days and its only been 2 days).  I don&#039;t really care that much.

I guess what came across most strongly was the benchmarking, but what I was most interested in was the various syntaxes for looping.

Hopefully that makes sense.]]></description>
		<content:encoded><![CDATA[<p>Hi Stuart,</p>
<p>Basically the process was the following:</p>
<p>1. I implemented my solution in emacs lisp using (while &#8230;) and (setq &#8230;)<br />
I didn&#8217;t like it so I had a look at looping in other languages.</p>
<p>2. I liked the look of eager comprehensions so I tried those and I&#8217;m possibly interested in learning Ocaml so I tried that.  I added the Perl as a reference.</p>
<p>3. I added the benchmarks as I thought other people might be interested (and it looks like I was right &#8211; it has had the third most number of visitors in the last 30 days and its only been 2 days).  I don&#8217;t really care that much.</p>
<p>I guess what came across most strongly was the benchmarking, but what I was most interested in was the various syntaxes for looping.</p>
<p>Hopefully that makes sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stuart</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7616</link>
		<dc:creator><![CDATA[stuart]]></dc:creator>
		<pubDate>Fri, 29 May 2009 10:22:14 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7616</guid>
		<description><![CDATA[I don&#039;t understand why you are comparing emacs lisp to scheme. I would not have considered emacs lisp a fast implementation of lisp. Wouldn&#039;t it make more sense to compare sbcl (or clisp or clozure or even Clojure) with scheme?or emacs lisp with a common lisp implementation?]]></description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand why you are comparing emacs lisp to scheme. I would not have considered emacs lisp a fast implementation of lisp. Wouldn&#8217;t it make more sense to compare sbcl (or clisp or clozure or even Clojure) with scheme?or emacs lisp with a common lisp implementation?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7613</link>
		<dc:creator><![CDATA[Jared]]></dc:creator>
		<pubDate>Fri, 29 May 2009 07:13:55 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7613</guid>
		<description><![CDATA[Wow, byte-compiling made a big difference.

(This is a different machine than my other tests).

before:

Started at: 08:07:17
XXX solutions
Finished at: 08:08:39

After:

Started at: 08:10:54
XXX solutions
Finished at: 08:11:11

And yes, I think that mzscheme has a JIT.  However, I&#039;m still surprised that it beats Perl by so much.]]></description>
		<content:encoded><![CDATA[<p>Wow, byte-compiling made a big difference.</p>
<p>(This is a different machine than my other tests).</p>
<p>before:</p>
<p>Started at: 08:07:17<br />
XXX solutions<br />
Finished at: 08:08:39</p>
<p>After:</p>
<p>Started at: 08:10:54<br />
XXX solutions<br />
Finished at: 08:11:11</p>
<p>And yes, I think that mzscheme has a JIT.  However, I&#8217;m still surprised that it beats Perl by so much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Creekmore</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7611</link>
		<dc:creator><![CDATA[Jonathan Creekmore]]></dc:creator>
		<pubDate>Thu, 28 May 2009 21:16:39 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7611</guid>
		<description><![CDATA[Compiling your solve-it function with compile-defun sped up Emacs-Lisp for me a lot. The uncompiled version of solve-it completed in 56 seconds for me. After compiling it, the time shrank to 9 seconds. That is closer to your expected MzScheme time and I believe that MzScheme will byte-compile things behind the scenes for you.]]></description>
		<content:encoded><![CDATA[<p>Compiling your solve-it function with compile-defun sped up Emacs-Lisp for me a lot. The uncompiled version of solve-it completed in 56 seconds for me. After compiling it, the time shrank to 9 seconds. That is closer to your expected MzScheme time and I believe that MzScheme will byte-compile things behind the scenes for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7610</link>
		<dc:creator><![CDATA[Jared]]></dc:creator>
		<pubDate>Thu, 28 May 2009 19:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7610</guid>
		<description><![CDATA[@trimtab - iterate looks nice, but I&#039;m looking for a looping mechanism to improve my emacs coding.  I just thought I&#039;d do a quick comparison with looping in other languages while I was messing around.

@Porges - thanks for that - it looks similar in spirit (if a bit different in syntax) to the scheme.  How long does it take to run on your machine?

@Jisang - sit-for does redisplay as the manual says.  If I don&#039;t add it then the screen does not redraw until the loop has finished executing, which took around 5 minutes in my first effort.  I added the sit-for so I could check on the progress.

Thanks for the comments.]]></description>
		<content:encoded><![CDATA[<p>@trimtab &#8211; iterate looks nice, but I&#8217;m looking for a looping mechanism to improve my emacs coding.  I just thought I&#8217;d do a quick comparison with looping in other languages while I was messing around.</p>
<p>@Porges &#8211; thanks for that &#8211; it looks similar in spirit (if a bit different in syntax) to the scheme.  How long does it take to run on your machine?</p>
<p>@Jisang &#8211; sit-for does redisplay as the manual says.  If I don&#8217;t add it then the screen does not redraw until the loop has finished executing, which took around 5 minutes in my first effort.  I added the sit-for so I could check on the progress.</p>
<p>Thanks for the comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jisang Yoo</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7609</link>
		<dc:creator><![CDATA[Jisang Yoo]]></dc:creator>
		<pubDate>Thu, 28 May 2009 18:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7609</guid>
		<description><![CDATA[What does (sit-for 0) do in the first solve-it defun? Accoding to its describe-function, it redisplays. But why redisplay in the middle of the loop?]]></description>
		<content:encoded><![CDATA[<p>What does (sit-for 0) do in the first solve-it defun? Accoding to its describe-function, it redisplays. But why redisplay in the middle of the loop?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Porges</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7608</link>
		<dc:creator><![CDATA[Porges]]></dc:creator>
		<pubDate>Thu, 28 May 2009 14:41:15 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7608</guid>
		<description><![CDATA[A direct translation of your algorithm into Haskell yields:

&lt;pre&gt;
main = print solve

solve::Int
solve = sum [1&#124;
	denom &lt;- [5..10000::Int],
	num &lt;- [1+floor(fromIntegral denom/3)..ceiling(fromIntegral denom/2)-1],
	gcd num denom == 1]
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>A direct translation of your algorithm into Haskell yields:</p>
<pre>
main = print solve

solve::Int
solve = sum [1|
	denom &lt;- [5..10000::Int],
	num &lt;- [1+floor(fromIntegral denom/3)..ceiling(fromIntegral denom/2)-1],
	gcd num denom == 1]
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: trimtab</title>
		<link>http://curiousprogrammer.wordpress.com/2009/05/27/looping-syntax/#comment-7607</link>
		<dc:creator><![CDATA[trimtab]]></dc:creator>
		<pubDate>Thu, 28 May 2009 14:24:14 +0000</pubDate>
		<guid isPermaLink="false">http://curiousprogrammer.wordpress.com/?p=634#comment-7607</guid>
		<description><![CDATA[For Common Lisp, you might be interested in the Iterate package in lieu of Loop. 

http://common-lisp.net/project/iterate/

More expressive, extensible, and Lispy! There are others still (e.g. Series), but Iterate seems to be the most powerful.]]></description>
		<content:encoded><![CDATA[<p>For Common Lisp, you might be interested in the Iterate package in lieu of Loop. </p>
<p><a href="http://common-lisp.net/project/iterate/" rel="nofollow">http://common-lisp.net/project/iterate/</a></p>
<p>More expressive, extensible, and Lispy! There are others still (e.g. Series), but Iterate seems to be the most powerful.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
