Skip to content

Commit

Permalink
* eval.c (load_dyna): clear ruby_errinfo. (ruby-bugs-ja PR#409)
Browse files Browse the repository at this point in the history
* io.c (read_all): make str empty if given. (ruby-bugs-ja PR#408)

* io.c (io_read): ditto.

* io.c (rb_io_sysread): ditto.

* range.c: do not override min and max.

* sprintf.c (remove_sign_bits): octal left most digit for negative
  numbers may be '3'. (ruby-bugs-ja PR#407)

* sprintf.c (rb_f_sprintf): should prefix sign bits if bignum is
  negative, using sign_bits().

* eval.c (avalue_to_mrhs): split argument passing and assignment
  conversion.

* eval.c (svalue_to_mrhs): ditto.

* eval.c (avalue_to_svalue): avalue_to_svalue([[1,2]]) should be
  [[1,2]], not [1,2] to wrap-around.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Mar 20, 2003
1 parent 5782e5b commit 85dd7bb
Show file tree
Hide file tree
Showing 12 changed files with 685 additions and 516 deletions.
34 changes: 34 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,55 @@ Thu Mar 20 10:45:29 2003 Tanaka Akira <[email protected]>

* eval.c (bmcall): add volatile to avoid GC problem.

Thu Mar 20 10:10:49 2003 Yukihiro Matsumoto <[email protected]>

* eval.c (load_dyna): clear ruby_errinfo. (ruby-bugs-ja PR#409)

Wed Mar 19 23:05:30 2003 NAKAMURA, Hiroshi <[email protected]>

* lib/tracer.rb (trace_func): save and recover Thread.critical state.
Fixed by Fukumoto Atsushi <[email protected]> [ruby-dev:19830]

Wed Mar 19 02:55:46 2003 Yukihiro Matsumoto <[email protected]>

* io.c (read_all): make str empty if given. (ruby-bugs-ja PR#408)

* io.c (io_read): ditto.

* io.c (rb_io_sysread): ditto.

Tue Mar 18 18:24:03 2003 Yukihiro Matsumoto <[email protected]>

* range.c: do not override min and max.

Sun Mar 16 12:29:55 2003 Tanaka Akira <[email protected]>

* lib/pp.rb (object_address_group): use to_s instead of name
to get name of class.

Fri Mar 14 08:53:29 2003 Yukihiro Matsumoto <[email protected]>

* sprintf.c (remove_sign_bits): octal left most digit for negative
numbers may be '3'. (ruby-bugs-ja PR#407)

* sprintf.c (rb_f_sprintf): should prefix sign bits if bignum is
negative, using sign_bits().

Wed Mar 12 16:48:19 2003 WATANABE Hirofumi <[email protected]>

* io.c (prep_stdio): set binmode only if the file descriptor
is not connected to a terminal on Cygwin.

Wed Mar 12 11:23:49 2003 Yukihiro Matsumoto <[email protected]>

* eval.c (avalue_to_mrhs): split argument passing and assignment
conversion.

* eval.c (svalue_to_mrhs): ditto.

* eval.c (avalue_to_svalue): avalue_to_svalue([[1,2]]) should be
[[1,2]], not [1,2] to wrap-around.

Tue Mar 11 21:00:59 2003 Minero Aoki <[email protected]>

* lib/net/smtp.rb: Digest string wrongly included '\n' when user
Expand Down
30 changes: 29 additions & 1 deletion README.EXT
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The Ruby interpreter has the following data types:
T_HASH associative array
T_STRUCT (Ruby) structure
T_BIGNUM multi precision integer
T_FILE IO
T_TRUE true
T_FALSE false
T_DATA data
Expand Down Expand Up @@ -93,7 +94,9 @@ The T_FIXNUM data is a 31bit length fixed integer (63bit length on
some machines), which can be convert to a C integer by using the
FIX2INT() macro. There is also NUM2INT() which converts any Ruby
numbers into C integers. The NUM2INT() macro includes a type check, so
an exception will be raised if the conversion failed.
an exception will be raised if the conversion failed. There are also
a macro NUM2DBL() to retrieve the double float value and STR2CSTR() is
useful to get the string as char*.

Other data types have corresponding C structures, e.g. struct RArray
for T_ARRAY etc. The VALUE of the type which has corresponding structure
Expand Down Expand Up @@ -488,6 +491,8 @@ Init_dbm()
rb_define_method(cDBM, "[]", fdbm_fetch, 1);
:

/* ID for a instance variable to store DBM data */
id_dbm = rb_intern("dbm");
}
--

Expand Down Expand Up @@ -756,6 +761,25 @@ sval, and returns the DATA encapsulating the pointer to memory region.
This macro retrieves the pointer value from DATA, and assigns it to
the variable sval.

** Checking data types

TYPE(value)
FIXNUM_P(value)
NIL_P(value)
void Check_Type(VALUE value, int type)
void Check_SafeStr(VALUE value)

** Data type conversion

FIX2INT(value)
INT2FIX(i)
NUM2INT(value)
INT2NUM(i)
NUM2DBL(value)
rb_float_new(f)
STR2CSTR(value)
rb_str_new2(s)

** defining class/module

VALUE rb_define_class(const char *name, VALUE super)
Expand Down Expand Up @@ -944,6 +968,10 @@ Prints a warning message according to a printf-like format.
Prints a warning message according to a printf-like format, if
$VERBOSE is true.

void rb_raise(rb_eRuntimeError, const char *fmt, ...)

Raises RuntimeError. The fmt is a format string just like printf().

void rb_raise(VALUE exception, const char *fmt, ...)

Raises a class exception. The fmt is a format string just like printf().
Expand Down
Loading

0 comments on commit 85dd7bb

Please sign in to comment.