<?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: Loop Safety</title>
	<atom:link href="http://jacksondunstan.com/articles/170/feed" rel="self" type="application/rss+xml" />
	<link>http://jacksondunstan.com/articles/170</link>
	<description>Mastering AS3</description>
	<lastBuildDate>Tue, 07 Feb 2012 09:30:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/170/comment-page-1#comment-10</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Sun, 19 Jul 2009 02:11:55 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=170#comment-10</guid>
		<description>Thanks for this. It&#039;s the subject of post for Friday the 24th.</description>
		<content:encoded><![CDATA[<p>Thanks for this. It&#8217;s the subject of post for Friday the 24th.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: golgobot</title>
		<link>http://jacksondunstan.com/articles/170/comment-page-1#comment-9</link>
		<dc:creator>golgobot</dc:creator>
		<pubDate>Sat, 11 Jul 2009 05:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=170#comment-9</guid>
		<description>on that note what would this code trace out?

&lt;pre lang=&quot;actionscript3&quot;&gt;
var dict:Dictionary = new Dictionary();
dict[NaN] = &quot;NaN Real&quot;;
dict[&quot;NaN&quot;] = &quot;NaN String&quot;;
dict[null] = &quot;null Real&quot;;
dict[&quot;null&quot;] = &quot;null String&quot;;
dict[Dictionary] = &quot;Dictionary real&quot;;
dict[&quot;flash.utils.Dictionary&quot;] = &quot;Dictionary String&quot;;
trace(dict[NaN] + &quot;, &quot; + dict[null] + &quot;, &quot; + dict[Dictionary])
&lt;/pre&gt;

When you actually run this code, you&#039;ll be surprised, but not taken aback.</description>
		<content:encoded><![CDATA[<p>on that note what would this code trace out?</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> dict<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Dictionary</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Dictionary</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #004993;">NaN</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;NaN Real&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;NaN&quot;</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;NaN String&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;null Real&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;null&quot;</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;null String&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #004993;">Dictionary</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;Dictionary real&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;flash.utils.Dictionary&quot;</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;Dictionary String&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>dict<span style="color: #000000;">&#91;</span><span style="color: #004993;">NaN</span><span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot;, &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> dict<span style="color: #000000;">&#91;</span><span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot;, &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> dict<span style="color: #000000;">&#91;</span><span style="color: #004993;">Dictionary</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span></pre></div></div>

<p>When you actually run this code, you&#8217;ll be surprised, but not taken aback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/170/comment-page-1#comment-8</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Fri, 10 Jul 2009 18:00:55 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=170#comment-8</guid>
		<description>This is actually in my notes for an upcoming post. I will cover some details of dictionary keys. For example, what kinds of type conversion do you think it does? Consider this:

&lt;pre lang=&quot;actionscript3&quot;&gt;
var dict:Dictionary = new Dictionary();
dict[3] = &quot;hello&quot;;
trace(dict[&quot;3&quot;]); // what is printed?
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>This is actually in my notes for an upcoming post. I will cover some details of dictionary keys. For example, what kinds of type conversion do you think it does? Consider this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> dict<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Dictionary</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Dictionary</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">3</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;hello&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>dict<span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;3&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// what is printed?</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: golgobot</title>
		<link>http://jacksondunstan.com/articles/170/comment-page-1#comment-7</link>
		<dc:creator>golgobot</dc:creator>
		<pubDate>Fri, 10 Jul 2009 17:53:31 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=170#comment-7</guid>
		<description>That got me to thinking.

What do you think the following code would do?

&lt;pre lang=&quot;actionscript3&quot;&gt;
var dict:Dictionary = new Dictionary();
dict[null] = &quot;null&quot;;
dict[undefined] = &quot;undefined&quot;;
dict[NaN] = &quot;NaN&quot;;
dict[int] = &quot;int&quot;;

for (var i:* in dict)
{
	trace(&quot;dict[&quot;+i+&quot;] = &quot; + dict[i]);
}

for each (var j:* in dict)
{
	trace(&quot;j = &quot; + j);
}
&lt;/pre&gt;

Well apparently it&#039;s all valid. Here&#039;s the output.

dict[null] = null
dict[undefined] = undefined
dict[NaN] = NaN
dict[[class int]] = int
j = null
j = undefined
j = NaN
j = int</description>
		<content:encoded><![CDATA[<p>That got me to thinking.</p>
<p>What do you think the following code would do?</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> dict<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Dictionary</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Dictionary</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;null&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #0033ff; font-weight: bold;">undefined</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;undefined&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #004993;">NaN</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;NaN&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
dict<span style="color: #000000;">&#91;</span><span style="color: #004993;">int</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;int&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:*</span> <span style="color: #0033ff; font-weight: bold;">in</span> dict<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;dict[&quot;</span><span style="color: #000066; font-weight: bold;">+</span>i<span style="color: #000066; font-weight: bold;">+</span><span style="color: #990000;">&quot;] = &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> dict<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> j<span style="color: #000066; font-weight: bold;">:*</span> <span style="color: #0033ff; font-weight: bold;">in</span> dict<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;j = &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> j<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Well apparently it&#8217;s all valid. Here&#8217;s the output.</p>
<p>dict[null] = null<br />
dict[undefined] = undefined<br />
dict[NaN] = NaN<br />
dict[[class int]] = int<br />
j = null<br />
j = undefined<br />
j = NaN<br />
j = int</p>
]]></content:encoded>
	</item>
</channel>
</rss>

