[#28395] [Bug #2830] Some methods raise ArgumentError instead of TypeError — Marc-Andre Lafortune <redmine@...>
Bug #2830: Some methods raise ArgumentError instead of TypeError
[#28405] [Feature #2832] Vector#each and Enumerable — Marc-Andre Lafortune <redmine@...>
Feature #2832: Vector#each and Enumerable
[#28452] Watched issues on redmine — Caleb Clausen <vikkous@...>
Is there a page on redmine that will show me the list of issues that
[#28482] Question on scoped constant resolution Class vs Module — Peter McLain <peter.mclain@...>
I asked this on ruby-talk, but didn't get anywhere. Someone suggested
[#28505] [Bug #2838] Ruby 1.8.7 (2009-06-12 patchlevel 174) strange round behaviour — P K <redmine@...>
Bug #2838: Ruby 1.8.7 (2009-06-12 patchlevel 174) strange round behaviour
[#28552] [Bug #2945] Regexp#=== is failed by an exception when the exception is occurred in method_missing — Kenta Murata <redmine@...>
Bug #2945: Regexp#=== is failed by an exception when the exception is occurred in method_missing
Hi,
Hi,
Hi,
Hi,
[#28561] Ruby::DL vs Ruby::FFI — Aston <blackapache512-ticket@...>
Ruby.DL and FFI libraries are great for programmers like me who are not internet programmers, but are more interested in scientific and number processing etc.
On Mon, Mar 8, 2010 at 4:56 PM, Aston <blackapache512-ticket@yahoo.com> wrote:
[#28576] "rake not found" error on a rubygems test — Yusuke ENDOH <mame@...>
Hi Eric Hodel,
[#28583] build failure on 26861 using msys/mingw — Jon <jon.forums@...>
Can anyone replicate? I've recently updated both binutils and the mingw runtime so this may very well be my configuration.
[#28602] [Bug #2952] Time.strftime format %N — Russell Penney <redmine@...>
Bug #2952: Time.strftime format %N
[#28643] [Bug #2957] IO.print emits field separator after each object, rather than between — Daniel Kelley <redmine@...>
Bug #2957: IO.print emits field separator after each object, rather than between
[#28665] [ANN] 1.9.2 release plan — Yusuke ENDOH <mame@...>
Hi,
[#28686] trunk (26947) build fail with msys/mingw/vista — Jon <jon.forums@...>
I get the following build failure when msysgit's "c:\git\cmd" dir is on PATH.
On Tue, Mar 16, 2010 at 5:50 AM, Jon <jon.forums@gmail.com> wrote:
[#28712] When a trace hook raises an exception, should it terminate the program? — Rocky Bernstein <rockyb@...>
In Ruby 1.8 and the Ruby 1.9 trunk when running a trace hook that raises an
On Wed, Mar 17, 2010 at 5:42 AM, Rocky Bernstein <rockyb@rubyforge.org> wrote:
Let me clarify a bit because I think some of the facts (some by me) may have
On Thu, Mar 18, 2010 at 5:52 AM, Rocky Bernstein <rockyb@rubyforge.org> wrote:
[#28724] [Feature:trunk] Array#repeated_(permutation|combination) — "KISHIMOTO, Makoto" <ksmakoto@...4u.or.jp>
New methods Array#repeated_(permutation|combination).
[#28735] [Bug #2982] Ruby tries to link with both openssl and readline — Lucas Nussbaum <redmine@...>
Bug #2982: Ruby tries to link with both openssl and readline
Issue #2982 has been updated by caleb clausen.
Hi,
[#28783] [Feature #2065] An ancestors iterator — Simon Chiang <redmine@...>
Issue #2065 has been updated by Simon Chiang.
Hi,
[#28837] [Bug #2993] Module#instance_methods' flag seems to be ignored in singleton classes — Xavier Noria <redmine@...>
Bug #2993: Module#instance_methods' flag seems to be ignored in singleton classes
[#28859] st.c: pool allocator for tables and entries — Eric Wong <normalperson@...>
Hi all,
[#28865] Can DRb be used across a fork() — Chris Schlaeger <cschlaeger@...>
I'm trying to use DRb to communicate between a parent and child
[#28871] WeakRef extending Delegator is a bug waiting to happen? — Charles Oliver Nutter <headius@...>
Hopefully this doesn't contradict my other email too much :)
[#28902] [Bug #2998] gets fails in mingw — Roger Pack <redmine@...>
Bug #2998: gets fails in mingw
[#28907] [Bug #3000] Open SSL Segfaults — Christian Höltje <redmine@...>
Bug #3000: Open SSL Segfaults
Issue #3000 has been updated by Hiroshi NAKAMURA.
Hi,
Hi,
Hi,
[#28924] [Bug #3005] Ruby core dump - [BUG] rb_sys_fail() - errno == 0 — Sebastian YEPES <redmine@...>
Bug #3005: Ruby core dump - [BUG] rb_sys_fail() - errno == 0
[#28954] [Feature #3010] slow require gems in ruby 1.9.1 — Miao Jiang <redmine@...>
Feature #3010: slow require gems in ruby 1.9.1
[#29019] [Bug #3015] NetBSD vs test/dl — Michael Graff <redmine@...>
Bug #3015: NetBSD vs test/dl
On Fri, Mar 26, 2010 at 11:49:59AM +0900, Michael Graff wrote:
[#29031] [Feature #1395](Open) Steppable Kernel::eval — Yusuke Endoh <redmine@...>
Issue #1395 has been updated by Yusuke Endoh.
[#29045] [Feature #3021] Array#product should accept a block. — Marc-Andre Lafortune <redmine@...>
Feature #3021: Array#product should accept a block.
[#29092] merged psych to trunk — Aaron Patterson <aaron@...>
Hey everyone,
[#29118] [Bug #3051] psych is too osx-specifc — Michael Graff <redmine@...>
Bug #3051: psych is too osx-specifc
[#29128] [Bug #3052] DRb::start_service fails to detect used port — Chris Schlaeger <redmine@...>
Bug #3052: DRb::start_service fails to detect used port
Issue #3052 has been updated by Yusuke Endoh.
[#29131] [trunk:bug] Many rubygems tests fail with psych tests. — Tanaka Akira <akr@...>
Many rubygems tests fail with psych tests.
(2010/03/30 17:55), Tanaka Akira wrote:
On Tue, Mar 30, 2010 at 07:13:32PM +0900, NARUSE, Yui wrote:
[#29161] [Bug #3058] Inconsistent eol conversion of IO#read on Windows — Heesob Park <redmine@...>
Bug #3058: Inconsistent eol conversion of IO#read on Windows
[#29167] [Feature #3067] complex.c : Question: why Complex#~ is disabled? It's in the doc — Benoit Daloze <redmine@...>
Feature #3067: complex.c : Question: why Complex#~ is disabled? It's in the doc
[#29179] [Bug #3071] Convert rubygems and rdoc to use psych — Aaron Patterson <redmine@...>
Bug #3071: Convert rubygems and rdoc to use psych
Doesn't this mean the the RubyGems codevase would now be forked
Issue #3071 has been updated by Nobuyoshi Nakada.
[#29186] [Bug #3072] Classes Inheriting from Data — Run Paint Run Run <redmine@...>
Bug #3072: Classes Inheriting from Data
[ruby-core:28386] [Bug #2184] Blocks strange behavior
Issue #2184 has been updated by Yusuke Endoh.
Hi,
> 1.9.1:
> z = lambda {|x,y| x <=> y}
> [3,2,1].max(&z) # => ArgumentError: wrong number of arguments (1 for 2)
>
> But it works in 1.9:
> z = lambda {|x| x[0] <=> x[1]}
> [3,2,1].max(&z) # => 3
Since r11431, 1.9 had been optimized Enumerable#each_with_index, min
and max by reusing array for yield parameters. This causes the above
behavior.
But the optimization was found wrong in [ruby-dev:32181], which may
cause unexpected behaviors:
$ ./ruby -e '(1..5).max {|a| p a; a << :foo; a[0] <=> a[1] }'
[2, 1]
[3, 2, :foo]
[4, 3, :foo, :foo]
[5, 4, :foo, :foo, :foo] <= unexpected accumulation
$ ./ruby -e 'b = nil; (1..5).max {|a| p a; b ||= a.freeze; a[0] <=> a[1] }; p b'
[2, 1]
[3, 2]
[4, 3]
[5, 4]
[5, 4] <= expected [2, 1]
So, the opt of Enumerable#each_with_index was reverted, but min and
max seemed to be forgotten.
Here is a patch to fix Enumerable#min, max and minmax. Unless anyone
expresses opposition, I'll commit.
diff --git a/enum.c b/enum.c
index 6eeb62c..4f930ae 100644
--- a/enum.c
+++ b/enum.c
@@ -1058,10 +1058,7 @@ min_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
*memo = i;
}
else {
- VALUE ary = memo[1];
- RARRAY_PTR(ary)[0] = i;
- RARRAY_PTR(ary)[1] = *memo;
- cmp = rb_yield(ary);
+ cmp = rb_yield_values(2, i, *memo);
if (rb_cmpint(cmp, i, *memo) < 0) {
*memo = i;
}
@@ -1087,18 +1084,16 @@ min_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
static VALUE
enum_min(VALUE obj)
{
- VALUE result[2];
+ VALUE result = Qundef;
- result[0] = Qundef;
if (rb_block_given_p()) {
- result[1] = rb_ary_new3(2, Qnil, Qnil);
- rb_block_call(obj, id_each, 0, 0, min_ii, (VALUE)result);
+ rb_block_call(obj, id_each, 0, 0, min_ii, (VALUE)&result);
}
else {
- rb_block_call(obj, id_each, 0, 0, min_i, (VALUE)result);
+ rb_block_call(obj, id_each, 0, 0, min_i, (VALUE)&result);
}
- if (result[0] == Qundef) return Qnil;
- return result[0];
+ if (result == Qundef) return Qnil;
+ return result;
}
static VALUE
@@ -1131,10 +1126,7 @@ max_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
*memo = i;
}
else {
- VALUE ary = memo[1];
- RARRAY_PTR(ary)[0] = i;
- RARRAY_PTR(ary)[1] = *memo;
- cmp = rb_yield(ary);
+ cmp = rb_yield_values(2, i, *memo);
if (rb_cmpint(cmp, i, *memo) > 0) {
*memo = i;
}
@@ -1159,24 +1151,21 @@ max_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
static VALUE
enum_max(VALUE obj)
{
- VALUE result[2];
+ VALUE result = Qundef;
- result[0] = Qundef;
if (rb_block_given_p()) {
- result[1] = rb_ary_new3(2, Qnil, Qnil);
- rb_block_call(obj, id_each, 0, 0, max_ii, (VALUE)result);
+ rb_block_call(obj, id_each, 0, 0, max_ii, (VALUE)&result);
}
else {
- rb_block_call(obj, id_each, 0, 0, max_i, (VALUE)result);
+ rb_block_call(obj, id_each, 0, 0, max_i, (VALUE)&result);
}
- if (result[0] == Qundef) return Qnil;
- return result[0];
+ if (result == Qundef) return Qnil;
+ return result;
}
struct minmax_t {
VALUE min;
VALUE max;
- VALUE ary;
VALUE last;
};
@@ -1242,17 +1231,11 @@ minmax_ii_update(VALUE i, VALUE j, struct minmax_t *memo)
memo->max = j;
}
else {
- VALUE ary = memo->ary;
-
- rb_ary_store(ary, 0, i);
- rb_ary_store(ary, 1, memo->min);
- n = rb_cmpint(rb_yield(ary), i, memo->min);
+ n = rb_cmpint(rb_yield_values(2, i, memo->min), i, memo->min);
if (n < 0) {
memo->min = i;
}
- rb_ary_store(ary, 0, j);
- rb_ary_store(ary, 1, memo->max);
- n = rb_cmpint(rb_yield(ary), j, memo->max);
+ n = rb_cmpint(rb_yield_values(2, j, memo->max), j, memo->max);
if (n > 0) {
memo->max = j;
}
@@ -1264,7 +1247,7 @@ minmax_ii(VALUE i, VALUE _memo, int argc, VALUE *argv)
{
struct minmax_t *memo = (struct minmax_t *)_memo;
int n;
- VALUE ary, j;
+ VALUE j;
ENUM_WANT_SVALUE();
@@ -1275,10 +1258,7 @@ minmax_ii(VALUE i, VALUE _memo, int argc, VALUE *argv)
j = memo->last;
memo->last = Qundef;
- ary = memo->ary;
- rb_ary_store(ary, 0, j);
- rb_ary_store(ary, 1, i);
- n = rb_cmpint(rb_yield(ary), j, i);
+ n = rb_cmpint(rb_yield_values(2, j, i), j, i);
if (n == 0)
i = j;
else if (n < 0) {
@@ -1317,7 +1297,6 @@ enum_minmax(VALUE obj)
memo.min = Qundef;
memo.last = Qundef;
if (rb_block_given_p()) {
- memo.ary = ary;
rb_block_call(obj, id_each, 0, 0, minmax_ii, (VALUE)&memo);
if (memo.last != Qundef)
minmax_ii_update(memo.last, memo.last, &memo);
--
Yusuke ENDOH <mame@tsg.ne.jp>
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2184
----------------------------------------
http://redmine.ruby-lang.org