<?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: Function.apply (is even easier) in Python</title>
	<atom:link href="http://aralbalkan.com/1442/feed" rel="self" type="application/rss+xml" />
	<link>http://aralbalkan.com/1442</link>
	<description>Changing the world through technology and oratory.</description>
	<pubDate>Thu, 20 Nov 2008 12:53:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-beta2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Aral</title>
		<link>http://aralbalkan.com/1442/comment-page-1#comment-174853</link>
		<dc:creator>Aral</dc:creator>
		<pubDate>Thu, 07 Aug 2008 17:33:31 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1442#comment-174853</guid>
		<description>@widged: Yep, but it's not the same thing. That's the way I'd been using extended call syntax in Python not understanding that you can also _call_ it via an argument object. 

For it to be equivalent, we should be able to do the following in AS3 (based on your example):

args = [1,2,3]
myFunc = function(x,y,z){
   trace(x + ", " + y + ", " + z)
}
myFunc(...args) 

or, borrowing Python syntax: myFunc(*args)

We can't do that yet in AS3.

That said, Python and AS3 are very similar in flavor (both dynamic languages) and we do have apply which does the same thing. I just find Python's syntax more concise in this case and quite elegant.</description>
		<content:encoded><![CDATA[<p>@widged: Yep, but it&#8217;s not the same thing. That&#8217;s the way I&#8217;d been using extended call syntax in Python not understanding that you can also _call_ it via an argument object. </p>
<p>For it to be equivalent, we should be able to do the following in AS3 (based on your example):</p>
<p>args = [1,2,3]<br />
myFunc = function(x,y,z){<br />
   trace(x + &#8220;, &#8221; + y + &#8220;, &#8221; + z)<br />
}<br />
myFunc(&#8230;args) </p>
<p>or, borrowing Python syntax: myFunc(*args)</p>
<p>We can&#8217;t do that yet in AS3.</p>
<p>That said, Python and AS3 are very similar in flavor (both dynamic languages) and we do have apply which does the same thing. I just find Python&#8217;s syntax more concise in this case and quite elegant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bsdemon</title>
		<link>http://aralbalkan.com/1442/comment-page-1#comment-174781</link>
		<dc:creator>bsdemon</dc:creator>
		<pubDate>Thu, 07 Aug 2008 11:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1442#comment-174781</guid>
		<description>widged:
In python can also do that by:

def func(*args):
    # now `args` is a tuple
    print length(args)
    print args</description>
		<content:encoded><![CDATA[<p>widged:<br />
In python can also do that by:</p>
<p>def func(*args):<br />
    # now `args` is a tuple<br />
    print length(args)<br />
    print args</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: widged</title>
		<link>http://aralbalkan.com/1442/comment-page-1#comment-174777</link>
		<dc:creator>widged</dc:creator>
		<pubDate>Thu, 07 Aug 2008 11:11:20 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1442#comment-174777</guid>
		<description>Hi Aral,

Note that in AS3 you can now pass a variable number of arguments to the function itself:

function passAnything(...statements):void {
  trace(statements.length +": "+ statements);
}

[Example borrowed from this &lt;a href="http://www.senocular.com/flash/tutorials/as3withflashcs3/" rel="nofollow"&gt;AS3 tutorial by senocular&lt;/a&gt;]</description>
		<content:encoded><![CDATA[<p>Hi Aral,</p>
<p>Note that in AS3 you can now pass a variable number of arguments to the function itself:</p>
<p>function passAnything(&#8230;statements):void {<br />
  trace(statements.length +&#8221;: &#8220;+ statements);<br />
}</p>
<p>[Example borrowed from this <a href="http://www.senocular.com/flash/tutorials/as3withflashcs3/" rel="nofollow">AS3 tutorial by senocular</a>]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
