1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_lstrip_bang): new method.

* string.c (rb_str_rstrip_bang): new method.

* string.c (rb_str_associate): should consider STR_ASSOC too.

* eval.c (rb_undefined): do not recurse if method_missing is
  undefined.

* process.c (proc_waitpid): now all arguments are optional.

* process.c (Init_process): waitpid is now alias to wait.

* process.c (Init_process): waitpid2 is now alias to wait2.

* process.c (rb_waitpid): made public.

* ext/pty/pty.c (pty_getpty): avoid disturbing SIGCHLD using
  thread and rb_waitpid.

* process.c (proc_getpgrp): now takes no argument on all
  platforms.

* process.c (proc_setpgrp): ditto.

* ext/socket/socket.c (sock_s_pack_sockaddr_in): added
  Socket::pack_sockaddr_in(). [new]

* ext/socket/socket.c (sock_s_pack_sockaddr_un): added
  Socket::pack_sockaddr_un(). [new]

* ext/socket/socket.c (sock_s_pack_sockaddr_in): added
  Socket::unpack_sockaddr_in(). [new]

* ext/socket/socket.c (sock_s_pack_sockaddr_un): added
  Socket::unpack_sockaddr_un(). [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-08-06 03:05:23 +00:00
parent 439b453e3a
commit f33a61c28d
18 changed files with 336 additions and 248 deletions

View file

@ -17,8 +17,7 @@
#include <floatingpoint.h>
#endif
static ID coerce;
static ID to_i;
static ID id_coerce, id_to_i, id_div;
VALUE rb_cNumeric;
VALUE rb_cFloat;
@ -47,7 +46,7 @@ static VALUE
coerce_body(x)
VALUE *x;
{
return rb_funcall(x[1], coerce, 1, x[0]);
return rb_funcall(x[1], id_coerce, 1, x[0]);
}
static VALUE
@ -119,7 +118,7 @@ static VALUE
num_div(x, y)
VALUE x, y;
{
return rb_funcall(x, '/', 1, y);
return rb_funcall(x, id_div, 1, y);
}
static VALUE
@ -128,7 +127,7 @@ num_divmod(x, y)
{
VALUE div, mod;
div = rb_funcall(x, '/', 1, y);
div = rb_funcall(x, div, 1, y);
if (TYPE(div) == T_FLOAT) {
double d = floor(RFLOAT(div)->value);
@ -1535,8 +1534,9 @@ Init_Numeric()
/* allow divide by zero -- Inf */
fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_INV|FP_X_OFL));
#endif
coerce = rb_intern("coerce");
to_i = rb_intern("to_i");
id_coerce = rb_intern("coerce");
id_to_i = rb_intern("to_i");
id_div = rb_intern("div");
rb_eZeroDivError = rb_define_class("ZeroDivisionError", rb_eStandardError);
rb_eFloatDomainError = rb_define_class("FloatDomainError", rb_eRangeError);
@ -1550,7 +1550,7 @@ Init_Numeric()
rb_define_method(rb_cNumeric, "-@", num_uminus, 0);
rb_define_method(rb_cNumeric, "===", num_equal, 1);
rb_define_method(rb_cNumeric, "eql?", num_eql, 1);
rb_define_method(rb_cNumeric, "div", num_div, 1);
rb_define_method(rb_cNumeric, "/", num_div, 1);
rb_define_method(rb_cNumeric, "divmod", num_divmod, 1);
rb_define_method(rb_cNumeric, "modulo", num_modulo, 1);
rb_define_method(rb_cNumeric, "remainder", num_remainder, 1);
@ -1675,3 +1675,4 @@ Init_Numeric()
rb_define_method(rb_cFloat, "infinite?", flo_is_infinite_p, 0);
rb_define_method(rb_cFloat, "finite?", flo_is_finite_p, 0);
}