https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112014-07-09T04:04:27ZRuby Issue Tracking SystemRuby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=476522014-07-09T04:04:27Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p><code>fetch_at</code> sounds much better than values_at! to me.</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=476592014-07-09T14:12:26Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/47659/diff?detail_id=34448">diff</a>)</li></ul><p>+1 for <code>fetch_at</code>.</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=476672014-07-09T19:00:34Zwojtekmach (Wojtek Mach)wojtek@wojtekmach.pl
<ul><li><strong>File</strong> <a href="/attachments/4535">fetch_at.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4535/fetch_at.patch">fetch_at.patch</a> added</li></ul><p>I attached another patch calling this method fetch_at and I also added missing tests (I couldn't change issue title & body to reflect this changes, though).</p>
<p>Also, perhaps out of scope for this ticket but I'm wondering what're your thoughts about adding <code>#fetch_at</code> to <code>ENV</code> and <code>Array</code> too.</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=476682014-07-09T19:28:55Zavit (Andrew Vit)andrew@avit.ca
<ul></ul><p>Please consider the name <code>fetch_at</code> carefully: it seems easily confused with <code>fetch</code> (1 key), and the name doesn't hint that it's for multiple keys. (<code>values_at</code> is plural, so it gives a good clue.) Maybe <code>fetch_values</code>?</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=480172014-07-24T20:42:22Zwojtekmach (Wojtek Mach)wojtek@wojtekmach.pl
<ul></ul><p>Andrew Vit wrote:</p>
<blockquote>
<p>Please consider the name <code>fetch_at</code> carefully: it seems easily confused with <code>fetch</code> (1 key), and the name doesn't hint that it's for multiple keys. (<code>values_at</code> is plural, so it gives a good clue.) Maybe <code>fetch_values</code>?</p>
</blockquote>
<p>Personally, I prefer <code>fetch_at</code> but <code>fetch_values</code> (or <code>fetch_values_at</code>) is also good!</p>
<p>I'm curious what other core developers think.</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=488992014-09-14T10:23:33Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>For the reason Andrew pointed out, I also prefer <code>#fetch_values</code>.<br>
Maybe we need to conduct voting?</p>
<p>Matz.</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=489952014-09-20T03:23:37Zjihwans (Jihwan Song)jihwan2@gmail.com
<ul></ul><p>one vote for <code>#values_at</code></p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=490092014-09-20T08:15:47Zphluid61 (Matthew Kerwin)matthew@kerwin.net.au
<ul></ul><p>-1 for <code>values_at!</code> (this isn't a "!" method)</p>
<p>+0 for <code>fetch_at</code> (it's not clear that it isn't just an alias for <code>#fetch</code>)</p>
<p>+1 for <code>fetch_values</code></p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=493962014-10-13T10:10:31Zwojtekmach (Wojtek Mach)wojtek@wojtekmach.pl
<ul></ul><p>Should we get some more votes here, or should I just change my patch to use fetch_values?</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=502722014-12-03T21:49:33Zwojtekmach (Wojtek Mach)wojtek@wojtekmach.pl
<ul></ul><p>I submitted PR for this change: <a href="https://github.com/ruby/ruby/pull/776" class="external">https://github.com/ruby/ruby/pull/776</a> calling the method <code>fetch_values</code>.</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=513322015-02-02T04:29:19Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><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>Matz, can we introduce this <code>Hash#fetch_values</code>?</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=527232015-06-02T21:42:14Zwojtekmach (Wojtek Mach)wojtek@wojtekmach.pl
<ul><li><strong>Subject</strong> changed from <i>Add `Hash#values_at!`</i> to <i>Add `Hash#fetch_values!`</i></li></ul><p>Hi, please let me know if there's anything I can do to move this ticket forward.</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=527242015-06-02T21:42:36Zwojtekmach (Wojtek Mach)wojtek@wojtekmach.pl
<ul><li><strong>Subject</strong> changed from <i>Add `Hash#fetch_values!`</i> to <i>Add `Hash#fetch_values`</i></li></ul> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=528582015-06-12T07:17:01Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>#fetch_values approved.</p>
<p>Matz.</p> Ruby master - Feature #10017: Add `Hash#fetch_values`https://bugs.ruby-lang.org/issues/10017?journal_id=528712015-06-12T08:34:53Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Applied in changeset r50845.</p>
<hr>
<p>hash.c: fetch_values</p>
<ul>
<li>hash.c (rb_hash_fetch_values): add <code>Hash#fetch_values</code>.<br>
[Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Add `Hash#fetch_values` (Closed)" href="https://bugs.ruby-lang.org/issues/10017">#10017</a>] [Fix GH-776]</li>
</ul>