<?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: More Sentinels</title>
	<atom:link href="http://blog.ianbicking.org/2010/04/02/more-sentinels/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/</link>
	<description></description>
	<lastBuildDate>Fri, 06 May 2011 07:16:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Karl Anderson</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158436</link>
		<dc:creator>Karl Anderson</dc:creator>
		<pubDate>Mon, 05 Apr 2010 17:35:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158436</guid>
		<description>That&#039;s an argument for creating your own sentinels - you can see their meaning, and you&#039;ll always need one more if there is meaning assigned to them.  And that&#039;s probably the reason for not having them in Lisp - Lisp is relatively small, let the developer create what is needed.

I&#039;ve always used a module-level &quot;_marker = []&quot; for non-shared and non-persistent sentinels, specifically because it stays in the module.</description>
		<content:encoded><![CDATA[<p>That&#8217;s an argument for creating your own sentinels &#8211; you can see their meaning, and you&#8217;ll always need one more if there is meaning assigned to them.  And that&#8217;s probably the reason for not having them in Lisp &#8211; Lisp is relatively small, let the developer create what is needed.</p>

<p>I&#8217;ve always used a module-level &#8220;_marker = []&#8221; for non-shared and non-persistent sentinels, specifically because it stays in the module.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Hetzner</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158099</link>
		<dc:creator>Erik Hetzner</dc:creator>
		<pubDate>Sun, 04 Apr 2010 01:08:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158099</guid>
		<description>nil for false is a little strange, true, but Lisp gives you all ever need - &amp; more - with symbols.</description>
		<content:encoded><![CDATA[<p>nil for false is a little strange, true, but Lisp gives you all ever need &#8211; &amp; more &#8211; with symbols.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paddy3118</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158071</link>
		<dc:creator>Paddy3118</dc:creator>
		<pubDate>Sat, 03 Apr 2010 20:13:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158071</guid>
		<description>Thanks Aaron for your comprehensive correction :-)</description>
		<content:encoded><![CDATA[<p>Thanks Aaron for your comprehensive correction :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Sherman</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158065</link>
		<dc:creator>Aaron Sherman</dc:creator>
		<pubDate>Sat, 03 Apr 2010 17:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158065</guid>
		<description>Unfortunately my link got eaten. [Here is S02&#039;s info on *](http://perlcabal.org/syn/S02.html#line_907 &quot;S02&quot;)</description>
		<content:encoded><![CDATA[<p>Unfortunately my link got eaten. <a href="http://perlcabal.org/syn/S02.html#line_907" title="S02">Here is S02&#8242;s info on *</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Sherman</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158064</link>
		<dc:creator>Aaron Sherman</dc:creator>
		<pubDate>Sat, 03 Apr 2010 17:21:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158064</guid>
		<description>No, you&#039;re incorrect about what `*` does, as is the blog author, I think.

`*` in Perl 6 means &quot;glob&quot; in the shell sense, but taken to a functional/MMD extreme. For example, `$foo .. *` would be similar to `$foo .. Inf`, but is not specific to numeric types. What _your_ type does with `*` is a matter of your type&#039;s semantics (and perhaps those of a parent type), but the user will reasonably expect some sort of &quot;infinity&quot; or &quot;all in range&quot; behavior. For subscripting, `@foo[*]` would yield a shallow copy of `@foo` much like `[ x for x in foo ]` in python. However, for multi-dimensional arrays, this would be more handy:

 `@foo[*; 1..8 ; *]`

For method and function dispatch, `*` dispatches like the Any type, but has no defined value. Thus the recipient would have to determine what they wanted to do with it.

But, in Python, I do think that a &quot;just give me something&quot; value might be interesting. For example generators might be able to do something useful with this, avoiding generating intermediate objects, but that&#039;s not Perl 6&#039;s `*`.

For those interested in advanced uses, `*` also supports expression currying. For example:

  `* + $x`

curries up a function which returns `$x` plus its parameter. Thus:

  `my $x = 1;`

  `my $y = * + $x;`

  `say($y(7));`

should print &quot;8&quot;. Currying has all sorts of interesting uses, though this example is trivial.

See  for more information.</description>
		<content:encoded><![CDATA[<p>No, you&#8217;re incorrect about what <code>*</code> does, as is the blog author, I think.</p>

<p><code>*</code> in Perl 6 means &#8220;glob&#8221; in the shell sense, but taken to a functional/MMD extreme. For example, <code>$foo .. *</code> would be similar to <code>$foo .. Inf</code>, but is not specific to numeric types. What <em>your</em> type does with <code>*</code> is a matter of your type&#8217;s semantics (and perhaps those of a parent type), but the user will reasonably expect some sort of &#8220;infinity&#8221; or &#8220;all in range&#8221; behavior. For subscripting, <code>@foo[*]</code> would yield a shallow copy of <code>@foo</code> much like <code>[ x for x in foo ]</code> in python. However, for multi-dimensional arrays, this would be more handy:</p>

<p><code>@foo[*; 1..8 ; *]</code></p>

<p>For method and function dispatch, <code>*</code> dispatches like the Any type, but has no defined value. Thus the recipient would have to determine what they wanted to do with it.</p>

<p>But, in Python, I do think that a &#8220;just give me something&#8221; value might be interesting. For example generators might be able to do something useful with this, avoiding generating intermediate objects, but that&#8217;s not Perl 6&#8242;s <code>*</code>.</p>

<p>For those interested in advanced uses, <code>*</code> also supports expression currying. For example:</p>

<p><code>* + $x</code></p>

<p>curries up a function which returns <code>$x</code> plus its parameter. Thus:</p>

<p><code>my $x = 1;</code></p>

<p><code>my $y = * + $x;</code></p>

<p><code>say($y(7));</code></p>

<p>should print &#8220;8&#8243;. Currying has all sorts of interesting uses, though this example is trivial.</p>

<p>See  for more information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paddy3118</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158053</link>
		<dc:creator>Paddy3118</dc:creator>
		<pubDate>Sat, 03 Apr 2010 07:32:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158053</guid>
		<description>Hi Ian,

From your Perl6 example it seems that its use of &#039;item(*)&#039; seems analogous to what would be &#039;random.choice(item)&#039; in Python. I prefer the explicit Python version in this case.

- Paddy.</description>
		<content:encoded><![CDATA[<p>Hi Ian,</p>

<p>From your Perl6 example it seems that its use of &#8216;item(*)&#8217; seems analogous to what would be &#8216;random.choice(item)&#8217; in Python. I prefer the explicit Python version in this case.</p>

<ul>
<li>Paddy.</li>
</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Sherman</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158050</link>
		<dc:creator>Aaron Sherman</dc:creator>
		<pubDate>Sat, 03 Apr 2010 06:09:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158050</guid>
		<description>In regards to &quot;words work too,&quot; this is, of course, true. However, in this particular case, &quot;\*&quot; has meant a wildcard glob since the introduction of the Bourne shell in the Unix world and since the dawn of time from the DOS/Windows perspective. That covers the three primary computing platforms of the modern world (Linux, Mac/OS and Windows) along with countless other Unix derivatives, VMS, Amiga/DOS, Domain/OS, etc.

Even Python uses &quot;\*&quot; for its import syntax to mean exactly the same thing:

 from foo import *

The real reason not to use &quot;\*&quot; in this way is that it already has two very different uses in Python (three if you count \*args and \*\*kwargs as distinct) and it doesn&#039;t need a third (fourth). I think that the lack of grammatical ambiguity is a more interesting distinction between Python and Perl than the ratio of punctuation to non-punctuation. While there are interesting arguments for which approach is more useful for what reasons, it&#039;s clear that the correct solution is consistency with the existing language, and in Python&#039;s case that shoots down &quot;\*&quot; in this case much more effectively than any degree of punctophobia.</description>
		<content:encoded><![CDATA[<p>In regards to &#8220;words work too,&#8221; this is, of course, true. However, in this particular case, &#8220;&#42;&#8221; has meant a wildcard glob since the introduction of the Bourne shell in the Unix world and since the dawn of time from the DOS/Windows perspective. That covers the three primary computing platforms of the modern world (Linux, Mac/OS and Windows) along with countless other Unix derivatives, VMS, Amiga/DOS, Domain/OS, etc.</p>

<p>Even Python uses &#8220;&#42;&#8221; for its import syntax to mean exactly the same thing:</p>

<p>from foo import *</p>

<p>The real reason not to use &#8220;&#42;&#8221; in this way is that it already has two very different uses in Python (three if you count &#42;args and &#42;&#42;kwargs as distinct) and it doesn&#8217;t need a third (fourth). I think that the lack of grammatical ambiguity is a more interesting distinction between Python and Perl than the ratio of punctuation to non-punctuation. While there are interesting arguments for which approach is more useful for what reasons, it&#8217;s clear that the correct solution is consistency with the existing language, and in Python&#8217;s case that shoots down &#8220;&#42;&#8221; in this case much more effectively than any degree of punctophobia.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eli</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158048</link>
		<dc:creator>Eli</dc:creator>
		<pubDate>Sat, 03 Apr 2010 04:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158048</guid>
		<description>Indeed an infinite integer could be helpful for the implementation of some algorithms. Both a positive integer, and a negative integer, for that matter.

In C we could get away with INT_MAX as long as we knew everything was guaranteed to be in int range. In Python there&#039;s no largest integer per-se, which is why such a sentinel would indeed be useful.

Other than that, I&#039;m fine with None. Just like in Lisp, where nil is the only real sentinel (together with ()) and they manage just fine.</description>
		<content:encoded><![CDATA[<p>Indeed an infinite integer could be helpful for the implementation of some algorithms. Both a positive integer, and a negative integer, for that matter.</p>

<p>In C we could get away with INT_MAX as long as we knew everything was guaranteed to be in int range. In Python there&#8217;s no largest integer per-se, which is why such a sentinel would indeed be useful.</p>

<p>Other than that, I&#8217;m fine with None. Just like in Lisp, where nil is the only real sentinel (together with ()) and they manage just fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Dalke</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158045</link>
		<dc:creator>Andrew Dalke</dc:creator>
		<pubDate>Sat, 03 Apr 2010 04:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158045</guid>
		<description>Well, there&#039;s a reason I said I needed an &quot;infinite integer&quot; rather than &quot;an infinite value&quot; ;) In the ideal case (which I didn&#039;t need), 1/InfInt = 0 and not 0.0 .

In any case it could be done as sentinel if more logic was done in the algorithm. It just means various &#039;if&#039; checks in the right places.</description>
		<content:encoded><![CDATA[<p>Well, there&#8217;s a reason I said I needed an &#8220;infinite integer&#8221; rather than &#8220;an infinite value&#8221; ;) In the ideal case (which I didn&#8217;t need), 1/InfInt = 0 and not 0.0 .</p>

<p>In any case it could be done as sentinel if more logic was done in the algorithm. It just means various &#8216;if&#8217; checks in the right places.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Dalke</title>
		<link>http://blog.ianbicking.org/2010/04/02/more-sentinels/comment-page-1/#comment-158046</link>
		<dc:creator>Andrew Dalke</dc:creator>
		<pubDate>Sat, 03 Apr 2010 04:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/?p=208#comment-158046</guid>
		<description>Well, there&#039;s a reason I said I needed an &quot;infinite integer&quot; rather than &quot;an infinite value&quot; ;) In the ideal case (which I didn&#039;t need), 1/InfInt = 0 and not 0.0 .

In any case it could be done as sentinel if more logic was done in the algorithm. It just means various &#039;if&#039; checks in the right places.</description>
		<content:encoded><![CDATA[<p>Well, there&#8217;s a reason I said I needed an &#8220;infinite integer&#8221; rather than &#8220;an infinite value&#8221; ;) In the ideal case (which I didn&#8217;t need), 1/InfInt = 0 and not 0.0 .</p>

<p>In any case it could be done as sentinel if more logic was done in the algorithm. It just means various &#8216;if&#8217; checks in the right places.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.385 seconds -->

