<?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: ECMAScript Proposal: Named Function Parameters</title>
	<atom:link href="http://weston.ruter.net/2010/05/30/ecmascript-proposal-named-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://weston.ruter.net/2010/05/30/ecmascript-proposal-named-parameters/</link>
	<description>Web application developer in Portland, Oregon</description>
	<lastBuildDate>Fri, 09 Dec 2011 18:07:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Jani Hartikainen</title>
		<link>http://weston.ruter.net/2010/05/30/ecmascript-proposal-named-parameters/comment-page-1/#comment-17581</link>
		<dc:creator>Jani Hartikainen</dc:creator>
		<pubDate>Mon, 31 May 2010 05:41:17 +0000</pubDate>
		<guid isPermaLink="false">http://weston.ruter.net/?p=310#comment-17581</guid>
		<description>This is an excellent idea. This feature is one of the things that makes Python great in my opinion (and C# now that they have it too)</description>
		<content:encoded><![CDATA[<p>This is an excellent idea. This feature is one of the things that makes Python great in my opinion (and C# now that they have it too)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Efraim Feinstein</title>
		<link>http://weston.ruter.net/2010/05/30/ecmascript-proposal-named-parameters/comment-page-1/#comment-17580</link>
		<dc:creator>Efraim Feinstein</dc:creator>
		<pubDate>Mon, 31 May 2010 04:17:22 +0000</pubDate>
		<guid isPermaLink="false">http://weston.ruter.net/?p=310#comment-17580</guid>
		<description>&lt;blockquote&gt;Although the current proposal has a requirement that &lt;q&gt;only trailing formal parameters may have default values specified&lt;/q&gt;, this shouldn’t be necessary when named parameters are used:&lt;/blockquote&gt;

The rationale here is that you can call a function that has named parameters with default values just like a function that doesn&#039;t.  So, a function:
&lt;pre&gt;&lt;code&gt;function foo(x, y=2, z=3) {
 return [x, y, z];
}&lt;/code&gt;&lt;/pre&gt;

could be called by: &lt;code&gt;foo(1, 4)&lt;/code&gt; would return &lt;code&gt;[1, 4, 3]&lt;/code&gt;

If a named parameter were in the first argument:
&lt;pre&gt;&lt;code&gt;function foo(x=1, y, z) {
 return [x, y, z];
}&lt;/code&gt;&lt;/pre&gt;

what would a call to &lt;code&gt;foo(1,2)&lt;/code&gt; mean? (As far as I can tell, it would just effectively require all calls to treat all parameters using the named parameter syntax.)  Python has the same restriction if you use the default value syntax (but not for the &lt;code&gt;**kwargs&lt;/code&gt; syntax).</description>
		<content:encoded><![CDATA[<blockquote><p>Although the current proposal has a requirement that <q>only trailing formal parameters may have default values specified</q>, this shouldn’t be necessary when named parameters are used:</p></blockquote>
<p>The rationale here is that you can call a function that has named parameters with default values just like a function that doesn&#8217;t.  So, a function:</p>
<pre><code>function foo(x, y=2, z=3) {
 return [x, y, z];
}</code></pre>
<p>could be called by: <code>foo(1, 4)</code> would return <code>[1, 4, 3]</code></p>
<p>If a named parameter were in the first argument:</p>
<pre><code>function foo(x=1, y, z) {
 return [x, y, z];
}</code></pre>
<p>what would a call to <code>foo(1,2)</code> mean? (As far as I can tell, it would just effectively require all calls to treat all parameters using the named parameter syntax.)  Python has the same restriction if you use the default value syntax (but not for the <code>**kwargs</code> syntax).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

