------art_91220_4453122.1216578044497
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Sun, Jul 20, 2008 at 7:55 PM, Urabe Shyouhei <shyouhei / ruby-lang.org>
wrote:

> Nasir Khan wrote:
> > While nil is an object, calling dup on it causes TypeError. This doesnt
> seem
> > consistent, though a minor kink.
> > IMHO, ideally duping a nil object should have returned (same) nil.
> >
>
> I don't think so. Nil is _the_ nil, one and only instance of NilClass.
> Duping it doesn't make sense to me.  And a dup method to return
> identical object is just strange.
>
>
it makes sense to me, to implement dup on singleton objects like nil to
implement deep copying of arrays and hashes.

-- henon

------art_91220_4453122.1216578044497
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dirtr">On Sun, Jul 20, 2008 at 7:55 PM, Urabe Shyouhei &lt;<a hrefailto:shyouhei / ruby-lang.org">shyouhei / ruby-lang.org</a>&gt; wrote:<br><div classmail_quote"><blockquote classmail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div classj3C7c">Nasir Khan wrote:<br>
&gt; While nil is an object, calling dup on it causes TypeError. This doesnt seem<br>
&gt; consistent, though a minor kink.<br>
&gt; IMHO, ideally duping a nil object should have returned (same) nil.<br>
&gt;<br>
<br>
</div></div>I don&#39;t think so. Nil is _the_ nil, one and only instance of NilClass.<br>
Duping it doesn&#39;t make sense to me. &nbsp;And a dup method to return<br>
identical object is just strange.<br>
<br>
</blockquote></div><br>it makes sense to me, to implement dup on singleton objects like nil to implement deep copying of arrays and hashes.<br><br>-- henon<br></div>

------art_91220_4453122.1216578044497--