mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* array.c (rb_ary_values_at): new method to replace select(index..).
* hash.c (rb_hash_values_at,env_values_at): ditto. * re.c (match_values_at): ditto. * struct.c (rb_struct_values_at): ditto. * re.c (match_select): add iterator behavior. * ext/curses/curses.c, ext/digest/sha2/sha2.c, ext/iconv/iconv.c, ext/racc/cparse/cparse.c: include "ruby.h" at the top to shut up "_FILE_OFFSET_BITS redefined" warning on Solaris. * class.c (rb_class_protected_instance_methods): now gives warnings to show migration path. The default will be reversed on Jan 2004. * numeric.c (num_step): "1.1.step(1.5,0.1)" to work. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f001f2f6d5
commit
f595d5b0d2
12 changed files with 243 additions and 100 deletions
61
object.c
61
object.c
|
@ -899,43 +899,63 @@ rb_mod_const_defined(mod, name)
|
|||
}
|
||||
|
||||
static VALUE
|
||||
rb_obj_methods(obj)
|
||||
rb_obj_methods(argc, argv, obj)
|
||||
int argc;
|
||||
VALUE *argv;
|
||||
VALUE obj;
|
||||
{
|
||||
VALUE argv[1];
|
||||
if (argc == 0) {
|
||||
VALUE args[1];
|
||||
|
||||
argv[0] = Qtrue;
|
||||
return rb_class_instance_methods(1, argv, CLASS_OF(obj));
|
||||
args[0] = Qtrue;
|
||||
return rb_class_instance_methods(1, args, CLASS_OF(obj));
|
||||
}
|
||||
return rb_class_instance_methods(argc, argv, CLASS_OF(obj));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rb_obj_protected_methods(obj)
|
||||
rb_obj_protected_methods(argc, argv, obj)
|
||||
int argc;
|
||||
VALUE *argv;
|
||||
VALUE obj;
|
||||
{
|
||||
VALUE argv[1];
|
||||
if (argc == 0) { /* hack to stop warning */
|
||||
VALUE args[1];
|
||||
|
||||
argv[0] = Qtrue;
|
||||
return rb_class_protected_instance_methods(1, argv, CLASS_OF(obj));
|
||||
args[0] = Qtrue;
|
||||
return rb_class_protected_instance_methods(1, args, CLASS_OF(obj));
|
||||
}
|
||||
return rb_class_protected_instance_methods(argc, argv, CLASS_OF(obj));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rb_obj_private_methods(obj)
|
||||
rb_obj_private_methods(argc, argv, obj)
|
||||
int argc;
|
||||
VALUE *argv;
|
||||
VALUE obj;
|
||||
{
|
||||
VALUE argv[1];
|
||||
if (argc == 0) { /* hack to stop warning */
|
||||
VALUE args[1];
|
||||
|
||||
argv[0] = Qtrue;
|
||||
return rb_class_private_instance_methods(1, argv, CLASS_OF(obj));
|
||||
args[0] = Qtrue;
|
||||
return rb_class_private_instance_methods(1, args, CLASS_OF(obj));
|
||||
}
|
||||
return rb_class_private_instance_methods(argc, argv, CLASS_OF(obj));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
rb_obj_public_methods(obj)
|
||||
rb_obj_public_methods(argc, argv, obj)
|
||||
int argc;
|
||||
VALUE *argv;
|
||||
VALUE obj;
|
||||
{
|
||||
VALUE argv[1];
|
||||
if (argc == 0) { /* hack to stop warning */
|
||||
VALUE args[1];
|
||||
|
||||
argv[0] = Qtrue;
|
||||
return rb_class_public_instance_methods(1, argv, CLASS_OF(obj));
|
||||
args[0] = Qtrue;
|
||||
return rb_class_public_instance_methods(1, args, CLASS_OF(obj));
|
||||
}
|
||||
return rb_class_public_instance_methods(argc, argv, CLASS_OF(obj));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
@ -1382,12 +1402,11 @@ Init_Object()
|
|||
rb_define_method(rb_mKernel, "to_a", rb_any_to_a, 0); /* to be removed */
|
||||
rb_define_method(rb_mKernel, "to_s", rb_any_to_s, 0);
|
||||
rb_define_method(rb_mKernel, "inspect", rb_obj_inspect, 0);
|
||||
rb_define_method(rb_mKernel, "methods", rb_obj_methods, 0);
|
||||
rb_define_method(rb_mKernel, "public_methods", rb_obj_methods, 0);
|
||||
rb_define_method(rb_mKernel, "methods", rb_obj_methods, -1);
|
||||
rb_define_method(rb_mKernel, "singleton_methods", rb_obj_singleton_methods, -1);
|
||||
rb_define_method(rb_mKernel, "protected_methods", rb_obj_protected_methods, 0);
|
||||
rb_define_method(rb_mKernel, "private_methods", rb_obj_private_methods, 0);
|
||||
rb_define_method(rb_mKernel, "public_methods", rb_obj_public_methods, 0);
|
||||
rb_define_method(rb_mKernel, "protected_methods", rb_obj_protected_methods, -1);
|
||||
rb_define_method(rb_mKernel, "private_methods", rb_obj_private_methods, -1);
|
||||
rb_define_method(rb_mKernel, "public_methods", rb_obj_public_methods, -1);
|
||||
rb_define_method(rb_mKernel, "instance_variables", rb_obj_instance_variables, 0);
|
||||
rb_define_method(rb_mKernel, "instance_variable_get", rb_obj_ivar_get, 1);
|
||||
rb_define_method(rb_mKernel, "instance_variable_set", rb_obj_ivar_set, 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue