summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-20 09:04:50 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-20 09:04:50 +0000
commit594c1d7f361d7ca52861905c2966e710420e9635 (patch)
tree525cb886764a5918505bca77f2bdd56477a51bce /object.c
parentbac58ed71c35054ddcbf4ba12a385a9df3683a42 (diff)
* object.c, NEWS, test/ruby/test_symbol.rb: Revert Symbol#to_proc
since it does not pass the tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/object.c b/object.c
index e705099..c644b85 100644
--- a/object.c
+++ b/object.c
@@ -1206,34 +1206,6 @@ sym_to_sym(sym)
return sym;
}
-static VALUE
-sym_call(args, mid)
- VALUE args, mid;
-{
- VALUE obj;
-
- if (RARRAY_LEN(args) < 1) {
- rb_raise(rb_eArgError, "no receiver given");
- }
- obj = rb_ary_shift(args);
- return rb_apply(obj, (ID)mid, args);
-}
-
-/*
- * call-seq:
- * sym.to_proc
- *
- * Returns a _Proc_ object which respond to the given method by _sym_.
- *
- * (1..3).collect(&:to_s) #=> ["1", "2", "3"]
- */
-
-static VALUE
-sym_to_proc(VALUE sym)
-{
- return rb_proc_new(sym_call, (VALUE)SYM2ID(sym));
-}
-
/***********************************************************************
*
@@ -2778,7 +2750,6 @@ Init_Object()
rb_define_method(rb_cSymbol, "to_s", sym_to_s, 0);
rb_define_method(rb_cSymbol, "id2name", sym_to_s, 0);
rb_define_method(rb_cSymbol, "to_sym", sym_to_sym, 0);
- rb_define_method(rb_cSymbol, "to_proc", sym_to_proc, 0);
rb_define_method(rb_cSymbol, "===", rb_obj_equal, 1);
rb_define_method(rb_cModule, "freeze", rb_mod_freeze, 0);