summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bootstraptest/test_method.rb8
-rw-r--r--eval.c22
-rw-r--r--insnhelper.ci6
-rw-r--r--lib/delegate.rb4
-rw-r--r--lib/matrix.rb2
-rw-r--r--lib/monitor.rb12
-rw-r--r--version.h6
8 files changed, 35 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index bb321908767..cfe3b502381 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 24 17:06:56 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_f_send_bang): abandon the name funcall for private
+ aware method call.
+
Thu Aug 23 20:31:31 2007 Koichi Sasada <ko1@atdot.net>
* compile.c: optimize simple massign.
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
index 9a59b63d5d2..776d6274a37 100644
--- a/bootstraptest/test_method.rb
+++ b/bootstraptest/test_method.rb
@@ -316,7 +316,7 @@ assert_equal '[1, 2]', %q( class C; def m(*a) a end end;
assert_equal '1', %q( class C; def m() 7 end; private :m end
begin C.new.send(:m); rescue NoMethodError; 1 end )
assert_equal '1', %q( class C; def m() 1 end; private :m end
- C.new.funcall(:m) )
+ C.new.send!(:m) )
# with block
assert_equal '[[:ok1, :foo], [:ok2, :foo, :bar]]',
@@ -867,7 +867,7 @@ assert_equal %q{[:ok, :ok, :ok, :ok, :ok, :ok, :ng, :ng]}, %q{
end
end
- alias funcall send unless defined? funcall
+ alias send! send unless defined? send!
c1 = c2 = nil
@@ -899,8 +899,8 @@ assert_equal %q{[:ok, :ok, :ok, :ok, :ok, :ok, :ng, :ng]}, %q{
test{o2.mm}
test{o1.send :m}
test{o2.send :mm}
- test{o1.funcall :m}
- test{o2.funcall :mm}
+ test{o1.send! :m}
+ test{o2.send! :mm}
test{o1.method(:m).call}
test{o2.method(:mm).call}
$ans
diff --git a/eval.c b/eval.c
index 367ca9e0487..3780c19aa80 100644
--- a/eval.c
+++ b/eval.c
@@ -1437,7 +1437,7 @@ rb_apply(VALUE recv, ID mid, VALUE args)
}
static VALUE
-send_funcall(int argc, VALUE *argv, VALUE recv, int scope)
+send_internal(int argc, VALUE *argv, VALUE recv, int scope)
{
VALUE vid;
@@ -1479,26 +1479,26 @@ rb_f_send(int argc, VALUE *argv, VALUE recv)
scope = NOEX_NOSUPER | NOEX_PRIVATE;
}
- return send_funcall(argc, argv, recv, scope);
+ return send_internal(argc, argv, recv, scope);
}
/*
* call-seq:
- * obj.funcall(symbol [, args...]) => obj
- * obj.__send!(symbol [, args...]) => obj
+ * obj.send!(symbol [, args...]) => obj
+ * obj.__send!(symbol [, args...]) => obj
*
* Invokes the method identified by _symbol_, passing it any
- * arguments specified. Unlike send, which calls private methods only
- * when it is invoked in function call style, funcall always aware of
+ * arguments specified. Unlike send, which calls public methods only
+ * when it is invoked in function call style, send! always aware of
* private methods.
*
- * 1.funcall(:puts, "hello") # prints "foo"
+ * 1.send!(:puts, "hello") # prints "foo"
*/
VALUE
-rb_f_funcall(int argc, VALUE *argv, VALUE recv)
+rb_f_send_bang(int argc, VALUE *argv, VALUE recv)
{
- return send_funcall(argc, argv, recv, NOEX_NOSUPER | NOEX_PRIVATE);
+ return send_internal(argc, argv, recv, NOEX_NOSUPER | NOEX_PRIVATE);
}
VALUE
@@ -2730,8 +2730,8 @@ Init_eval(void)
rb_define_method(rb_cBasicObject, "send", rb_f_send, -1);
rb_define_method(rb_cBasicObject, "__send__", rb_f_send, -1);
rb_define_method(rb_cBasicObject, "__send", rb_f_send, -1);
- rb_define_method(rb_cBasicObject, "funcall", rb_f_funcall, -1);
- rb_define_method(rb_cBasicObject, "__send!", rb_f_funcall, -1);
+ rb_define_method(rb_cBasicObject, "send!", rb_f_send_bang, -1);
+ rb_define_method(rb_cBasicObject, "__send!", rb_f_send_bang, -1);
rb_define_method(rb_mKernel, "instance_eval", rb_obj_instance_eval, -1);
rb_define_method(rb_mKernel, "instance_exec", rb_obj_instance_exec, -1);
diff --git a/insnhelper.ci b/insnhelper.ci
index 4c76ff1460f..a5cc0dfcc73 100644
--- a/insnhelper.ci
+++ b/insnhelper.ci
@@ -580,10 +580,10 @@ vm_send_optimize(rb_control_frame_t *reg_cfp,
{
if (*mn && nd_type((*mn)->nd_body) == NODE_CFUNC) {
NODE *node = (*mn)->nd_body;
- extern VALUE rb_f_funcall(int argc, VALUE *argv, VALUE recv);
+ extern VALUE rb_f_send_bang(int argc, VALUE *argv, VALUE recv);
extern VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
- if (node->nd_cfnc == rb_f_funcall || node->nd_cfnc == rb_f_send) {
+ if (node->nd_cfnc == rb_f_send_bang || node->nd_cfnc == rb_f_send) {
int i = *num - 1;
VALUE sym = TOPN(i);
*id = SYMBOL_P(sym) ? SYM2ID(sym) : rb_to_id(sym);
@@ -598,7 +598,7 @@ vm_send_optimize(rb_control_frame_t *reg_cfp,
DEC_SP(1);
}
- if (node->nd_cfnc == rb_f_funcall) {
+ if (node->nd_cfnc == rb_f_send_bang) {
*flag |= VM_CALL_FCALL_BIT;
}
}
diff --git a/lib/delegate.rb b/lib/delegate.rb
index b5ebaa15da6..01ed0871c6b 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -115,7 +115,7 @@
# implementation, see SimpleDelegator.
#
class Delegator
- preserved = [:__id__, :object_id, :__send__, :__send, :__send!, :respond_to?, :send, :funcall]
+ preserved = [:__id__, :object_id, :__send__, :__send, :__send!, :respond_to?, :send, :send!]
instance_methods.each do |m|
next if preserved.include?(m)
undef_method m
@@ -262,7 +262,7 @@ def DelegateClass(superclass)
klass = Class.new
methods = superclass.public_instance_methods(true)
methods -= [
- :__id__, :object_id, :__send__, :__send, :__send!, :respond_to?, :send, :funcall,
+ :__id__, :object_id, :__send__, :__send, :__send!, :respond_to?, :send, :send!,
:==, :equal?, :initialize, :method_missing, :__getobj__, :__setobj__,
:clone, :dup, :marshal_dump, :marshal_load,
]
diff --git a/lib/matrix.rb b/lib/matrix.rb
index d49e16b8fa9..6c4f4f54823 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -246,7 +246,7 @@ class Matrix
# use to general users.
#
def initialize(init_method, *argv)
- self.funcall(init_method, *argv)
+ self.send!(init_method, *argv)
end
def init_rows(rows, copy)
diff --git a/lib/monitor.rb b/lib/monitor.rb
index 4d31dca41ac..1b61f54dbaa 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -91,13 +91,13 @@ module MonitorMixin
if timeout
raise NotImplementedError, "timeout is not implemented yet"
end
- @monitor.funcall(:mon_check_owner)
- count = @monitor.funcall(:mon_exit_for_cond)
+ @monitor.send!(:mon_check_owner)
+ count = @monitor.send!(:mon_exit_for_cond)
begin
@cond.wait(@monitor.instance_variable_get("@mon_mutex"))
return true
ensure
- @monitor.funcall(:mon_enter_for_cond, count)
+ @monitor.send!(:mon_enter_for_cond, count)
end
end
@@ -114,12 +114,12 @@ module MonitorMixin
end
def signal
- @monitor.funcall(:mon_check_owner)
+ @monitor.send!(:mon_check_owner)
@cond.signal
end
def broadcast
- @monitor.funcall(:mon_check_owner)
+ @monitor.send!(:mon_check_owner)
@cond.broadcast
end
@@ -137,7 +137,7 @@ module MonitorMixin
def self.extend_object(obj)
super(obj)
- obj.funcall(:mon_initialize)
+ obj.send!(:mon_initialize)
end
#
diff --git a/version.h b/version.h
index a401d16b9f2..bd82404457f 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2007-08-23"
+#define RUBY_RELEASE_DATE "2007-08-24"
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20070823
+#define RUBY_RELEASE_CODE 20070824
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 23
+#define RUBY_RELEASE_DAY 24
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];