Permalink
Browse files

* parse.y (parse_regx): should raise error on untermitated

  expression interpolation.

* pack.c (pack_unpack): should give length to utf8_to_uv().

* pack.c (utf8_to_uv): add length check.

* massages: replace "wrong #" by "wrong number".

* marshal.c (w_float): output Infinity and NaN explicitly.

* marshal.c (r_object): support new explicit float format.

* eval.c (rb_thread_wait_for): select may cause ERESTART on
  Solaris.

* eval.c (rb_thread_select): ditto.

* array.c (rb_ary_join): dumped core if sep is not T_STRING nor T_NIL.

* array.c (rb_ary_join): buffer size calculattion was wrong.

* array.c (rb_ary_to_s): if rb_output_fs is nil, insert newlines
  between array elements (use rb_default_rs as newline litral)
  [experimental].

* gc.c (init_mark_stack): no need to clear mark_stack.

* gc.c (gc_mark_all): need to handle finalizer mark.

* gc.c (gc_mark_rest): use MEMCPY instead of memcpy.

* gc.c (rb_gc_mark): earlier const check to avoid pusing special
  constants into mark stack.

* numeric.c (fix_to_s): 'to_s' now takes optional argument to
  specify radix. [new]

* bignum.c (rb_big_to_s): ditto. [new]


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 0c21de7 commit 8d4fda47e4867c2c8583ff396e21223a164dfb46 matz committed Nov 19, 2001
Showing with 348 additions and 297 deletions.
  1. +45 −2 ChangeLog
  2. +4 −2 ToDo
  3. +9 −7 array.c
  4. +13 −7 bignum.c
  5. +2 −2 class.c
  6. +43 −94 eval.c
  7. +1 −1 ext/extmk.rb.in
  8. +49 −54 ext/pty/pty.c
  9. +2 −6 ext/pty/shl.rb
  10. +0 −25 ext/tk/lib/tk.rb
  11. +2 −2 ext/tk/lib/tkfont.rb
  12. +3 −3 file.c
  13. +88 −43 gc.c
  14. +2 −2 hash.c
  15. +9 −8 intern.h
  16. +5 −0 io.c
  17. +1 −1 lib/pstore.rb
  18. +29 −3 marshal.c
  19. +18 −13 numeric.c
  20. +4 −3 pack.c
  21. +7 −7 process.c
  22. +1 −1 re.c
  23. +2 −2 signal.c
  24. +7 −7 string.c
  25. +2 −2 version.h
View
@@ -10,6 +10,25 @@ Sun Nov 18 19:37:55 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* parse.y (parse_regx): parse error at unterminated regex /#{.
(ruby-bugs-ja:PR#142)
+Sat Nov 17 12:37:39 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * pack.c (pack_unpack): should give length to utf8_to_uv().
+
+ * pack.c (utf8_to_uv): add length check.
+
+Sat Nov 17 01:41:52 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * massages: replace "wrong #" by "wrong number".
+
+ * marshal.c (w_float): output Infinity and NaN explicitly.
+
+ * marshal.c (r_object): support new explicit float format.
+
+ * eval.c (rb_thread_wait_for): select may cause ERESTART on
+ Solaris.
+
+ * eval.c (rb_thread_select): ditto.
+
Thu Nov 15 15:29:39 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* array.c (rb_ary_join): non-nil separator must be converted to
@@ -22,12 +41,36 @@ Thu Nov 15 03:37:17 2001 Usaku Nakamura <usa@ruby-lang.org>
* win32/win32.c, win32/win32.h: sort out #if 0 - #endif or others.
+Thu Nov 15 00:07:12 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * array.c (rb_ary_to_s): if rb_output_fs is nil, insert newlines
+ between array elements (use rb_default_rs as newline litral)
+ [experimental].
+
+Wed Nov 14 15:16:23 2001 K.Kosako <kosako@sofnec.co.jp>
+
+ * gc.c (init_mark_stack): no need to clear mark_stack.
+
+ * gc.c (gc_mark_all): need to handle finalizer mark.
+
+ * gc.c (gc_mark_rest): use MEMCPY instead of memcpy.
+
+ * gc.c (rb_gc_mark): earlier const check to avoid pusing special
+ constants into mark stack.
+
Wed Nov 14 01:12:07 2001 Usaku Nakamura <usa@ruby-lang.org>
* win32/win32.c (waitpid): fix wait count.
* win32/win32.c (poll_child_status): rename from wait_child().
+Wed Nov 14 01:33:49 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * numeric.c (fix_to_s): 'to_s' now takes optional argument to
+ specify radix. [new]
+
+ * bignum.c (rb_big_to_s): ditto. [new]
+
Tue Nov 13 19:50:30 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in: do not override CC if set.
@@ -263,7 +306,7 @@ Tue Oct 30 18:21:51 2001 Usaku Nakamura <usa@ruby-lang.org>
Tue Oct 30 14:04:04 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
- * string.c (rb_str_chomp_bang): do smart chomp if $/ == '\n'.
+ * string.c (rb_str_chomp_bang): do smart chomp if $/ == '\n'. [new]
* io.c (rb_io_puts): don't treat Array specially.
@@ -273,7 +316,7 @@ Tue Oct 30 14:04:04 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
Mon Oct 29 16:08:30 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
- * regex.c (re_compile_pattern): should preverve p0 value.
+ * regex.c (re_compile_pattern): should preserve p0 value.
Mon Oct 29 14:56:44 2001 Usaku Nakamura <usa@ruby-lang.org>
View
6 ToDo
@@ -31,7 +31,7 @@ Language Spec.
* method combination, e.g. before, after, around, etc.
* .. or something like defadvice in Emacs.
* property - for methods, or for objects in general.
-* in modifier, to annotate, or to encourage assertion.
+* "in" modifier, to annotate, or to encourage assertion.
* selector namespace - something like generic-flet in CLOS, to help RubyBehevior
Hacking Interpreter
@@ -70,6 +70,7 @@ Standard Libraries
- Enumerable#sort_by for Schwartzian transformation
- fork_and_kill_other_threads.
- signal list (Signal::trap, Signal::list).
+- move NameError under StandardError.
* String#scanf(?)
* Object#fmt(?)
* Integer#{bin,oct,hex,heX}
@@ -88,12 +89,13 @@ Standard Libraries
* Hash::new{default} or recommend Hash#fetch?
* new user-defined marshal scheme. _dump(dumper), _load(restorer)
* hash etc. should handle self referenceing array/hash
-* move NameError under StandardError.
* library to load per-user profile seeking .ruby_profile or ruby.ini file.
* warning framework (warn, warning for Ruby level)
* marshal should not depend on sprintf/strtod (works bad for locale).
* ternary arg pow: a.pow(b,c) == a**b%c
* new caller(), e.g. call_stack; needs better name.
+* remove dependency on MAXPATHLEN.
+* pointer share mechanism similar to one in String for Array.
Extension Libraries
View
16 array.c
@@ -305,7 +305,7 @@ rb_ary_push_m(argc, argv, ary)
VALUE ary;
{
if (argc == 0) {
- rb_raise(rb_eArgError, "wrong # of arguments(at least 1)");
+ rb_raise(rb_eArgError, "wrong number arguments(at least 1)");
}
if (argc > 0) {
while (argc--) {
@@ -380,7 +380,7 @@ rb_ary_unshift_m(argc, argv, ary)
VALUE ary;
{
if (argc == 0) {
- rb_raise(rb_eArgError, "wrong # of arguments(at least 1)");
+ rb_raise(rb_eArgError, "wrong number of arguments(at least 1)");
}
if (argc > 0) {
long len = RARRAY(ary)->len;
@@ -652,7 +652,7 @@ rb_ary_aset(argc, argv, ary)
return argv[2];
}
if (argc != 2) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments(%d for 2)", argc);
}
if (FIXNUM_P(argv[0])) {
offset = FIX2LONG(argv[0]);
@@ -682,7 +682,7 @@ rb_ary_insert(argc, argv, ary)
long pos;
if (argc < 2) {
- rb_raise(rb_eArgError, "wrong # of arguments(at least 2)");
+ rb_raise(rb_eArgError, "wrong number of arguments(at least 2)");
}
pos = NUM2LONG(argv[0]);
if (pos == -1) {
@@ -774,6 +774,7 @@ rb_ary_dup(ary)
}
extern VALUE rb_output_fs;
+extern VALUE rb_default_rs;
static VALUE
inspect_join(ary, arg)
@@ -856,11 +857,12 @@ VALUE
rb_ary_to_s(ary)
VALUE ary;
{
- VALUE str;
+ VALUE str, sep;
if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
- str = rb_ary_join(ary, rb_output_fs);
- if (NIL_P(str)) return rb_str_new(0, 0);
+ if (!NIL_P(rb_output_fs)) sep = rb_output_fs;
+ else sep = rb_default_rs;
+ str = rb_ary_join(ary, sep);
return str;
}
View
@@ -10,9 +10,9 @@
**********************************************************************/
-#include "ruby.h"
#include <math.h>
#include <ctype.h>
+#include "ruby.h"
VALUE rb_cBignum;
@@ -397,9 +397,7 @@ rb_big2str(x, base)
hbase = 020;
}
else {
- j = 0;
- hbase = 0;
- rb_raise(rb_eArgError, "Bignum cannot treat base %d", base);
+ rb_raise(rb_eArgError, "illegal radix %d", base);
}
t = rb_big_clone(x);
@@ -435,10 +433,18 @@ rb_big2str(x, base)
}
static VALUE
-rb_big_to_s(x)
+rb_big_to_s(argc, argv, x)
+ int argc;
+ VALUE *argv;
VALUE x;
{
- return rb_big2str(x, 10);
+ VALUE b;
+ int base;
+
+ rb_scan_args(argc, argv, "01", &b);
+ if (argc == 0) base = 10;
+ else base = NUM2INT(b);
+ return rb_big2str(x, base);
}
static unsigned long
@@ -1442,7 +1448,7 @@ Init_Bignum()
{
rb_cBignum = rb_define_class("Bignum", rb_cInteger);
- rb_define_method(rb_cBignum, "to_s", rb_big_to_s, 0);
+ rb_define_method(rb_cBignum, "to_s", rb_big_to_s, -1);
rb_define_method(rb_cBignum, "coerce", rb_big_coerce, 1);
rb_define_method(rb_cBignum, "-@", rb_big_uminus, 0);
rb_define_method(rb_cBignum, "+", rb_big_plus, 1);
View
@@ -734,7 +734,7 @@ rb_scan_args(argc, argv, fmt, va_alist)
if (ISDIGIT(*p)) {
n = *p - '0';
if (n > argc)
- rb_raise(rb_eArgError, "wrong # of arguments (%d for %d)", argc, n);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n);
for (i=0; i<n; i++) {
var = va_arg(vargs, VALUE*);
if (var) *var = argv[i];
@@ -789,7 +789,7 @@ rb_scan_args(argc, argv, fmt, va_alist)
}
if (argc > i) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for %d)", argc, i);
+ rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)", argc, i);
}
return argc;
Oops, something went wrong.

0 comments on commit 8d4fda4

Please sign in to comment.