https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112022-06-17T13:46:18ZRuby Issue Tracking SystemRuby master - Bug #18837: Not possible to evaluate expression with numbered parameters in ithttps://bugs.ruby-lang.org/issues/18837?journal_id=980912022-06-17T13:46:18Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/15915">Feature #15915</a>: `@1` cannot be achieved in meta-programming</i> added</li></ul> Ruby master - Bug #18837: Not possible to evaluate expression with numbered parameters in ithttps://bugs.ruby-lang.org/issues/18837?journal_id=983852022-07-20T01:58:29Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>I talked a bit with some of the committers.</p>
<p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/17">@ko1 (Koichi Sasada)</a> said that it is difficult to retrieve <code>_1</code> afterwards due to the current implementation limitation, since the actual arguments may be dropped by optimization when a block that does not accept formal arguments is called.</p>
<p>Also, <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/14">@znz (Kazuhiro NISHIYAMA)</a> pointed out that the meta-programming API to read out only <code>_1</code> is somewhat unreasonable, since the meaning of <code>_1</code> depends on the presence of _2.</p>
<pre><code>{ 1 => "A" }.each do
p _1 #=> [1, "A"]
end
{ 1 => "A" }.each do
p _1 #=> 1
_2
end
</code></pre> Ruby master - Bug #18837: Not possible to evaluate expression with numbered parameters in ithttps://bugs.ruby-lang.org/issues/18837?journal_id=984152022-07-21T12:28:07Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>We discussed this issue at the dev meeting. <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/13">@matz (Yukihiro Matsumoto)</a> agreed that it is difficult to support this for the reasons I said in <a href="#note-2">#note-2</a>.</p> Ruby master - Bug #18837: Not possible to evaluate expression with numbered parameters in ithttps://bugs.ruby-lang.org/issues/18837?journal_id=1002382022-11-24T17:06:28Zalanwu (Alan Wu)
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/19137">Feature #19137</a>: Numbered parameters are not made available to IRB.</i> added</li></ul> Ruby master - Bug #18837: Not possible to evaluate expression with numbered parameters in ithttps://bugs.ruby-lang.org/issues/18837?journal_id=1070422024-02-28T11:12:27Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/20308">Bug #20308</a>: `it` and numbered parameters do not work in `eval`</i> added</li></ul>