[#23357] [Feature #1432] decrement and increment — Oleg Puchinin <redmine@...>
Feature #1432: decrement and increment
[#23372] [Bug #1438] dylib architecture error building 1.9.1-rc2 on osx10.5.6 — Matthew Moss <redmine@...>
Bug #1438: dylib architecture error building 1.9.1-rc2 on osx10.5.6
[#23402] [Bug #1448] [patch] Proper handling of recursive arrays — Marc-Andre Lafortune <redmine@...>
Bug #1448: [patch] Proper handling of recursive arrays
[#23449] Submit bugs against 1.9.1? — Robert Klemme <shortcutter@...>
Hi there,
[#23457] [Bug #1471] "Mutual join" deadlock detection faulty in 1.8.6 and 1.8.7 — John Carter <redmine@...>
Bug #1471: "Mutual join" deadlock detection faulty in 1.8.6 and 1.8.7
[#23464] [Feature #1473] Improvements on expect.rb — Luiz Angelo Daros de Luca <redmine@...>
Feature #1473: Improvements on expect.rb
[#23483] [Bug #1478] Ruby archive — Oleg Puchinin <redmine@...>
Bug #1478: Ruby archive
Issue #1478 has been updated by Luis Lavena.
On Fri, Apr 2, 2010 at 17:13, Luis Lavena <redmine@ruby-lang.org> wrote:
> Thanks for your comment.
OK Hiroshi, I read some of the comments earlier in the thread that I
On 5/20/10, Jonathan Nielsen <jonathan@jmnet.us> wrote:
Hi,
(2010/05/22 19:58), Benoit Daloze wrote:
On 22 May 2010 18:40, Urabe Shyouhei wrote:
(2010/05/23 2:38), Benoit Daloze wrote:
On Sat, May 22, 2010 at 1:21 PM, Urabe Shyouhei <shyouhei@ruby-lang.org> wr=
[#23491] [Bug #1482] Kernel.exec doesn't respect COMSPEC environment variable on Windows — Evgeniy Dolzhenko <redmine@...>
Bug #1482: Kernel.exec doesn't respect COMSPEC environment variable on Windows
[#23492] [Bug #1484] Ruby 1.8.6_p368 and Ruby 1.8.7_p160 have threading regressions — Hans de Graaff <redmine@...>
Bug #1484: Ruby 1.8.6_p368 and Ruby 1.8.7_p160 have threading regressions
[#23499] [Bug #1487] String#each_char must return self — Marc-Andre Lafortune <redmine@...>
Bug #1487: String#each_char must return self
Hi,
On Sat, 23 May 2009 10:20:50 +0900
[#23501] [Bug #1490] DateTime::civil fails with second=59 and fractional second > 0 — Paul Harris <redmine@...>
Bug #1490: DateTime::civil fails with second=59 and fractional second > 0
[#23505] [Bug #1494] tempfile#unlink may silently fail on windows — Nicholas Manning <redmine@...>
Bug #1494: tempfile#unlink may silently fail on windows
Issue #1494 has been updated by Shyouhei Urabe.
Issue #1494 has been updated by Hongli Lai.
[#23520] [Bug #1504] installed ri docu is not where ri actually searches when compiled with program-suffix — Yuki Sonoda <redmine@...>
Bug #1504: installed ri docu is not where ri actually searches when compiled with program-suffix
[#23538] [ANN] RubyKaigi2009: Commiter Invitation — SASADA Koichi <ko1@...>
Hi,
[#23543] a feature for ruby: Kernel#in? — Roger Pack <rogerdpack@...>
Following a discussion on ruby-talk of a few ideas for ruby[1],
Excerpts from rogerdpack's message of Mon May 25 07:41:36 +0300 2009:
> I am pretty opposed to adding #in?; however, it is currently
[#23572] [Bug #1525] Deadlock in Ruby 1.9's VM caused by ConditionVariable.wait and fork? — Hongli Lai <redmine@...>
Bug #1525: Deadlock in Ruby 1.9's VM caused by ConditionVariable.wait and fork?
Issue #1525 has been updated by Vanja Bucic.
On Jul 21, 2009, at 9:06 PM, Vanja Bucic wrote:
Issue #1525 has been updated by Vanja Bucic.
Vanja Bucic wrote:
none < wrote:
Issue #1525 has been updated by Eric Wong.
Issue #1525 has been updated by Nobuyoshi Nakada.
In article <4b03c299d3778_4360404660a1be@redmine.ruby-lang.org>,
In article <87einw55ej.fsf@fsij.org>,
Tanaka Akira wrote:
[#23584] [Bug #1528] setlocale is not initialized causing problems when using iconv — Hans de Graaff <redmine@...>
Bug #1528: setlocale is not initialized causing problems when using iconv
[#23593] Defining #name= at the class level — Gregory Brown <gregory.t.brown@...>
Hi folks,
Hi,
Excerpts from Yukihiro Matsumoto's message of Fri May 29 01:21:19 +0300 2009:
Hi,
[#23595] Meaning of RUBY_PLATFORM — Rick DeNatale <rick.denatale@...>
The RUBY_PLATFORM constant is documented in the latest Pickaxe as "The
On Thu, May 28, 2009 at 3:41 PM, Rick DeNatale <rick.denatale@gmail.com> wr=
On Thu, May 28, 2009 at 2:52 PM, Luis Lavena <luislavena@gmail.com> wrote:
On Thu, May 28, 2009 at 7:08 PM, Rick DeNatale <rick.denatale@gmail.com> wr=
On Thu, May 28, 2009 at 7:22 PM, Luis Lavena <luislavena@gmail.com> wrote:
> 1) The guy who wrote the gem fell into the trap of assuming that
Roger Pack wrote:
[#23614] [Bug #1535] Hash#merge! Inside Iterator Can Cause RuntimeError — Run Paint Run Run <redmine@...>
Bug #1535: Hash#merge! Inside Iterator Can Cause RuntimeError
[#23630] Expected Behaviour of Modifying an Iterator in the Block to Which it Yields? — Run Paint Run Run <runrun@...>
Hi,
[#23636] feature request: Directory.dir? — Roger Pack <rogerdpack@...>
For some reason it seems odd to have to do File.dir?
[#23639] [Bug #1541] mingw ssl: Errno::ENOTSOCK: An operation was attempted on something that is not a socket. — Roger Pack <redmine@...>
Bug #1541: mingw ssl: Errno::ENOTSOCK: An operation was attempted on something that is not a socket.
Issue #1541 has been updated by Roger Pack.
[#23644] [Bug #1545] Patches for the Hash Documentation — Run Paint Run Run <redmine@...>
Bug #1545: Patches for the Hash Documentation
Excerpts from message of Sun May 31 06:38:54 +0300 2009:
[#23646] Counterpart to File.extname — Martin DeMello <martindemello@...>
File.extname ought to have a complementary method that gets everything
On Sun, May 31, 2009 at 1:52 AM, Martin DeMello <martindemello@gmail.com> wrote:
On Mon, 1 Jun 2009 03:35:47 +0900
On Mon, Jun 1, 2009 at 6:11 AM, Michael Fellinger <m.fellinger@gmail.com> wrote:
[ruby-core:23402] [Bug #1448] [patch] Proper handling of recursive arrays
Bug #1448: [patch] Proper handling of recursive arrays
http://redmine.ruby-lang.org/issues/show/1448
Author: Marc-Andre Lafortune
Status: Open, Priority: Normal
Category: core, Target version: 1.9.2
ruby -v: ruby 1.9.2dev (2009-05-09 trunk 23371) [i386-darwin9.6.0]
Dealing with recursive arrays & hashes can be tricky.
The current handling of recursive arrays is much improved over that of Ruby 1.8.6. Array comparison still has some bugs though.
For instance:
x = []; x << x
y = [[x]]
x == y # ==> true
y == x # ==> false, should be true!
Morevoer, recursive arrays that are built the same way are not recognized as equal:
z = []; z << z
x == z # ==> false, should be true!
Needless to say, arrays that have the same elements (e.g. a single element, containing a single element, ...) but built differently way are not recognized as equal:
stone = []; stepping = [stone]; stone << stepping
x == stepping # ==> false, would be nice to be true!
The attached patch fixes all of these problems :-)
* How:
The function rb_exec_recursive handles the recursivity by pushing and poping the elements it encounters for a given method (for example eql?). For such comparisons, instead of keeping track of the elements it encounters, I modified it so that it keeps track of both the elements being compared. A recursion is detected only when a matching pair is found.
This takes care of the first problem. For the next two, we only need to observe that if we have a recursion on the pair (x,y) when comparing x and y, then it is because they are not different! Changing the return value for recursive cases from nil (not comparable) / false (different) to Qundef (unknown yet) makes comparison of complex recursive "trees" work beautifully. I've added some cute samples in rubyspecs (core/array/shared/equal.rb)
* Implementation details:
Previous recursive_push/pop/check maintained a hash of encountered object ids, setting hash[obj] = true. I modified them so that in "paired" cases, it sets hash[obj] = paired_obj. If a pair (obj, different_paired_obj) is encountered later on, I set hash[obj] to {paired_obj => true, different_paired_obj => true}.
This way, there is basically no runtime cost to this technique, except in the complex recursive cases. Only for these complex cases is there a small additional cost for the hash creation/destruction.
* Last problem:
There is one more problem that my patch doesn't cover (lack of mri-fu): hashes for recursive structures are incorrect. As per the official doc, "a.eql? b" should imply "a.hash == b.hash". On the other hand, we have (before or after my patch):
a = [x]
x.eql? a # ==> true
a.eql? x # ==> true
x.hash == a.hash # ==> false, should have same hash
The solution is that when calculating the hash for an array, if a recursion is detected, then the hash should return a fixed value (say 0 or -length) _for the original_ array. Currently, 0 is returned but at the level that the recursion is detected. In Ruby pseudo-code, it would look like:
static VALUE
recursive_hash(VALUE ary, VALUE dummy, int recur)
{
long i, h;
VALUE n;
if (recur) {
+ raise HashingRecursionDetected
- return LONG2FIX(0);
}
h = rb_hash_start(RARRAY_LEN(ary));
for (i=0; i<RARRAY_LEN(ary); i++) {
n = rb_hash(RARRAY_PTR(ary)[i]);
h = rb_hash_uint(h, NUM2LONG(n));
}
h = rb_hash_end(h);
return LONG2FIX(h);
}
static VALUE
rb_ary_hash(VALUE ary)
{
return rb_exec_recursive(recursive_hash, ary, 0);
+ rescue HashingRecursionDetected
+ return -length
}
A similar modification must be made for hash.c.
Thanks
Marc-Andr辿 Lafortune
----------------------------------------
http://redmine.ruby-lang.org