<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Writting Circular Lists in Erlang</title>
	<atom:link href="http://blog.valkertown.org/2009/03/18/writting_circular_lists_in_erlang/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.valkertown.org/2009/03/18/writting_circular_lists_in_erlang/</link>
	<description>I used to write about electronics...</description>
	<lastBuildDate>Tue, 29 Dec 2009 04:51:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: deepspawn</title>
		<link>http://blog.valkertown.org/2009/03/18/writting_circular_lists_in_erlang/comment-page-1/#comment-399</link>
		<dc:creator>deepspawn</dc:creator>
		<pubDate>Fri, 27 Mar 2009 21:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.valkertown.org/?p=357#comment-399</guid>
		<description>Thanks, I&#039;ll give it a try and do a benchmark to see if It&#039;s better to&lt;br&gt;the other solution in the above comments.</description>
		<content:encoded><![CDATA[<p>Thanks, I&#39;ll give it a try and do a benchmark to see if It&#39;s better to<br />the other solution in the above comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nonme</title>
		<link>http://blog.valkertown.org/2009/03/18/writting_circular_lists_in_erlang/comment-page-1/#comment-398</link>
		<dc:creator>nonme</dc:creator>
		<pubDate>Fri, 27 Mar 2009 21:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.valkertown.org/?p=357#comment-398</guid>
		<description>keep two lists {A, B} one in normal order the other reversed&lt;br&gt;To move forward do this&lt;br&gt;&lt;br&gt;forward({[H&#124;T],B}) -&gt; {T, [H&#124;B]};&lt;br&gt;forward({[], B}) -&gt; forward({reverse(B),[]})&lt;br&gt;&lt;br&gt;bawards is the opposite</description>
		<content:encoded><![CDATA[<p>keep two lists {A, B} one in normal order the other reversed<br />To move forward do this</p>
<p>forward({[H|T],B}) -&gt; {T, [H|B]};<br />forward({[], B}) -&gt; forward({reverse(B),[]})</p>
<p>bawards is the opposite</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zaphar</title>
		<link>http://blog.valkertown.org/2009/03/18/writting_circular_lists_in_erlang/comment-page-1/#comment-396</link>
		<dc:creator>zaphar</dc:creator>
		<pubDate>Sun, 22 Mar 2009 21:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.valkertown.org/?p=357#comment-396</guid>
		<description>yeah ++ is less efficient. [Push &#124; drop_last(List)] would be better. That&#039;s what I get for coding when I&#039;m tired. but the basic concept is the same.</description>
		<content:encoded><![CDATA[<p>yeah ++ is less efficient. [Push | drop_last(List)] would be better. That&#39;s what I get for coding when I&#39;m tired. but the basic concept is the same.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: deepspawn</title>
		<link>http://blog.valkertown.org/2009/03/18/writting_circular_lists_in_erlang/comment-page-1/#comment-394</link>
		<dc:creator>deepspawn</dc:creator>
		<pubDate>Fri, 20 Mar 2009 01:24:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.valkertown.org/?p=357#comment-394</guid>
		<description>Nice, I&#039;m just repeating what I have read so far but&lt;br&gt;&lt;br&gt; [Push] ++ drop_last(List)&lt;br&gt;&lt;br&gt;Wouldn&#039;t it be better written as:&lt;br&gt; &lt;br&gt; [ Push &#124; drop_last(List)]&lt;br&gt;&lt;br&gt;Anyway, ++ is discouraged since it makes a copy of the left operator and with long lists it would be highly inefficient, in this case it wouldn&#039;t be much of a problem but I still like more how the second one looks.&lt;br&gt;&lt;br&gt;Thank you a lot for this idea, I&#039;m guessing it&#039;s probably the best way to write it on erlang.</description>
		<content:encoded><![CDATA[<p>Nice, I&#39;m just repeating what I have read so far but</p>
<p> [Push] ++ drop_last(List)</p>
<p>Wouldn&#39;t it be better written as:</p>
<p> [ Push | drop_last(List)]</p>
<p>Anyway, ++ is discouraged since it makes a copy of the left operator and with long lists it would be highly inefficient, in this case it wouldn&#39;t be much of a problem but I still like more how the second one looks.</p>
<p>Thank you a lot for this idea, I&#39;m guessing it&#39;s probably the best way to write it on erlang.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zaphar</title>
		<link>http://blog.valkertown.org/2009/03/18/writting_circular_lists_in_erlang/comment-page-1/#comment-389</link>
		<dc:creator>zaphar</dc:creator>
		<pubDate>Wed, 18 Mar 2009 22:07:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.valkertown.org/?p=357#comment-389</guid>
		<description>The key is to process the list in one pass. So if I read your intent above correctly then the following should work:&lt;br&gt;&lt;br&gt;%% append the Push element to the beginning of the list while dropping the last element&lt;br&gt;circular(List, Push) -&gt;&lt;br&gt;    [Push] ++ drop_last(List).&lt;br&gt;&lt;br&gt;%% drop the last element from the list&lt;br&gt;drop_last([_]) -&gt;&lt;br&gt;    [];&lt;br&gt;drop_last([H&#124;T]) -&gt;&lt;br&gt;    [H &#124; drop_last(T)].</description>
		<content:encoded><![CDATA[<p>The key is to process the list in one pass. So if I read your intent above correctly then the following should work:</p>
<p>%% append the Push element to the beginning of the list while dropping the last element<br />circular(List, Push) -&gt;<br />    [Push] ++ drop_last(List).</p>
<p>%% drop the last element from the list<br />drop_last([_]) -&gt;<br />    [];<br />drop_last([H|T]) -&gt;<br />    [H | drop_last(T)].</p>
]]></content:encoded>
	</item>
</channel>
</rss>
