<?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: Day 9: Having beautiful arguments (and parameters)</title>
	<atom:link href="http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/</link>
	<description>Something cool about Perl 6 every day</description>
	<lastBuildDate>Sun, 03 Feb 2013 05:15:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: carl</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-521</link>
		<dc:creator><![CDATA[carl]]></dc:creator>
		<pubDate>Tue, 14 Dec 2010 15:21:49 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-521</guid>
		<description><![CDATA[Oops, that was a thinko on my part &#8212; the &lt;code&gt;&amp;action&lt;/code&gt; does need to be specified. Now corrected in the post. Thanks.

A few random comments: a Perl 6 compiler with the appropriate presence of mind would flag such an omission at compile time. (There&#039;s no such compiler yet, but it&#039;s definitely possible.) Regardless, the code wouldn&#039;t make it through runtime since the signature binding would fail.

I was once sitting at a dinner table opposite Damian Conway and Larry Wall. Larry was pondering adding a special code-parameter, as in Ruby, with a special syntactic exception so that omission of a comma for a block specified inline would not be an error, as it is now in Perl 6. That idea was just idle speculation, though, and hasn&#039;t made it into spec.]]></description>
		<content:encoded><![CDATA[<p>Oops, that was a thinko on my part &mdash; the <code>&amp;action</code> does need to be specified. Now corrected in the post. Thanks.</p>
<p>A few random comments: a Perl 6 compiler with the appropriate presence of mind would flag such an omission at compile time. (There&#8217;s no such compiler yet, but it&#8217;s definitely possible.) Regardless, the code wouldn&#8217;t make it through runtime since the signature binding would fail.</p>
<p>I was once sitting at a dinner table opposite Damian Conway and Larry Wall. Larry was pondering adding a special code-parameter, as in Ruby, with a special syntactic exception so that omission of a comma for a block specified inline would not be an error, as it is now in Perl 6. That idea was just idle speculation, though, and hasn&#8217;t made it into spec.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: szeryf</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-520</link>
		<dc:creator><![CDATA[szeryf]]></dc:creator>
		<pubDate>Tue, 14 Dec 2010 15:13:41 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-520</guid>
		<description><![CDATA[Why isn&#039;t the action parameter used in recursive calls to traverse_inorder? Is the code-parameter special (as in Ruby)? Or (if it&#039;s normal) can we use more than one code-parameter (unlike in Ruby)?]]></description>
		<content:encoded><![CDATA[<p>Why isn&#8217;t the action parameter used in recursive calls to traverse_inorder? Is the code-parameter special (as in Ruby)? Or (if it&#8217;s normal) can we use more than one code-parameter (unlike in Ruby)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carl</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-214</link>
		<dc:creator><![CDATA[carl]]></dc:creator>
		<pubDate>Thu, 24 Dec 2009 09:30:58 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-214</guid>
		<description><![CDATA[I think the point where I really fell in love with the short form of named parameters was when I realized that they can be used even with variables that have a twigil (secondary sigil) -- for the purposes of the parameter naming, it&#039;s simply ignored. So these examples all work:

&lt;code&gt;sub outer { inner(:$^some-arg); } # :some-arg($^some-arg)&lt;/code&gt;

&lt;code&gt;configure-io(:$*IN); # :IN($*IN)&lt;/code&gt;

&lt;code&gt;method build() { precompute-stuff(:$!a, :$!b, :$!c); } # :a($!a) etc.&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>I think the point where I really fell in love with the short form of named parameters was when I realized that they can be used even with variables that have a twigil (secondary sigil) &#8212; for the purposes of the parameter naming, it&#8217;s simply ignored. So these examples all work:</p>
<p><code>sub outer { inner(:$^some-arg); } # :some-arg($^some-arg)</code></p>
<p><code>configure-io(:$*IN); # :IN($*IN)</code></p>
<p><code>method build() { precompute-stuff(:$!a, :$!b, :$!c); } # :a($!a) etc.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Brockman</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-213</link>
		<dc:creator><![CDATA[Daniel Brockman]]></dc:creator>
		<pubDate>Thu, 24 Dec 2009 02:01:01 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-213</guid>
		<description><![CDATA[A similar short form for named parameters exists in O&#039;Caml:

To pass 123 as the value of the named parameter &quot;foo&quot;, you use this syntax:

~foo: 123

But if you have 123 stored in a variable called &quot;foo&quot;, you can simply do this:

~foo

It&#039;s very, very convenient, and it also all but forces you to name your variables and parameters thoughtfully and consistently. Good move to include this feature in Perl 6.]]></description>
		<content:encoded><![CDATA[<p>A similar short form for named parameters exists in O&#8217;Caml:</p>
<p>To pass 123 as the value of the named parameter &#8220;foo&#8221;, you use this syntax:</p>
<p>~foo: 123</p>
<p>But if you have 123 stored in a variable called &#8220;foo&#8221;, you can simply do this:</p>
<p>~foo</p>
<p>It&#8217;s very, very convenient, and it also all but forces you to name your variables and parameters thoughtfully and consistently. Good move to include this feature in Perl 6.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ?</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-80</link>
		<dc:creator><![CDATA[?]]></dc:creator>
		<pubDate>Wed, 09 Dec 2009 20:43:42 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-80</guid>
		<description><![CDATA[This is probably much better:

$_ = sprintf(&quot;%b&quot;, $_) and tr/01/ #/ and print $_, &quot;\n&quot; for &quot;734044754508967647390469414544647854399310&quot; =~ /(.{7})/g;

I&#039;m looking forward to having chained operations so much nicer in Perl 6.]]></description>
		<content:encoded><![CDATA[<p>This is probably much better:</p>
<p>$_ = sprintf(&#8220;%b&#8221;, $_) and tr/01/ #/ and print $_, &#8220;\n&#8221; for &#8220;734044754508967647390469414544647854399310&#8243; =~ /(.{7})/g;</p>
<p>I&#8217;m looking forward to having chained operations so much nicer in Perl 6.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carl</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-78</link>
		<dc:creator><![CDATA[carl]]></dc:creator>
		<pubDate>Wed, 09 Dec 2009 14:40:16 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-78</guid>
		<description><![CDATA[The short form of named arguments is really, really nice. Not least because it interacts seamlessly with twigils (by ignoring them) -- something that only becomes a desired feature after a while, when you suddnely think &quot;hm, will it work if I do this? It cannot possibly work if I do this...&quot; ...and it does!

foo(:$*global, :$^placeholder, :$!attr, :$.accessor);]]></description>
		<content:encoded><![CDATA[<p>The short form of named arguments is really, really nice. Not least because it interacts seamlessly with twigils (by ignoring them) &#8212; something that only becomes a desired feature after a while, when you suddnely think &#8220;hm, will it work if I do this? It cannot possibly work if I do this&#8230;&#8221; &#8230;and it does!</p>
<p>foo(:$*global, :$^placeholder, :$!attr, :$.accessor);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bened</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-77</link>
		<dc:creator><![CDATA[bened]]></dc:creator>
		<pubDate>Wed, 09 Dec 2009 14:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-77</guid>
		<description><![CDATA[$middle .= substr(0, 1);
-&gt; Started reading this like Perl 5 before I realized the new meaning. : )

I&#039;m really impressed with the short form of named parameters. I think no other language could possibly do this right now. (Well, maybe you could do it in Common Lisp with macros.)]]></description>
		<content:encoded><![CDATA[<p>$middle .= substr(0, 1);<br />
-&gt; Started reading this like Perl 5 before I realized the new meaning. : )</p>
<p>I&#8217;m really impressed with the short form of named parameters. I think no other language could possibly do this right now. (Well, maybe you could do it in Common Lisp with macros.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moritz</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-76</link>
		<dc:creator><![CDATA[Moritz]]></dc:creator>
		<pubDate>Wed, 09 Dec 2009 09:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-76</guid>
		<description><![CDATA[There&#039;s a branch in Rakudo where lots of things are reworked (the &#039;ng&#039; branch, if anybody is curious). On that this piece of code faithfully reports &lt;code&gt;Cannot assign to readonly value&lt;/code&gt;.

We expect that branch to land some time this month, or at the very latest due to the release in January.]]></description>
		<content:encoded><![CDATA[<p>There&#8217;s a branch in Rakudo where lots of things are reworked (the &#8216;ng&#8217; branch, if anybody is curious). On that this piece of code faithfully reports <code>Cannot assign to readonly value</code>.</p>
<p>We expect that branch to land some time this month, or at the very latest due to the release in January.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moritz</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-75</link>
		<dc:creator><![CDATA[Moritz]]></dc:creator>
		<pubDate>Wed, 09 Dec 2009 09:22:05 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-75</guid>
		<description><![CDATA[Instead of split and grep you can also use &lt;code&gt;&quot;73...&quot; =~ /(.{7})/g&lt;/code&gt;, to stay closer to the Perl 6 version :-)]]></description>
		<content:encoded><![CDATA[<p>Instead of split and grep you can also use <code>"73..." =~ /(.{7})/g</code>, to stay closer to the Perl 6 version :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ?</title>
		<link>http://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/#comment-74</link>
		<dc:creator><![CDATA[?]]></dc:creator>
		<pubDate>Wed, 09 Dec 2009 08:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=179#comment-74</guid>
		<description><![CDATA[If you&#039;re a Perl 5 user, and feel left out looking at the last one-liner, here&#039;s something roughly equivalent:

print(($_ = (sprintf(&quot;%b&quot;, $_))) =~ tr/01/ #/ &amp;&amp; $_, &quot;\n&quot;) for grep { $_ ne &quot;&quot; } split /(\d{7})/, &quot;734044754508967647390469414544647854399310&quot;;

I won&#039;t admit it&#039;s the best way to get it in Perl 5 as a one-liner...]]></description>
		<content:encoded><![CDATA[<p>If you&#8217;re a Perl 5 user, and feel left out looking at the last one-liner, here&#8217;s something roughly equivalent:</p>
<p>print(($_ = (sprintf(&#8220;%b&#8221;, $_))) =~ tr/01/ #/ &amp;&amp; $_, &#8220;\n&#8221;) for grep { $_ ne &#8220;&#8221; } split /(\d{7})/, &#8220;734044754508967647390469414544647854399310&#8243;;</p>
<p>I won&#8217;t admit it&#8217;s the best way to get it in Perl 5 as a one-liner&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
