<?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: goto statement considered</title>
	<atom:link href="http://www.artfulcode.net/articles/goto-statement-considered/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artfulcode.net/articles/goto-statement-considered/</link>
	<description>Resources and tips for dynamic, interactive languages.</description>
	<lastBuildDate>Tue, 09 Mar 2010 19:00:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jeff</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/comment-page-1/#comment-1957</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Sat, 21 Nov 2009 00:23:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/?p=816#comment-1957</guid>
		<description>The number of columns in the string may not change and the increment operator would add a character to the beginning of the string. Also, the range operator does not appear to do what I need it to. I initially used that, but it cannot handle punctuation, which this must handle.</description>
		<content:encoded><![CDATA[<p>The number of columns in the string may not change and the increment operator would add a character to the beginning of the string. Also, the range operator does not appear to do what I need it to. I initially used that, but it cannot handle punctuation, which this must handle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RJ</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/comment-page-1/#comment-1956</link>
		<dc:creator>RJ</dc:creator>
		<pubDate>Fri, 20 Nov 2009 07:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/?p=816#comment-1956</guid>
		<description>If I understand your problem correctly, doesn&#039;t this easily solve it without a goto statement:

def increment(string, by):
	bytes = deque()
	for c in string:
		byte = ord(c)
		if ord(&quot;0&quot;) &lt;= byte &lt;= ord(&quot;9&quot;):
			byte -= ord(&quot;0&quot;)
			byte = (byte + by) % 9
			byte += ord(&quot;0&quot;)
		elif ord(&quot;a&quot;) &lt;= byte &lt;= ord(&quot;z&quot;):
			byte -= ord(&quot;a&quot;)
			byte = (byte + by) % 25
			byte += ord(&quot;a&quot;)
		elif ord(&quot;A&quot;) &lt;= byte &lt;= ord(&quot;Z&quot;):
			byte -= ord(&quot;A&quot;)
			byte = (byte + by) % 25
			byte += ord(&quot;A&quot;)
		bytes.append(byte)
	return &quot;&quot;.join(bytes)

Yes, it&#039;s in Python, but easily convertible to Perl and you can extract the inner part of the for loop into a function since you want to transform it char by char.</description>
		<content:encoded><![CDATA[<p>If I understand your problem correctly, doesn&#8217;t this easily solve it without a goto statement:</p>
<p>def increment(string, by):<br />
	bytes = deque()<br />
	for c in string:<br />
		byte = ord(c)<br />
		if ord(&#8220;0&#8243;) &lt;= byte &lt;= ord(&quot;9&quot;):<br />
			byte -= ord(&quot;0&quot;)<br />
			byte = (byte + by) % 9<br />
			byte += ord(&quot;0&quot;)<br />
		elif ord(&quot;a&quot;) &lt;= byte &lt;= ord(&quot;z&quot;):<br />
			byte -= ord(&quot;a&quot;)<br />
			byte = (byte + by) % 25<br />
			byte += ord(&quot;a&quot;)<br />
		elif ord(&quot;A&quot;) &lt;= byte &lt;= ord(&quot;Z&quot;):<br />
			byte -= ord(&quot;A&quot;)<br />
			byte = (byte + by) % 25<br />
			byte += ord(&quot;A&quot;)<br />
		bytes.append(byte)<br />
	return &quot;&quot;.join(bytes)</p>
<p>Yes, it&#039;s in Python, but easily convertible to Perl and you can extract the inner part of the for loop into a function since you want to transform it char by char.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stewart</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/comment-page-1/#comment-1955</link>
		<dc:creator>stewart</dc:creator>
		<pubDate>Fri, 20 Nov 2009 05:33:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/?p=816#comment-1955</guid>
		<description>rather let the functional programming paradigm of programming structure your goto statement</description>
		<content:encoded><![CDATA[<p>rather let the functional programming paradigm of programming structure your goto statement</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rudolf O.</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/comment-page-1/#comment-1954</link>
		<dc:creator>Rudolf O.</dc:creator>
		<pubDate>Fri, 20 Nov 2009 05:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/?p=816#comment-1954</guid>
		<description>Post your code!</description>
		<content:encoded><![CDATA[<p>Post your code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/comment-page-1/#comment-1953</link>
		<dc:creator>Phil</dc:creator>
		<pubDate>Fri, 20 Nov 2009 04:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/?p=816#comment-1953</guid>
		<description>Surely, you&#039;ve seen Knuth&#039;s take on the issue: &lt;a href=&quot;pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf&quot; rel=&quot;nofollow&quot;&gt;Structured Programming with Goto&lt;/a&gt;. It&#039;s very insightful reading on this topic, has some great humor, and presages a lot of great ideas seen in later development.</description>
		<content:encoded><![CDATA[<p>Surely, you&#8217;ve seen Knuth&#8217;s take on the issue: <a href="pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf" rel="nofollow">Structured Programming with Goto</a>. It&#8217;s very insightful reading on this topic, has some great humor, and presages a lot of great ideas seen in later development.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicolas Dumazet</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/comment-page-1/#comment-1952</link>
		<dc:creator>Nicolas Dumazet</dc:creator>
		<pubDate>Fri, 20 Nov 2009 04:17:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/?p=816#comment-1952</guid>
		<description>This post obviously lacks code examples. Show us.</description>
		<content:encoded><![CDATA[<p>This post obviously lacks code examples. Show us.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JadeNB</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/comment-page-1/#comment-1951</link>
		<dc:creator>JadeNB</dc:creator>
		<pubDate>Fri, 20 Nov 2009 03:53:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/?p=816#comment-1951</guid>
		<description>Setting aside the main point of your post --you mention Perl, so is it reasonable to assume that you were coding in Perl?  If so, note that the &lt;code&gt;++&lt;/code&gt; operator already behaves this way&#8212;see &lt;a href=&quot;http://perldoc.perl.org/perlop.html#Auto-increment-and-Auto-decrement&quot; rel=&quot;nofollow&quot;&gt;http://perldoc.perl.org/perlop.html#Auto-increment-and-Auto-decrement&lt;/a&gt;&#8212;and .. ranges behave as you&#039;d hope.</description>
		<content:encoded><![CDATA[<p>Setting aside the main point of your post &#8211;you mention Perl, so is it reasonable to assume that you were coding in Perl?  If so, note that the <code>++</code> operator already behaves this way&mdash;see <a href="http://perldoc.perl.org/perlop.html#Auto-increment-and-Auto-decrement" rel="nofollow">http://perldoc.perl.org/perlop.html#Auto-increment-and-Auto-decrement</a>&mdash;and .. ranges behave as you&#8217;d hope.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rzeźnik</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/comment-page-1/#comment-1950</link>
		<dc:creator>Rzeźnik</dc:creator>
		<pubDate>Fri, 20 Nov 2009 02:55:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/?p=816#comment-1950</guid>
		<description>Right. I have recently finished implementation of coroutines in Java (http://code.google.com/p/coroutines - if you care), and I must admit that I would not have gone anywhere without goto (although bytecode one). That&#039;s at the heart of resuming a coroutine execution. I started to think that goto has its place where it cannot be abused. But I also agree that it must be constrained so that careless programmers do not see it very often :-)</description>
		<content:encoded><![CDATA[<p>Right. I have recently finished implementation of coroutines in Java (<a href="http://code.google.com/p/coroutines" rel="nofollow">http://code.google.com/p/coroutines</a> &#8211; if you care), and I must admit that I would not have gone anywhere without goto (although bytecode one). That&#8217;s at the heart of resuming a coroutine execution. I started to think that goto has its place where it cannot be abused. But I also agree that it must be constrained so that careless programmers do not see it very often :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ilowry</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/comment-page-1/#comment-1949</link>
		<dc:creator>ilowry</dc:creator>
		<pubDate>Thu, 19 Nov 2009 16:29:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/?p=816#comment-1949</guid>
		<description>Agreed! GOTO rocks. If constrained. 
My usual heurisitics for gotos in C/C++ – no more then 1-3 labels and forward non-crossing jumps only.</description>
		<content:encoded><![CDATA[<p>Agreed! GOTO rocks. If constrained.<br />
My usual heurisitics for gotos in C/C++ – no more then 1-3 labels and forward non-crossing jumps only.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
