From 04f006aea3c96792f0a1fe699875743b71c12af5 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 30 Jun 2005 06:20:09 +0000 Subject: * eval.c (rb_eval): pre-evaluate argument for unambiguous evaluation order. [ruby-dev:26383] * lib/delegate.rb (Delegator::method_missing): forward unknown method to the destination. suggested by . [ruby-talk:146776] * process.c (detach_process_watcher): terminate process watcher thread right after rb_waitpid() succeed. [ruby-talk:146430] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 22 ++++++++++++++++++++++ eval.c | 12 +++++++----- lib/delegate.rb | 8 ++++++++ lib/set.rb | 1 + process.c | 2 +- 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 004e1c4557..51511df017 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Thu Jun 30 15:13:16 2005 Yukihiro Matsumoto + + * eval.c (rb_eval): pre-evaluate argument for unambiguous + evaluation order. [ruby-dev:26383] + +Thu Jun 30 09:53:56 2005 Yukihiro Matsumoto + + * lib/delegate.rb (Delegator::method_missing): forward unknown + method to the destination. suggested by + . [ruby-talk:146776] + Tue Jun 28 21:59:29 2005 Kazuhiro NISHIYAMA * dir.c, eval.c, hash.c, process.c, ruby.c: avoid warning "unused @@ -8,6 +19,11 @@ Sat Jun 25 17:15:23 2005 GOTOU Yuuzou * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_query): should discard if key=val pair is empty. patch from Gary Wright. +Sat Jun 25 23:30:51 2005 Yukihiro Matsumoto + + * process.c (detach_process_watcher): terminate process watcher + thread right after rb_waitpid() succeed. [ruby-talk:146430] + Sat Jun 25 15:49:18 2005 Nobuyoshi Nakada * enum.c (enum_min, enum_max): do not ignore nil as the first element. @@ -141,6 +157,7 @@ Mon Jun 13 13:01:05 2005 Hirokazu Yamamoto * hash.c (ruby_setenv): fixed SEGV. [ruby-dev:26186] +>>>>>>> 1.2673.2.1092 Mon Jun 13 01:54:20 2005 Yukihiro Matsumoto * signal.c (sigexit): call rb_thread_signal_exit() instead of @@ -155,6 +172,11 @@ Mon Jun 13 01:54:20 2005 Yukihiro Matsumoto * eval.c (rb_f_exit): ensure exit(0) should call exit(EXIT_SUCCESS). +Mon Jun 13 01:20:02 2005 Tanaka Akira + + * eval.c (rb_gc_mark_threads): curr_thread may not be part of the + thread list. [ruby-dev:26312] + Fri Jun 10 23:35:34 2005 Yukihiro Matsumoto * missing/mkdir.c: remove. [ruby-core:05177] diff --git a/eval.c b/eval.c index 886914c428..287d00bf40 100644 --- a/eval.c +++ b/eval.c @@ -3256,9 +3256,11 @@ rb_eval(self, n) case NODE_DOT2: case NODE_DOT3: - result = rb_range_new(rb_eval(self, node->nd_beg), - rb_eval(self, node->nd_end), - nd_type(node) == NODE_DOT3); + { + VALUE beg = rb_eval(self, node->nd_beg); + VALUE end = rb_eval(self, node->nd_end); + result = rb_range_new(beg, end, nd_type(node) == NODE_DOT3); + } break; case NODE_FLIP2: /* like AWK */ @@ -9905,9 +9907,9 @@ rb_gc_mark_threads() rb_gc_mark((VALUE)ruby_cref); if (!curr_thread) return; - FOREACH_THREAD(th) { + FOREACH_THREAD_FROM(main_thread, th) { rb_gc_mark(th->thread); - } END_FOREACH(th); + } END_FOREACH_FROM(main_thread, th); } static void diff --git a/lib/delegate.rb b/lib/delegate.rb index 2a30bc94b1..97467cd435 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -49,6 +49,14 @@ class Delegator end alias initialize_methods initialize + def method_missing(m, *args) + target = self.__getobj__ + unless target.respond_to?(m) + super(m, *args) + end + target.__send__(m, *args) + end + def __getobj__ raise NotImplementedError, "need to define `__getobj__'" end diff --git a/lib/set.rb b/lib/set.rb index 586a5d9f4d..0ad47c842f 100644 --- a/lib/set.rb +++ b/lib/set.rb @@ -519,6 +519,7 @@ end module Enumerable # Makes a set from the enumerable object with given arguments. + # Needs to +require "set"+ to use this method. def to_set(klass = Set, *args, &block) klass.new(self, *args, &block) end diff --git a/process.c b/process.c index 1fbf7962b2..9b1c29da21 100644 --- a/process.c +++ b/process.c @@ -845,7 +845,7 @@ detach_process_watcer(pid_p) for (;;) { cpid = rb_waitpid(*pid_p, &status, WNOHANG); - if (cpid == -1) return Qnil; + if (cpid != 0) return Qnil; rb_thread_sleep(1); } } -- cgit v1.2.3