[ruby-core:96375] [Ruby master Feature#15915] `@1` cannot be achieved in meta-programming

[email protected]
Newsgroups gmane.comp.lang.ruby.core
Message-ID <redmine.journal-83291.20191220141030.cac516be1538a47f@ruby-lang.org>
Issue #15915 has been updated by znz (Kazuhiro NISHIYAMA).

Status changed from Open to Closed

I think this issue resolved by changing from `@1` to `_1`.

----------------------------------------
Feature #15915: `@1` cannot be achieved in meta-programming
https://bugs.ruby-lang.org/issues/15915#change-83291

* Author: znz (Kazuhiro NISHIYAMA)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
I cannot think of any way to get `@1` in meta-programming, so it is hard to inspect it in a debugger.

~~~
% ruby -e 'proc{@1;binding.local_variable_get("@1")}.call(1)'
Traceback (most recent call last):
	2: from -e:1:in `<main>'
	1: from -e:1:in `block in <main>'
-e:1:in `local_variable_get': wrong local variable name `@1' for #<Binding:0x00007f952401e490> (NameError)
~~~

---Files--------------------------------
local_variable_get-for-numparam.patch (3.61 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.