<?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: A strange way AS3 manages arrays</title>
	<atom:link href="http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/</link>
	<description>italian geek and PROgrammer</description>
	<lastBuildDate>Wed, 17 Mar 2010 22:10:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Thi</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-487641</link>
		<dc:creator>Thi</dc:creator>
		<pubDate>Wed, 19 Aug 2009 20:09:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-487641</guid>
		<description>var one:Array = [[1],[2],[3]]
var two:Array = one.concat()

two[0] = two[0].concat() //weird thing
two[0][0] = 4

trace(one, two) // 1,2,3 4,2,3

that shold resolve the array in array thing ^^</description>
		<content:encoded><![CDATA[<p>var one:Array = [[1],[2],[3]]<br />
var two:Array = one.concat()</p>
<p>two[0] = two[0].concat() //weird thing<br />
two[0][0] = 4</p>
<p>trace(one, two) // 1,2,3 4,2,3</p>
<p>that shold resolve the array in array thing ^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mauro</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-425797</link>
		<dc:creator>Mauro</dc:creator>
		<pubDate>Tue, 07 Apr 2009 16:45:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-425797</guid>
		<description>ok he was just showing something he thought was curious, why are you guy blaming him?

remember, not even a PROgrammer knows all tricks!</description>
		<content:encoded><![CDATA[<p>ok he was just showing something he thought was curious, why are you guy blaming him?</p>
<p>remember, not even a PROgrammer knows all tricks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-362519</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Sun, 28 Dec 2008 18:32:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-362519</guid>
		<description>lol... public function wtf(){</description>
		<content:encoded><![CDATA[<p>lol&#8230; public function wtf(){</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Boucher</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-361935</link>
		<dc:creator>Michael Boucher</dc:creator>
		<pubDate>Sat, 27 Dec 2008 22:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-361935</guid>
		<description>With PHP you explicitly tell a variable to pass by reference. If I remember correctly this is done as follows:

// Changes to $myArr2 no affect on $myArr1
$myArr2 = $myArr1;

// Changes to $myArr3 affect $myArr1
$myArr3 = &amp;$myArr1;

Agreed that concat() should be used for &quot;copying&quot; an array and breaking the reference. Can&#039;t find the posting with some speed tests but concat() proved to be the fastest method.

Have to somewhat disagree that PHP offers a poor design decision on how it assigns complex types. It&#039;s all a matter of the &quot;default&quot; for both languages, PHP doesn&#039;t lack the ability to assign by reference, it just isn&#039;t the default behavior.

Best,
-michael</description>
		<content:encoded><![CDATA[<p>With PHP you explicitly tell a variable to pass by reference. If I remember correctly this is done as follows:</p>
<p>// Changes to $myArr2 no affect on $myArr1<br />
$myArr2 = $myArr1;</p>
<p>// Changes to $myArr3 affect $myArr1<br />
$myArr3 = &amp;$myArr1;</p>
<p>Agreed that concat() should be used for &#8220;copying&#8221; an array and breaking the reference. Can&#8217;t find the posting with some speed tests but concat() proved to be the fastest method.</p>
<p>Have to somewhat disagree that PHP offers a poor design decision on how it assigns complex types. It&#8217;s all a matter of the &#8220;default&#8221; for both languages, PHP doesn&#8217;t lack the ability to assign by reference, it just isn&#8217;t the default behavior.</p>
<p>Best,<br />
-michael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vitaLee</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-361927</link>
		<dc:creator>vitaLee</dc:creator>
		<pubDate>Sat, 27 Dec 2008 22:24:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-361927</guid>
		<description>the only problem here was that you approached this situation with wrong expectations.
your php background experience didn&#039;t help you here.
i&#039;ve once felt in this kind of situation and then i found out about the concat method.
HEAD UP !!! :)</description>
		<content:encoded><![CDATA[<p>the only problem here was that you approached this situation with wrong expectations.<br />
your php background experience didn&#8217;t help you here.<br />
i&#8217;ve once felt in this kind of situation and then i found out about the concat method.<br />
HEAD UP !!! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sudoku creator/solver with AS3 : Emanuele Feronato</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-361678</link>
		<dc:creator>Sudoku creator/solver with AS3 : Emanuele Feronato</dc:creator>
		<pubDate>Sat, 27 Dec 2008 13:10:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-361678</guid>
		<description>[...] after a little hassle due to a strange way AS3 manages arrays (in my opinion), I am ready to post the AS3 version of the [...]</description>
		<content:encoded><![CDATA[<p>[...] after a little hassle due to a strange way AS3 manages arrays (in my opinion), I am ready to post the AS3 version of the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Kaufman</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-361532</link>
		<dc:creator>Michael Kaufman</dc:creator>
		<pubDate>Sat, 27 Dec 2008 07:57:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-361532</guid>
		<description>Exactly, since you made a custom object you are sharing a reference. Really has nothing to do with Arrays and just the way AS handles variable assignments for anything except String, Boolean, Number, int, and uint. I did not know PHP treats assignments differently. Good to know. Thanks :)


[code]
var aNum:uint = 0
var bNum:uint = aNum

trace (aNum) //0
trace (bNum) //0

aNum = 2
trace (aNum) //2
trace (bNum) //0
[/code]</description>
		<content:encoded><![CDATA[<p>Exactly, since you made a custom object you are sharing a reference. Really has nothing to do with Arrays and just the way AS handles variable assignments for anything except String, Boolean, Number, int, and uint. I did not know PHP treats assignments differently. Good to know. Thanks :)</p>
<p>[code]<br />
var aNum:uint = 0<br />
var bNum:uint = aNum</p>
<p>trace (aNum) //0<br />
trace (bNum) //0</p>
<p>aNum = 2<br />
trace (aNum) //2<br />
trace (bNum) //0<br />
[/code]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: colbycheeze</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-361465</link>
		<dc:creator>colbycheeze</dc:creator>
		<pubDate>Sat, 27 Dec 2008 03:57:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-361465</guid>
		<description>I had this confusing issue once before, and it took a while to figure it out.

I thin it is actually much better this way however, so I am glad it does it.

I do wish you could pass primitives as reference like in C++ however...</description>
		<content:encoded><![CDATA[<p>I had this confusing issue once before, and it took a while to figure it out.</p>
<p>I thin it is actually much better this way however, so I am glad it does it.</p>
<p>I do wish you could pass primitives as reference like in C++ however&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Reid</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-361463</link>
		<dc:creator>Jason Reid</dc:creator>
		<pubDate>Sat, 27 Dec 2008 03:51:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-361463</guid>
		<description>Yeah, this is really a PHP thing. Most languages (Javascript included) work more like the way that AS3 does. 

C doesn&#039;t have built-in push / pop operators on it&#039;s arrays, so its behavior would depend on whatever libraries you were using for list management.</description>
		<content:encoded><![CDATA[<p>Yeah, this is really a PHP thing. Most languages (Javascript included) work more like the way that AS3 does. </p>
<p>C doesn&#8217;t have built-in push / pop operators on it&#8217;s arrays, so its behavior would depend on whatever libraries you were using for list management.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Rodriguez</title>
		<link>http://www.emanueleferonato.com/2008/12/26/a-strange-way-as3-manages-arrays/comment-page-1/#comment-361403</link>
		<dc:creator>Daniel Rodriguez</dc:creator>
		<pubDate>Sat, 27 Dec 2008 00:00:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=798#comment-361403</guid>
		<description>That remembers me a day I almost died with a project in java, it happens something similar.</description>
		<content:encoded><![CDATA[<p>That remembers me a day I almost died with a project in java, it happens something similar.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
