<?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"
	>
<channel>
	<title>Comments on: tinypy: did i mention metaprogramming?</title>
	<atom:link href="http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/</link>
	<description>games, tech, web, stuff, biz, and bilge</description>
	<pubDate>Wed, 09 Jul 2008 11:51:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Lennart Regebro</title>
		<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2803</link>
		<dc:creator>Lennart Regebro</dc:creator>
		<pubDate>Wed, 30 Apr 2008 21:39:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2803</guid>
		<description>I have to admit that I didn't understand any of the answers. :)

I don't want a do until btw. Because that doesn't work with the indentation in a reasonable way. I just want an until.

until x:
  do something

Would work like "while x" except that it would always loop once.</description>
		<content:encoded><![CDATA[<p>I have to admit that I didn&#8217;t understand any of the answers. <img src='http://www.philhassey.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I don&#8217;t want a do until btw. Because that doesn&#8217;t work with the indentation in a reasonable way. I just want an until.</p>
<p>until x:<br />
  do something</p>
<p>Would work like &#8220;while x&#8221; except that it would always loop once.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: a random John</title>
		<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2531</link>
		<dc:creator>a random John</dc:creator>
		<pubDate>Wed, 23 Apr 2008 15:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2531</guid>
		<description>Awesome.  '$' should be short for 'self.' similar to how '?' was short for 'print' in basic.</description>
		<content:encoded><![CDATA[<p>Awesome.  &#8216;$&#8217; should be short for &#8217;self.&#8217; similar to how &#8216;?&#8217; was short for &#8216;print&#8217; in basic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philhassey</title>
		<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2506</link>
		<dc:creator>philhassey</dc:creator>
		<pubDate>Tue, 22 Apr 2008 17:08:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2506</guid>
		<description>@Doug

I feel enlightened.  Sort of.</description>
		<content:encoded><![CDATA[<p>@Doug</p>
<p>I feel enlightened.  Sort of.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philhassey</title>
		<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2505</link>
		<dc:creator>philhassey</dc:creator>
		<pubDate>Tue, 22 Apr 2008 15:57:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2505</guid>
		<description>@nevinera replying to she: "you clearly only know languages in which it is difficult then."

I think in the case of tinypy, I'd categorize my "adding decorators by an import" as "hard enough that I had to think" but not so hard that it took me more than half an hour.</description>
		<content:encoded><![CDATA[<p>@nevinera replying to she: &#8220;you clearly only know languages in which it is difficult then.&#8221;</p>
<p>I think in the case of tinypy, I&#8217;d categorize my &#8220;adding decorators by an import&#8221; as &#8220;hard enough that I had to think&#8221; but not so hard that it took me more than half an hour.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: damien</title>
		<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2504</link>
		<dc:creator>damien</dc:creator>
		<pubDate>Tue, 22 Apr 2008 15:46:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2504</guid>
		<description>actually a do.. until can be done relatively easily, if you allow a "until cond" statements anywhere in the block and treat them as "if cond: break"

better yet, just have a "do:" statement which is an infinite loop and break out of it with "if cond: break"

do:
   stmt
   stmt
   until x &#62; 1
   stmt
   until othercond</description>
		<content:encoded><![CDATA[<p>actually a do.. until can be done relatively easily, if you allow a &#8220;until cond&#8221; statements anywhere in the block and treat them as &#8220;if cond: break&#8221;</p>
<p>better yet, just have a &#8220;do:&#8221; statement which is an infinite loop and break out of it with &#8220;if cond: break&#8221;</p>
<p>do:<br />
   stmt<br />
   stmt<br />
   until x &gt; 1<br />
   stmt<br />
   until othercond</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Napoleone</title>
		<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2503</link>
		<dc:creator>Doug Napoleone</dc:creator>
		<pubDate>Tue, 22 Apr 2008 15:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2503</guid>
		<description>"Until you read 'the art of the meta object protocol', implemented the actuator, and have taught it to someone else, you do not know what meta-programming is. That said, once you do that, please explain it to me." -Quote from prolog users mailing list.

That is from my quotes.txt file that I have been building for the past 15 years. ;-)

@Lennart:

As for the until statement, you can create that extension quite easily in python, it just looks weird:

@until(lambda x: x==4)
def loop():
    do some work
    return vars_to_be_tested

Also there are better logic constructs that you can do with the 'with' statement as well. I feel that is a better meme than the until statement as it supports error handling and cleanup in a much more sane manner. @contextmanager rocks!

To quote Tim Peters from 2000:

To summarize 10 years of fruitless discussion on this issue:  yes,

    while 1:
        ...
        if finished:
            break

is the intended way to spell "do ... until" in Python.

"do ... until F" is better than "do ... while F" because the truth of F
conjoined with the loop invariant and loop precondition should imply the
loop postcondition, and the "while" form artificially negates the F of
interest, thus making reasoning harder.

"do ... while F" is better than "do ... until F" because the truth of F
conjoined with the loop invariant and loop precondition should imply that
the loop invariant still holds, and the "until" form artificially negates
the F of interest, thus making reasoning harder.

Python's indentation rules do indeed not fit well with either form.  If
there were an obvious way to make them fit well, Guido would have done so a long time ago.  In the meantime, if you think you see one, write a PEP!

and-no-of-course-uninitialized-vrbls-exist-in-python-ly y'rs  - tim</description>
		<content:encoded><![CDATA[<p>&#8220;Until you read &#8216;the art of the meta object protocol&#8217;, implemented the actuator, and have taught it to someone else, you do not know what meta-programming is. That said, once you do that, please explain it to me.&#8221; -Quote from prolog users mailing list.</p>
<p>That is from my quotes.txt file that I have been building for the past 15 years. <img src='http://www.philhassey.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>@Lennart:</p>
<p>As for the until statement, you can create that extension quite easily in python, it just looks weird:</p>
<p>@until(lambda x: x==4)<br />
def loop():<br />
    do some work<br />
    return vars_to_be_tested</p>
<p>Also there are better logic constructs that you can do with the &#8216;with&#8217; statement as well. I feel that is a better meme than the until statement as it supports error handling and cleanup in a much more sane manner. @contextmanager rocks!</p>
<p>To quote Tim Peters from 2000:</p>
<p>To summarize 10 years of fruitless discussion on this issue:  yes,</p>
<p>    while 1:<br />
        &#8230;<br />
        if finished:<br />
            break</p>
<p>is the intended way to spell &#8220;do &#8230; until&#8221; in Python.</p>
<p>&#8220;do &#8230; until F&#8221; is better than &#8220;do &#8230; while F&#8221; because the truth of F<br />
conjoined with the loop invariant and loop precondition should imply the<br />
loop postcondition, and the &#8220;while&#8221; form artificially negates the F of<br />
interest, thus making reasoning harder.</p>
<p>&#8220;do &#8230; while F&#8221; is better than &#8220;do &#8230; until F&#8221; because the truth of F<br />
conjoined with the loop invariant and loop precondition should imply that<br />
the loop invariant still holds, and the &#8220;until&#8221; form artificially negates<br />
the F of interest, thus making reasoning harder.</p>
<p>Python&#8217;s indentation rules do indeed not fit well with either form.  If<br />
there were an obvious way to make them fit well, Guido would have done so a long time ago.  In the meantime, if you think you see one, write a PEP!</p>
<p>and-no-of-course-uninitialized-vrbls-exist-in-python-ly y&#8217;rs  - tim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tonetheman</title>
		<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2497</link>
		<dc:creator>tonetheman</dc:creator>
		<pubDate>Tue, 22 Apr 2008 12:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2497</guid>
		<description>Man that is cool</description>
		<content:encoded><![CDATA[<p>Man that is cool</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: she</title>
		<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2495</link>
		<dc:creator>she</dc:creator>
		<pubDate>Tue, 22 Apr 2008 10:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2495</guid>
		<description>One problem is, IMO the word "meta" programming. To me it implies that there is so much magic involved that not even the programmer knows whats going on anymore</description>
		<content:encoded><![CDATA[<p>One problem is, IMO the word &#8220;meta&#8221; programming. To me it implies that there is so much magic involved that not even the programmer knows whats going on anymore</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lennart Regebro</title>
		<link>http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2493</link>
		<dc:creator>Lennart Regebro</dc:creator>
		<pubDate>Tue, 22 Apr 2008 10:00:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.philhassey.com/blog/2008/04/21/tinypy-did-i-mention-metaprogramming/#comment-2493</guid>
		<description>Ooh, nice. It's always annoyed me that Python doesn't have an until-statement, and that I can't add one without changing the c-code. Not that I'm actually going to start using TinyPy just because of this, but it's still nice. :)</description>
		<content:encoded><![CDATA[<p>Ooh, nice. It&#8217;s always annoyed me that Python doesn&#8217;t have an until-statement, and that I can&#8217;t add one without changing the c-code. Not that I&#8217;m actually going to start using TinyPy just because of this, but it&#8217;s still nice. <img src='http://www.philhassey.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
