summaryrefslogtreecommitdiff
path: root/object.c
AgeCommit message (Collapse)Author
2003-02-10* array.c (rb_ary_to_a): return value should be an Array if thematz
receiver is an instance of subclass of Array. * string.c (rb_str_to_s): return value should be a String if the receiver is an instance of subclass of String. * eval.c (rb_call): calls method_missing when superclass method does not exist. * eval.c (rb_f_missing): now handles "no super" case. * object.c (rb_obj_ivar_get): Object#instance_variable_get: new method to get instance variable value without eval(). [new] * object.c (rb_obj_ivar_set): Object#instance_variable_set: new method to set instance variable value without eval(). [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-03* object.c (Init_Object): default Object#=== now calls "=="matz
internally. * re.c (rb_reg_initialize_m): should honor option status of original regexp. * array.c (rb_ary_equal): ary2 should be T_ARRAY (no to_ary conversion). * array.c (rb_ary_eql): ditto. * string.c (rb_str_equal): str2 should be T_STRING (no to_str conversion). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-31* variable.c (rb_obj_classname): new function.matz
* string.c (rb_str_dup): should preserve original's class (but not hidden singleton class). * string.c (rb_str_substr): ditto. * parse.y: backout EXPR_CMDARG removal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-16Updated Copyrights of Matz to 2003.michal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-21* array.c (ary_alloc), dir.c (dir_s_alloc), eval.c (thgroup_s_alloc),usa
file.c (rb_stat_s_alloc), hash.c (hash_alloc), io.c (io_alloc), object.c (rb_module_s_alloc, rb_class_allocate_instance), re.c (match_alloc, rb_reg_s_alloc), string.c (str_alloc), time.c (time_s_alloc), ext/digest/digest.c (rb_digest_base_alloc), ext/tcltklib/tcltklib.c (ip_alloc), ext/win32ole/win32ole.c (fole_s_allocate, fev_s_allocate) : add prototype to get rid of VC++ warnings. * ext/sdbm/init.c (fsdbm_alloc): allocator takes only one argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-20* object.c (Init_Object): should not remove Class#allocate.matz
* lib/profiler.rb: separate profiling functions, without trace_func and at_exit setting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-20* parse.y (do_block): split "do" block and tLBRACE_ARG block.matz
* parse.y (cmd_brace_block): new tLBRACE_ARG block rule * parse.y (command): can take optional cmd_brace_block; use %prec to resolve shift/reduce conflict. (ruby-bugs-ja PR#372) * eval.c (ruby_finalize): trace_func should be cleared here (after executing exit procs and finalizers). * eval.c (rb_define_alloc_func): new allocation framework, based on Nobu's work [ruby-dev:19116]. "allocate" method is no longer used for object allocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-19* numeric.c (num_step): use DBL_EPSILON.matz
* array.c (rb_check_array_type): new function: return an array (convert if possible), or nil. * string.c (rb_check_string_type): new function: return a string (convert if possible), or nil. * numeric.c (rb_dbl_cmp): returns nil if values are not comparable. * numeric.c (fix_cmp,flo_cmp): use rb_num_coerce_cmp() * bignum.c (rb_big_cmp): ditto. * numeric.c (rb_num_coerce_cmp): new coercing function for "<=>", which does not raise TypeError. * numeric.c (do_coerce): can be supress exception now. * object.c (rb_mod_cmp): should return nil for non class/module objects. * re.c (rb_reg_eqq): return false if the argument is not a string. now returns boolean value. * class.c (rb_include_module): argument should be T_MODULE, not T_class, nor T_ICLASS. * eval.c (is_defined): "defined?" should return "assignment" for attribute assignment (e.g. a.foo=b) and indexed assignment (e.g. a[2] = 44). * parse.y (aryset): use NODE_ATTRASGN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-10* sprintf.c (rb_f_sprintf): preceding ".." for negative numbersmatz
still left; removed. * sprintf.c (rb_f_sprintf): should not prepend '0' if width > prec for example "%5.3d". * process.c (Init_process): add Process.exit and Process.abort * pack.c (utf8_to_uv): raise ArgumentError for malformed/redundant UTF-8 sequences. * process.c (last_status_set): add pid attribute to Process::Status. * pack.c (uv_to_utf8): limit maximum length of the encoded string to 6 bytes, even when the platform supports 8 bytes long integers. * pack.c (utf8_to_uv): do not decode sequences longer than 6 bytes. * object.c (copy_object): use "copy_object" method, not "become". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-04* object.c (copy_object): copy finalizers as well if any.matz
* gc.c (rb_gc_copy_finalizer): new function to copy finalizers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-11-03* object.c (Init_Object): added Object#object_id, new name formatz
Object#id. [new] * object.c (rb_obj_id_obsolete): give warning for Object#id. * numeric.c (fix_intern): added Fixnum#to_sym. [new] * object.c (sym_to_sym): rename from Symbol#intern * enum.c (enum_zip): added Enumerable#zip. [new] * array.c (rb_ary_zip): added Array#zip. * error.c (init_syserr): remove sys_nerr dependency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-30* eval.c (rb_mod_public_method_defined, etc.): new methods:matz
public_method_defined?, private_method_defined?, protected_method_defined? * object.c (rb_obj_public_methods): new method Object#public_methods. * class.c (ins_methods_i): Object#methods should list both public and protected methods. * class.c (rb_class_public_instance_methods): new method Module#public_instance_methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-29* eval.c, file.c, gc.c, io.c, object.c, ruby.c, ruby.h, struct.c,knu
ext/socket/socket.c: differentiate long and int; use proper printf type specifiers and do casts where appropriate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-23* eval.c (rb_eval): added NODE_DSYM, symbol literal withnobu
interpolation. * node.h: ditto. * intern.h: prototypes; rb_is_junk_id, rb_str_dump, rb_str_intern * object.c (sym_inspect): escape and quote for non-alphanumeric symbols. * parse.y (dsym, tokadd_string, yylex): extended symbol literals. * parse.y (rb_is_junk_id): added. * string.c (rb_str_dump, rb_str_intern) : make extern. * lib/mkmf.rb (create_makefile): deffile should be removed by distclean, not clean. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-17* object.c (rb_str_to_dbl): RString ptr might be NULL.matz
* object.c (rb_cstr_to_dbl): p pointer might be NULL. * bignum.c (rb_str_to_inum): RString ptr might be NULL. * bignum.c (rb_cstr_to_inum): str pointer might be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-04* bignum.c (rb_big_rshift): num should be initialized by carrymatz
bits if x is negative. * bignum.c (bigdivmod): len for bignum zero is 1, not 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-02* commit miss; and tcltklib fix too.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-04* class.c (rb_make_metaclass): obj.meta.super.meta should be equalmatz
to obj.meta.meta.super (ruby-bugs-ja:PR#324). * parse.y (yylex): the warning message "invalid character syntax" was never issued. * marshal.c (r_bytes): do not use alloca (ruby-bugs:PR#382). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-03 * variable.c (rb_copy_generic_ivar): remove old generic instancematz
variable table if it existes. * class.c (rb_make_metaclass): metaclass of a metaclass is a metaclass itself. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-27* file.c (rb_find_file): $LOAD_PATH must not be empty.matz
* file.c (rb_find_file_ext): ditto. * range.c (range_eq): class check should be based on range.class, instead of Range to work with Range.dup. * range.c (range_eql): ditto. * class.c (rb_mod_dup): need to preserve metaclass and flags. * object.c (rb_cstr_to_dbl): had a buffer overrun. * marshal.c (w_class): integrate singleton check into a funciton to follow DRY principle. * marshal.c (w_uclass): should check singleton method. * object.c (rb_obj_dup): dmark and dfree functions must be match for T_DATA type. * object.c (rb_obj_dup): class of the duped object must be match to the class of the original. * re.c (rb_reg_quote): do not escape \t, \f, \r, \n, for they are not regular expression metacharacters. * time.c (time_s_alloc): use time_free instead of free (null check, also serves for type mark). * time.c (time_s_at): check dfree function too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21*.c: Int vs Long cleanupmichal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-19* array.c (sort_2): *a - *b may overflow.matz
* array.c (ary_new): len*sizeof(VALUE) may be a positive value. * array.c (rb_ary_initialize): ditto. * object.c (rb_class_allocate_instance): move singleton class check from rb_obj_alloc(). * re.c (rb_reg_initialize): should not modify frozen Regexp. * ext/tcltklib/tcltklib.c (ip_init): allocation framework. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-12* bignum.c (rb_big_cmp): use dbl2big() for Floats, instead ofmatz
big2dbl(). * bignum.c (Init_Bignum): rb_big_zero_p() removed. There may be Bignum zero. * eval.c (rb_call0): new argument added for original method name. preserve original method name in frame->orig_func. * eval.c (is_defined): use frame->orig_func, not last_func. * eval.c (rb_eval): ditto. * eval.c (method_call): supply data->oid also to rb_call0(). * object.c (rb_class_allocate_instance): call rb_obj_alloc() when called from alias, thus invoke original "allocate". * eval.c (remove_method): removing allocate from classes should cause NameError. * hash.c (rb_hash_equal): should check default values. * ext/socket/socket.c (s_recvfrom): update RSTRING len. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-07-02object.c: rb_Integer reformat, nil#to_f added to rb_define_method.michal
parse.y: Clean unused vars. range.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-28* re.c (rb_reg_expr_str): need to process backslashes properly.matz
* object.c (rb_any_to_a): declare Object#to_a to be obsolete. * object.c (rb_Array): do not convert nil into [] automagically. * object.c (rb_Integer): use "to_int" instead of "to_i". [experimental] * object.c (nil_to_f): new method. * object.c (rb_Integer): Symbols and nil should cause error. * object.c (rb_Float): nil should cause error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-21* object.c (Init_Object): should do exact match for Module#==.matz
* compar.c (cmp_eq): returns 'false' if <=> returns 'nil'. * compar.c (cmp_gt,cmp_ge,cmp_lt,cmp_le,cmp_between): ditto. * pack.c (pack_pack): should propagate taintedness. * pack.c (pack_unpack): ditto. * eval.c (rb_thread_schedule): need to preserve errno before calling rb_trap_exec(). * regex.c (calculate_must_string): a bug in charset/charset_not parsing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-14* eval.c (rb_clear_cache_by_class): new function.matz
* eval.c (set_method_visibility): should have clear cache forq updated visibility. * numeric.c (flo_to_s): default format precision to be "%.16g". * util.c (ruby_strtod): use own strtod(3) implementation to avoid locale hell. Due to this change "0xff".to_f no longer returns 255.0 * eval.c (avalue_to_yvalue): new function to distinguish yvalue (no-arg == Qundef) from svalue (no-arg == Qnil). * eval.c (rb_yield_0): use avalue_to_yvalue(). * eval.c (assign): warn if val == Qundef where it means rhs is void (e.g. yield without value or call without argument). * parse.y (value_expr): need not to warn for WHILE and UNTIL, since they can have return value (via valued break). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-24* io.c (rb_io_mode_flags): both 'r+b' and 'rb+' should be allowed.matz
* io.c (rb_io_mode_modenum): ditto. * gc.c (rb_memerror): rename from mem_error, and exported. * gc.c (Init_GC): pre-allocate NoMemoryError instance. * object.c (convert_type): error message changed from "failed to convert" to "cannot convert", since it does not try to convert if an object does not respond to the converting method. * eval.c (block_pass): convert Method to Proc using rb_check_convert_type(). * object.c (rb_check_convert_type): always convert T_DATA * eval.c (rb_thread_cleanup): should not terminate main_thread by Fatal error. * regex.c (is_in_list): need to not exclude NUL and NEWLINE. * re.c (rb_reg_expr_str): wrong backslash escapement. * re.c (rb_reg_expr_str): do not escape embedded space characters. * marshal.c (w_object): T_DATA process patch from Joel VanderWerf <vjoel@PATH.Berkeley.EDU>. This is temporary hack; it remains undocumented, and it will be removed when marshaling is re-designed. * marshal.c (r_object): ditto. * numeric.c (num_step): Integer#step is moved to Numeric#step; Fixnum#step is merged into this method. * numeric.c (int_dotimes): Fixnum#times is merged. * numeric.c (int_upto): Fixnum#upto is merged. * numeric.c (int_downto): Fixnum#downto is merged. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-11* eval.c (assign): ruby_verbose should be surrounded by RTEST().matz
* object.c (rb_str2cstr): ditto. * parse.y (void_expr): ditto. * parse.y (void_stmts): ditto. * variable.c (rb_ivar_get): ditto. * variable.c (rb_cvar_set): ditto. * variable.c (rb_cvar_get): ditto. * dir.c (glob_helper): should have proceed link when link->path was non existing symbolic link. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-08* eval.c (cvar_cbase): utility function to find innermost nonmatz
singleton cbase. * eval.c (is_defined): adopt new cvar behavior. * eval.c (rb_eval): ditto. * eval.c (assign): ditto. * class.c (rb_mod_clone): should not call rb_obj_clone(), since Module does not provide "allocate". * class.c (rb_singleton_class): should crate new singleton class if obj is a class or module and attached object is different, which means metaclass of singleton class is sought. * time.c (time_s_alloc): now follows allocation framework. * eval.c (rb_eval): should initialize outer class variables from methods in singleton class definitions. * eval.c (assign): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-25* eval.c (method_inspect): should not dump core for unboundmatz
singleton methods. * object.c (rb_mod_to_s): better description. * hash.c (env_select): should path the assoc list. * process.c (rb_syswait): thread kludge; should be fixed to support native thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-04* object.c (rb_class_real): should not follow ICLASS linkmatz
* variable.c (classname): should follow ICLASS link explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-01* intern.h: prototypes for new functions; rb_cstr_to_inum(),nobu
rb_str_to_inum(), rb_cstr_to_dbl(), rb_str_to_dbl() * bignum.c (rb_cstr_to_inum): changed from rb_cstr2inum(), and added argument badcheck to be consistent with parser. [new] * bignum.c (rb_str_to_inum): ditto. * bignum.c (rb_cstr2inum): wapper of rb_cstr_to_inum() now. * bignum.c (rb_str2inum): ditto. * object.c (rb_cstr_to_dbl): float number parser. [new] * object.c (rb_str_to_dbl): ditto. * object.c (rb_Float): use rb_cstr_to_dbl() for strict check. * object.c (rb_Integer): use rb_str_to_inum() for strict check. * string.c (rb_str_to_f): use rb_str_to_dbl() with less check. * string.c (rb_str_to_i): use rb_str_to_inum() with less check. * string.c (rb_str_hex): ditto. * string.c (rb_str_oct): ditto. * sprintf.c (rb_f_sprintf): ditto. * time.c (obj2long): ditto. * parse.y (yylex): use rb_cstr_to_inum() for strict check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-01* file.c (rb_stat_inspect): print dev, rdev in hexadecimal.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-28* eval.c (is_defined): defined?(Foo::Baz) should check constantsmatz
only, no methods. * eval.c (is_defined): should not dump core on defined?(a::b) where a is not a class nor a module. * object.c (Init_Object): remove dup and clone from TrueClass, FalseClass, and NilClass. * array.c (rb_ary_fill): Array#fill takes block to get the value to fill. * string.c (rb_str_to_i): to_i(0) auto-detects base radix. * array.c (rb_ary_initialize): fill by the block evaluation value if block is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-23* array.c (Init_Array): remove Array#filter.matz
* object.c (rb_mod_initialize): should accept zero argument. * object.c (rb_mod_cmp): should raise ArgumentError if inheritance/inclusion relation between two classes/modules is not defined. [new] * io.c (rb_io_fsync): new method. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-16* object.c (rb_Float): remove underscores between digits.nobu
* bignum.c (rb_cstr2inum): reject prefix followed by spaces only. * class.c (rb_class_inherited): should use Object when no super class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-11* re.c (match_select): should propagate taintness.matz
* hash.c (rb_hash_set_default): Hash#default= should return the new value. * string.c (rb_str_to_i): accepts optional base argument. [new] * numeric.c (rb_fix2str): should not handle negative fixnum values int32 via calling sprintf() directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-10* class.c (rb_make_metaclass): [new]nobu
* class.c (rb_define_class_id): use rb_make_metaclass(), don't call Class#inherited hook. * class.c (rb_class_inherited): [new] * class.c (rb_define_class): call Class#inherited hook here. * class.c (rb_define_class_under): ditto after class path is set. * class.c (rb_singleton_class): use rb_make_metaclass(). * eval.c (rb_eval): same as rb_define_class_under(). * intern.h: prototypes of rb_make_metaclass() and rb_class_inherited(). * object.c (rb_class_s_new): use rb_make_metaclass() and rb_class_inherited(). * object.c (Init_Object): use rb_make_metaclass(). * struct.c (make_struct): use rb_class_inherited(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-04* process.c (rb_f_system): abandon vfork.matz
* io.c (pipe_open): ditto. * defines.h: sparc linux needs different FLUSH_REGISTER_WINDOWS * regex.c (re_search): abandon stclass optimization. * bignum.c (rb_cstr2inum): deny "0_". * bignum.c (rb_cstr2inum): allow "0\n" and so on. * error.c (rb_invalid_str): utility function to show inspect()'ed string. * bignum.c (rb_cstr2inum): prints invalid strings in inspect()'ed format. * object.c (rb_Float): ditto. * object.c (rb_convert_type): no longer use rb_rescue(). * re.c (rb_reg_search): initialize taint status of match object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-10* object.c (rb_class_real): follow included modules.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-10* array.c (rb_ary_modify): should copy the internal buffer if thematz
modifying buffer is shared. * array.c (ary_make_shared): make an internal buffer of an array to be shared. * array.c (rb_ary_shift): avoid sliding an internal buffer by using shared buffer. * array.c (rb_ary_subseq): avoid copying the buffer. * parse.y (gettable): should freeze __LINE__ string. * io.c (rb_io_puts): old behavoir restored. rationale: a) if you want to call to_s for arrays, you can just call print a, "\n". b) to_s wastes memory if array (and sum of its contents) is huge. c) now any object that has to_ary is treated as an array, using rb_check_convert_type(). * hash.c (rb_hash_initialize): now accepts a block to calculate the default value. [new] * hash.c (rb_hash_aref): call "default" method to get the value corrensponding to the non existing key. * hash.c (rb_hash_default): get the default value based on the block given to 'new'. Now it takes an optinal "key" argument. "default" became the method to get the value for non existing key. Users may override "default" method to change the hash behavior. * hash.c (rb_hash_set_default): clear the flag if a block is given to 'new' * object.c (Init_Object): undef Data.allocate, left Data.new. * ext/curses/curses.c (window_scrollok): use RTEST(). * ext/curses/curses.c (window_idlok): ditto. * ext/curses/curses.c (window_keypad): ditto. * ext/curses/curses.c (window_idlok): idlok() may return void on some platforms; so don't use return value. * ext/curses/curses.c (window_scrollok): ditto for consistency. * ext/curses/curses.c: replace FIX2INT() by typechecking NUM2INT(). * parse.y (str_extend): should not process immature #$x and #@x interpolation, e.g #@#@ etc. * enum.c (enum_sort_by): sort_by does not have to be stable always. * enum.c (enum_sort_by): call qsort directly to gain performance. * util.c (ruby_qsort): ruby_qsort(qs6) is now native thread safe. * error.c (rb_sys_fail): it must be a bug if it's called when errno == 0. * regex.c (WC2MBC1ST): should not pass through > 0x80 number in UTF-8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-11-29* string.c (rb_str_equal): object with to_str must be treated as amatz
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-16* string.c (rb_str_index): wrong increment for non alphanumericmatz
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-10* file.c (rb_stat_clone): should copy internal data too.matz
* numeric.c (num_clone): Numeric should not be copied by clone. * object.c (rb_obj_clone): should check immediate values. * parse.y (command): `yield' should take command_args. * parse.y (parse_quotedwords): %w(...) is not a string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-03* marshal.c (r_object): better allocation type check formatz
TYPE_UCLASS. usage of allocation framework is disabled for now. * variable.c (rb_class_path): Module may have subclass. * string.c (rb_str_update): should maintain original negative offset. * string.c (rb_str_subpat_set): ditto * string.c (rb_str_aset): ditto. * re.c (rb_reg_nth_match): should check negative nth. * re.c (rb_reg_nth_defined): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-10-02* ext/socket/socket.c (unix_addr): getsockname(2) may result len = 0.matz
* ext/socket/socket.c (unix_peeraddr): getpeername(2) may result len = 0. * string.c (rb_str_subpat_set): support function for new argument pattern String#[re,offset] = val. [new] * eval.c (POP_BLOCK): rb_gc_force_recycle() was called too much. Should not be called if SCOPE_DONT_RECYCLE is set. * string.c (rb_str_aref_m): new argument pattern String#[re,offset]. [new] * string.c (rb_str_substr): should return an instance of receiver's class. * string.c (rb_str_succ): ditto. * array.c (rb_ary_subseq): ditto. * array.c (rb_ary_initialize): Array.new([1,2,3]) => [1,2,3]. [new] * string.c (rb_str_reverse): should return an instance of receiver's class. * string.c (rb_str_times): ditto. * array.c (rb_ary_times): ditto * string.c (str_gsub): ditto. * string.c (rb_str_ljust): ditto. * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. * eval.c (eval): retrieves file, line information from binding. * eval.c (intersect_fds): counts intersecting fds. * eval.c (rb_thread_schedule): only fds requested by each thread count as select_value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-08-20* range.c (range_step): 'iter' here should be an array.matz
* marshal.c (w_object): should retrieve __member__ data from non-singleton class. * variable.c (rb_cvar_get): class variable override check added. * variable.c (rb_cvar_set): ditto * variable.c (rb_cvar_declare): ditto. * parse.y (parse_regx): handle backslash escaping of delimiter here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-24* eval.c (rb_provide_feature): should not tweak extension used formatz
loading. * io.c (io_fread): use fread(3) if PENDING_COUND is available. * class.c (rb_mod_include_p): Module#include? added. [new] * re.c (ignorecase_setter): give warning on modifying $=. * string.c (rb_str_casecmp): new method. [new] * string.c (rb_str_eql): separated from rb_str_equal(), make it always be case sensitive. [new] * string.c (rb_str_hash): made it always be case sensitive. * eval.c (rb_f_require): should not include path in $" value * file.c (rb_find_file): should return 0 explicitly on failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-07-18* regex.c (NUM_FAILURE_ITEMS): was confusing NUM_REG_ITEMS andmatz
NUM_NONREG_ITEMS, which have happened to be same value. * class.c (rb_class_new): subclass check moved to this function. * class.c (rb_class_boot): check less version of rb_class_new(). * eval.c (proc_invoke): should preserve iter status for embedded frame in the block. * file.c (rb_file_s_expand_path): may overrun buffer on stack. * string.c (rb_str_insert): forgot to call rb_str_modify(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e