https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-04-27T16:46:00ZRuby Issue Tracking SystemRuby master - Feature #4621: NilClass#to_hashhttps://bugs.ruby-lang.org/issues/4621?journal_id=166732011-04-27T16:46:00Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>matz (Yukihiro Matsumoto)</i></li></ul><p>=begin</p>
<p>=end</p> Ruby master - Feature #4621: NilClass#to_hashhttps://bugs.ruby-lang.org/issues/4621?journal_id=166742011-04-27T16:52:50Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Rejected</i></li></ul><p>=begin</p>
<p>=end</p> Ruby master - Feature #4621: NilClass#to_hashhttps://bugs.ruby-lang.org/issues/4621?journal_id=166752011-04-27T17:23:06Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>=begin<br>
Hi,</p>
<p>In message "Re: <a href="/issues/4621">[ruby-core:35924]</a> [Ruby 1.9 - Feature <a class="issue tracker-2 status-6 priority-4 priority-default closed" title="Feature: NilClass#to_hash (Rejected)" href="https://bugs.ruby-lang.org/issues/4621">#4621</a>][Assigned] NilClass#to_hash"<br>
on Wed, 27 Apr 2011 16:46:01 +0900, Yui NARUSE <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a> writes:</p>
<p>|Is there any reason why <code>to_a</code>, <code>to_s</code>, <code>to_i</code>, <code>to_f</code>, <code>to_c</code> are all defined on <code>NilClass</code> but not for <code>to_hash</code>? If there is not, I would like to request this feature.</p>
<p>to_a, etc. are explicit conversion methods, whereas to_int, to_hash,<br>
etc. are implicit conversion methods. I don't see any good reason to<br>
add implicit conversion methods to nil.</p>
<pre><code> matz.
</code></pre>
<p>=end</p>