[#66678] [ruby-trunk - Feature #10481] Add "if" and "unless" clauses to rescue statements — alex@...
Issue #10481 has been updated by Alex Boyd.
3 messages
2014/12/04
[#66762] Re: [ruby-changes:36667] normal:r48748 (trunk): struct: avoid all O(n) behavior on access — Tanaka Akira <akr@...>
2014-12-10 0:44 GMT+09:00 normal <ko1@atdot.net>:
3 messages
2014/12/10
[#66851] [ruby-trunk - Feature #10585] struct: speedup struct.attr = v for first 10 attributes and struct[:attr] for big structs — funny.falcon@...
Issue #10585 has been updated by Yura Sokolov.
3 messages
2014/12/15
[#67126] Ruby 2.2.0 Released — "NARUSE, Yui" <naruse@...>
We are pleased to announce the release of Ruby 2.2.0.
8 messages
2014/12/25
[#67128] Re: Ruby 2.2.0 Released
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2014/12/25
I can't install it in any of our Ubuntu servers using rbenv:
[#67129] Re: Ruby 2.2.0 Released
— SHIBATA Hiroshi <shibata.hiroshi@...>
2014/12/25
> I can't install it in any of our Ubuntu servers using rbenv:
[ruby-core:66739] [ruby-trunk - Bug #10466] rb_eval_string_wrap does not actually wrap in a module binding
From:
josef.simanek@...
Date:
2014-12-08 02:00:36 UTC
List:
ruby-core #66739
Issue #10466 has been updated by Josef Simanek.
You can reproduce this without C code also.
```ruby
Module.new {X = 5} #=> #<Module:0x000000012186c0>
Module.new {X = 5} #=> #<Module:0x00000001209da0>
(irb):2: warning: already initialized constant X
(irb):1: warning: previous definition of X was here
```
And since `rb_eval_string_wrap` is really wrapping code into module, this works without warning:
```c
#include <ruby.h>
int main(int argc, char* argv[])
{
ruby_init();
int state;
rb_eval_string_wrap("self::Y = 'wrap'", &state);
rb_eval_string_wrap("self::Y = 'wrap'", &state);
return ruby_cleanup(0);
}
```
----------------------------------------
Bug #10466: rb_eval_string_wrap does not actually wrap in a module binding
https://bugs.ruby-lang.org/issues/10466#change-50331
* Author: Max Anselm
* Status: Open
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
`rb_eval_string_wrap` says that it "evaluates the given string under a module binding in an isolated binding", but this isn't true.
Run the following:
~~~
#include <ruby.h>
int main(int argc, char* argv[])
{
ruby_init();
int state;
rb_eval_string_protect("X = 2", &state);
rb_eval_string_wrap("X = 3", &state);
rb_eval_string_protect("puts X", &state);
return ruby_cleanup(0);
}
~~~
### Expected:
outputs 2
### Actual:
outputs
~~~
eval:1: warning: already initialized constant X
eval:1: warning: previous definition of X was here
3
~~~
It looks like `rb_eval_string_wrap` _tries_ to wrap it
~~~
th->top_wrapper = rb_module_new();
th->top_self = rb_obj_clone(rb_vm_top_self());
rb_extend_object(th->top_self, th->top_wrapper);
~~~
But it ends up calling `ruby_eval_string_from_file` which uses `rb_vm_top_self()` as `self`, thus undoing the wrapping.
`rb_load` can perform similar wrapping, but there it works properly.
--
https://bugs.ruby-lang.org/