summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-03 11:04:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-03 11:04:35 +0000
commitaae36756dcc4d5debcaabd03379796bc41360bc4 (patch)
treeff4ed4df6473229d846ff4f658094fcf66c4c744 /object.c
parentc960141333a9bc384bafbcfaa49672e48677d6dd (diff)
* object.c (Init_Object): added Object#object_id, new name for
Object#id. [new] * object.c (rb_obj_id_obsolete): give warning for Object#id. * numeric.c (fix_intern): added Fixnum#to_sym. [new] * object.c (sym_to_sym): rename from Symbol#intern * enum.c (enum_zip): added Enumerable#zip. [new] * array.c (rb_ary_zip): added Array#zip. * error.c (init_syserr): remove sys_nerr dependency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/object.c b/object.c
index 27e6987..80d2d65 100644
--- a/object.c
+++ b/object.c
@@ -74,6 +74,14 @@ rb_obj_id(obj)
}
VALUE
+rb_obj_id_obsolete(obj)
+ VALUE obj;
+{
+ rb_warning("Object#id will be deprecated; use Object#object_id");
+ return rb_obj_id(obj);
+}
+
+VALUE
rb_class_real(cl)
VALUE cl;
{
@@ -540,7 +548,7 @@ sym_to_s(sym)
}
static VALUE
-sym_intern(sym)
+sym_to_sym(sym)
VALUE sym;
{
return sym;
@@ -1316,8 +1324,9 @@ Init_Object()
rb_define_method(rb_mKernel, "eql?", rb_obj_equal, 1);
rb_define_method(rb_mKernel, "hash", rb_obj_id, 0);
- rb_define_method(rb_mKernel, "id", rb_obj_id, 0);
+ rb_define_method(rb_mKernel, "id", rb_obj_id_obsolete, 0);
rb_define_method(rb_mKernel, "__id__", rb_obj_id, 0);
+ rb_define_method(rb_mKernel, "object_id", rb_obj_id, 0);
rb_define_method(rb_mKernel, "type", rb_obj_type, 0);
rb_define_method(rb_mKernel, "class", rb_obj_class, 0);
@@ -1386,7 +1395,7 @@ Init_Object()
rb_define_method(rb_cSymbol, "inspect", sym_inspect, 0);
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, "intern", sym_intern, 0);
+ rb_define_method(rb_cSymbol, "to_sym", sym_to_sym, 0);
rb_define_method(rb_cModule, "===", rb_mod_eqq, 1);
rb_define_method(rb_cModule, "==", rb_obj_equal, 1);