Permalink
Browse files

2000-05-01

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 5cffff5 commit 817a62de81d75c73cceb453301ef27b094f17c14 matz committed May 1, 2000
Showing with 1,836 additions and 1,450 deletions.
  1. +108 −53 ChangeLog
  2. +1 −0 MANIFEST
  3. +1 −1 README
  4. +1 −1 README.EXT
  5. +1 −1 README.jp
  6. +59 −28 array.c
  7. +4 −2 bignum.c
  8. +18 −3 class.c
  9. +2 −2 compar.c
  10. +4 −0 config.guess
  11. +1 −1 config.sub
  12. +268 −244 configure
  13. +16 −2 configure.in
  14. +4 −2 dir.c
  15. +2 −2 dln.c
  16. +5 −2 dln.h
  17. +3 −2 enum.c
  18. +5 −2 env.h
  19. +10 −2 error.c
  20. +45 −47 eval.c
  21. +1 −1 ext/extmk.rb.in
  22. +2 −0 ext/socket/extconf.rb
  23. +4 −0 ext/socket/getaddrinfo.c
  24. +29 −16 ext/socket/socket.c
  25. +15 −24 ext/tk/lib/tktext.rb
  26. +4 −2 file.c
  27. +4 −2 gc.c
  28. +4 −2 hash.c
  29. +2 −2 inits.c
  30. +17 −2 intern.h
  31. +39 −26 io.c
  32. +48 −13 lib/cgi.rb
  33. +2 −0 lib/cgi/session.rb
  34. +179 −135 lib/debug.rb
  35. +749 −0 lib/net/telnet.rb
  36. +6 −736 lib/telnet.rb
  37. +5 −1 lib/thread.rb
  38. +3 −0 lib/timeout.rb
  39. +4 −2 main.c
  40. +4 −2 marshal.c
  41. +2 −2 math.c
  42. +40 −6 misc/ruby-mode.el
  43. +3 −2 node.h
  44. +5 −9 numeric.c
  45. +6 −2 object.c
  46. +2 −2 pack.c
  47. +10 −10 parse.y
  48. +2 −2 prec.c
  49. +4 −2 process.c
  50. +2 −2 random.c
  51. +2 −2 range.c
  52. +3 −3 re.c
  53. +3 −3 re.h
  54. +3 −3 regex.c
  55. +2 −0 ruby.c
  56. +5 −3 ruby.h
  57. +2 −2 rubyio.h
  58. +5 −2 rubysig.h
  59. +5 −1 sample/test.rb
  60. +4 −0 signal.c
  61. +2 −0 sprintf.c
  62. +24 −15 string.c
  63. +4 −2 struct.c
  64. +2 −2 time.c
  65. +2 −2 util.c
  66. +3 −2 util.h
  67. +6 −2 variable.c
  68. +2 −2 version.c
  69. +2 −2 version.h
View
161 ChangeLog

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -130,6 +130,7 @@ lib/net/ftp.rb
lib/net/pop.rb
lib/net/protocol.rb
lib/net/smtp.rb
+lib/net/telnet.rb
lib/observer.rb
lib/open3.rb
lib/ostruct.rb
View
2 README
@@ -129,7 +129,7 @@ You can redistribute it and/or modify it under either the terms of the GPL
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
* Ruby home-page
View
@@ -881,7 +881,7 @@ Returns the name of the class.
int rb_respond_to(VALUE object, ID id)
-Returns true if the object reponds to the message specified by id.
+Returns true if the object responds to the message specified by id.
** Instance Variables
View
@@ -172,7 +172,7 @@ Public License)
4. ¾�Υץ����ؤΰ��ѤϤ����ʤ���Ū�Ǥ��켫ͳ�Ǥ�����
������ܥץ����˴ޤޤ��¾�κ�Ԥˤ�륳���ɤϡ���
- �줾��κ�Ԥΰո��ˤ����¤��ä�����礬����ޤ���
+ �줾��κ�Ԥΰո��ˤ����¤��ä�����礬����ޤ���
����Ū�ˤ�gc.c(����)��util.c(����)��st.[ch]��regex.[ch]
����� ./missing�ǥ��쥯�ȥ겼�Υե����뷲������ޤ���
View
87 array.c
@@ -1,4 +1,4 @@
-/************************************************
+/**********************************************************************
array.c -
@@ -7,8 +7,10 @@
created at: Fri Aug 6 09:46:12 JST 1993
Copyright (C) 1993-2000 Yukihiro Matsumoto
+ Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+ Copyright (C) 2000 Information-technology Promotion Agancy, Japan
-************************************************/
+**********************************************************************/
#include "ruby.h"
#include "util.h"
@@ -276,8 +278,15 @@ rb_ary_push_m(argc, argv, ary)
VALUE *argv;
VALUE ary;
{
- while (argc--) {
- rb_ary_store(ary, RARRAY(ary)->len, *argv++);
+ if (argc > 0) {
+ long len = RARRAY(ary)->len;
+
+ --argc;
+ /* make rooms by copying the last item */
+ rb_ary_store(ary, len + argc, argv[argc]);
+
+ if (argc) /* if any rest */
+ MEMCPY(RARRAY(ary)->ptr + len, argv, VALUE, argc);
}
return ary;
}
@@ -340,6 +349,26 @@ rb_ary_unshift(ary, item)
return ary;
}
+static VALUE
+rb_ary_unshift_m(argc, argv, ary)
+ int argc;
+ VALUE *argv;
+ VALUE ary;
+{
+ if (argc > 0) {
+ long len = RARRAY(ary)->len;
+
+ /* make rooms by setting the last item */
+ rb_ary_store(ary, len + argc - 1, Qnil);
+
+ /* sliding items */
+ MEMMOVE(RARRAY(ary)->ptr + argc, RARRAY(ary)->ptr, VALUE, len);
+
+ MEMCPY(RARRAY(ary)->ptr, argv, VALUE, argc);
+ }
+ return ary;
+}
+
VALUE
rb_ary_entry(ary, offset)
VALUE ary;
@@ -980,6 +1009,27 @@ rb_ary_collect(ary)
return collect;
}
+static VALUE
+rb_ary_collect_bang(ary)
+ VALUE ary;
+{
+ long i;
+
+ rb_ary_modify(ary);
+ for (i = 0; i < RARRAY(ary)->len; i++) {
+ RARRAY(ary)->ptr[i] = rb_yield(RARRAY(ary)->ptr[i]);
+ }
+ return ary;
+}
+
+static VALUE
+rb_ary_filter(ary)
+ VALUE ary;
+{
+ rb_warn("Array#filter is deprecated; use Array#collect!");
+ return rb_ary_collect_bang(ary);
+}
+
VALUE
rb_ary_delete(ary, item)
VALUE ary;
@@ -1091,19 +1141,6 @@ rb_ary_delete_if(ary)
return ary;
}
-static VALUE
-rb_ary_filter(ary)
- VALUE ary;
-{
- long i;
-
- rb_ary_modify(ary);
- for (i = 0; i < RARRAY(ary)->len; i++) {
- RARRAY(ary)->ptr[i] = rb_yield(RARRAY(ary)->ptr[i]);
- }
- return ary;
-}
-
static VALUE
rb_ary_replace_m(ary, ary2)
VALUE ary, ary2;
@@ -1195,17 +1232,9 @@ VALUE
rb_ary_concat(x, y)
VALUE x, y;
{
- VALUE *p, *pend;
-
- rb_ary_modify(x);
Check_Type(y, T_ARRAY);
- p = RARRAY(y)->ptr;
- pend = p + RARRAY(y)->len;
- while (p < pend) {
- rb_ary_store(x, RARRAY(x)->len, *p);
- p++;
- }
+ rb_ary_push_m(RARRAY(y)->len, RARRAY(y)->ptr, x);
return x;
}
@@ -1575,7 +1604,7 @@ Init_Array()
rb_define_method(rb_cArray, "push", rb_ary_push_m, -1);
rb_define_method(rb_cArray, "pop", rb_ary_pop, 0);
rb_define_method(rb_cArray, "shift", rb_ary_shift, 0);
- rb_define_method(rb_cArray, "unshift", rb_ary_unshift, 1);
+ rb_define_method(rb_cArray, "unshift", rb_ary_unshift_m, -1);
rb_define_method(rb_cArray, "each", rb_ary_each, 0);
rb_define_method(rb_cArray, "each_index", rb_ary_each_index, 0);
rb_define_method(rb_cArray, "reverse_each", rb_ary_reverse_each, 0);
@@ -1594,11 +1623,13 @@ Init_Array()
rb_define_method(rb_cArray, "sort", rb_ary_sort, 0);
rb_define_method(rb_cArray, "sort!", rb_ary_sort_bang, 0);
rb_define_method(rb_cArray, "collect", rb_ary_collect, 0);
+ rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0);
+ rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0);
+ rb_define_method(rb_cArray, "filter", rb_ary_filter, 0);
rb_define_method(rb_cArray, "delete", rb_ary_delete, 1);
rb_define_method(rb_cArray, "delete_at", rb_ary_delete_at_m, -1);
rb_define_method(rb_cArray, "delete_if", rb_ary_delete_if, 0);
rb_define_method(rb_cArray, "reject!", rb_ary_delete_if, 0);
- rb_define_method(rb_cArray, "filter", rb_ary_filter, 0);
rb_define_method(rb_cArray, "replace", rb_ary_replace_m, 1);
rb_define_method(rb_cArray, "clear", rb_ary_clear, 0);
rb_define_method(rb_cArray, "fill", rb_ary_fill, -1);
View
@@ -1,12 +1,14 @@
-/************************************************
+/**********************************************************************
bignum.c -
$Author$
$Date$
created at: Fri Jun 10 00:48:55 JST 1994
-************************************************/
+ Copyright (C) 1993-2000 Yukihiro Matsumoto
+
+**********************************************************************/
#include "ruby.h"
#include <math.h>
View
21 class.c
@@ -1,4 +1,4 @@
-/************************************************
+/**********************************************************************
class.c -
@@ -8,7 +8,7 @@
Copyright (C) 1993-2000 Yukihiro Matsumoto
-************************************************/
+**********************************************************************/
#include "ruby.h"
#include "node.h"
@@ -502,15 +502,30 @@ rb_undef_method(klass, name)
rb_add_method(klass, rb_intern(name), 0, NOEX_UNDEF);
}
+#define SPECIAL_SINGLETON(x,c) if (obj == (x)) {\
+ if (!FL_TEST(c, FL_SINGLETON)) {\
+ c = rb_singleton_class_new(c);\
+ rb_singleton_class_attached(c,obj);\
+ }\
+ return c;\
+}
+
VALUE
rb_singleton_class(obj)
VALUE obj;
{
VALUE klass;
- if (rb_special_const_p(obj)) {
+ if (FIXNUM_P(obj) || SYMBOL_P(obj)) {
rb_raise(rb_eTypeError, "can't define singleton");
}
+ if (rb_special_const_p(obj)) {
+ SPECIAL_SINGLETON(Qnil, rb_cNilClass);
+ SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
+ SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
+ rb_bug("unknown immediate %d", obj);
+ }
+
if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON)) {
klass = RBASIC(obj)->klass;
}
View
@@ -1,4 +1,4 @@
-/************************************************
+/**********************************************************************
compar.c -
@@ -8,7 +8,7 @@
Copyright (C) 1993-2000 Yukihiro Matsumoto
-************************************************/
+**********************************************************************/
#include "ruby.h"
View
@@ -969,6 +969,10 @@ EOF
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
+ *:"Mac OS":*:*)
+ echo `uname -p`-apple-macos${UNAME_RELEASE}
+ exit 0 ;;
+
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
View
@@ -910,7 +910,7 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
+ | -interix* | -uwin* | -rhapsody* | -openstep* | -macos | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
Oops, something went wrong.

0 comments on commit 817a62d

Please sign in to comment.