[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:73648] [Ruby trunk Feature#12042]A better interface that returns a list of local variables available where the exception is raised
From:
mail@...
Date:
2016-02-02 13:29:53 UTC
List:
ruby-core #73648
Issue #12042 has been updated by Yuki Nishijima.
As you may know, in Ruby 2.2 and older, `#local_variables` returns a list of local variables available in the scope where the method is called, or raises an NameError if it's called from outside of the class:
```ruby
class NameError
def call_local_variables
foo = bar = nil
local_variables
end
end
the_value = nil
begin
doesnt_exist
rescue => e
# Ruby 2.2 and older
e.local_variables # => NoMethodError: private method `local_variables' called...
e.call_local_variables # => [:foo, :bar]
end
```
We've changed it to behave like the following:
```ruby
... # same setup
begin
doesnt_exist
rescue => e
# Ruby 2.3 (current)
e.local_variables # => [:the_value]
e.call_local_variables # => [:the_value]
end
```
And an example of what I would like to add/change would be something like:
```ruby
... # same setup
begin
doesnt_exist
rescue => e
# Ruby 2.4
e.local_variables # => NoMethodError: private method `local_variables' called...
e.call_local_variables # => [:foo, :bar]
e.something_new # => [:the_value]
end
```
----------------------------------------
Feature #12042: A better interface that returns a list of local variables available where the exception is raised
https://bugs.ruby-lang.org/issues/12042#change-56839
* Author: Yuki Nishijima
* Status: Feedback
* Priority: Normal
* Assignee:
----------------------------------------
We've changed the behavior of `NameError#local_variables` as discussed on #11777, but I'm not actually satisfied by the change. This change has made it impossible to get a list of local variables available within a NameError scope. It would be nice, if we could add a new method that does what `NameError#local_variables` does right now, and change the `local_variables` method back to the previous behavior.
I actually don't have a good name in mind, but please let me know if anyone has a good name for it.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>