From: "sawa (Tsuyoshi Sawada)" <noreply@ruby-lang.org>
To: ruby-core@neon.ruby-lang.org
Subject: [ruby-core:110826] [Ruby master Feature#19137] Numbered parameters are not made available to IRB.
Date: Sun, 20 Nov 2022 10:18:03 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-100182.20221120101803.52552@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-19137.20221120030801.52552@ruby-lang.org
Issue #19137 has been updated by sawa (Tsuyoshi Sawada).
I think the issue is that `_1` and so on are lexically scoped, and you want it not to be.
----------------------------------------
Feature #19137: Numbered parameters are not made available to IRB.
https://bugs.ruby-lang.org/issues/19137#change-100182
* Author: 0x1eef (0x 1eef)
* Status: Open
* Priority: Normal
----------------------------------------
Hello !
It does not look like numbered parameters are available through the Binding that's used by IRB.
```ruby
# repl.rb
[1,2,3].each do
binding.irb
end
```
```
$ irb repl.rb
irb(main):001:0> puts _1
repl.rb:1:in `block in <top (required)>': undefined local variable or method `_1' for main:Object (NameError)
```
Is it possible for them to be available ? Thanks!
--
https://bugs.ruby-lang.org/
prev parent reply other threads:[~2022-11-20 10:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-20 3:08 [ruby-core:110823] [Ruby master Feature#19137] Numbered parameters are not made available to IRB 0x1eef (0x 1eef)
2022-11-20 10:16 ` [ruby-core:110825] " sawa (Tsuyoshi Sawada)
2022-11-20 10:18 ` sawa (Tsuyoshi Sawada) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-100182.20221120101803.52552@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
--cc=ruby-core@neon.ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).