summaryrefslogtreecommitdiff
path: root/object.c
AgeCommit message (Collapse)Author
2010-04-01* object.c (rb_cstr_to_dbl): return 0.0 if hexadecimal andnaruse
baccheck is FALSE: Float("0x1p+0") works, but "0x1p+0".to_f doesn't. [ruby-dev:40650] * util.c (ruby_strtod): allow hexdecimal integers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-23enable Object#inspect doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-23* object.c (rb_obj_singleton_class): new methodshugo
Kernel#singleton_class. [ruby-core:21702] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-21* object.c (rb_obj_hash): use LONG2FIX to avoid Bignum allocation.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-08* object.c (rb_obj_clone): call initialize_clone hook method tomatz
call initialize_copy. * object.c (rb_obj_dup): call initialize_dup hook. * lib/delegate.rb (Delegator#initialize_clone): use new hook to implement deep copy. [ruby-dev:40242] * lib/delegate.rb (Delegator#initialize_dup): ditto. * test/test_delegate.rb (TestDelegateClass#test_copy_frozen): add a test to ensure #clone copies frozen status. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-13* object.c (rb_class_initialize): Make sure BasicObject doesn't get ↵marcandre
initialized twice [ruby-core:27577] * class.c (rb_class_init_copy): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-24* lib/object.c (rb_obj_cmp): Default <=> operator returns 0 if objects are ↵marcandre
== [ruby-core:24063] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-20* object.c: BasicObject#initialize accepts any number of arguments ↵marcandre
[ruby-core:27080] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-01* object.c (convert_type): Cleanup unused variablemarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-29* array.c (rb_ary_to_ary): do not use #respond_to? to detectmatz
to_ary. Just call. [ruby-core:23738] * eval.c (rb_check_funcall): new function with method existence check. returns Qundef when the method does not exist. * enumerator.c (enumerator_rewind): just call method, using rb_check_funcall(). [ruby-core:23738] * error.c (exc_equal): ditto. * object.c (convert_type): ditto. * error.c (rb_name_err_mesg_new): export function. * eval.c (make_exception): ditto. * io.c (pop_last_hash): return early when the last argument is nil. * io.c (rb_io_puts): treat T_STRING specially for small optimization. * vm_eval.c (raise_method_missing): skip method call if possible using rb_method_basic_definition_p(). * vm_eval.c (method_missing): ditto. * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_debug): test suites changed to ignore exceptions caused by just-call policy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-24* object.c (rb_obj_cmp): defines Object#<=>. [ruby-core:24063]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-21* object.c (rb_obj_inspect): print instance variables only whenmatz
Object#to_s is not overridden. [ruby-core:24425] * class.c (rb_obj_basic_to_s_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-21* object.c (rb_obj_inspect): fixed rdoc about the case that to_snobu
is called. [ruby-core:24425] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-13* object.c (rb_mod_const_defined): rdoc fixmarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-03* object.c (rb_f_integer): now Integer() takes optional basematz
argument. base will be ignored for non string values. suggested by Sam Carr at RubyFoo Lounge at London. * test/ruby/test_integer.rb (TestInteger#test_Integer): test updated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08* include/ruby/st.h (st_hash_func): use st_index_t.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-31* class.c: refactored singleton class related matters.yugui
Handles eigenclasses and plain classes transparently. (make_metaclass): renamed from make_metametaclass. (METACLASS_OF): new utility macro (META_CLASS_OF_CLASS_CLASS): ditto. (ENSURE_EIGENCLASS): ditto. (make_singleton_class): extracted from rb_singleton_class. (boot_defclass): moved from object.c (Init_class_hierarchy): extracted from Init_Object. (rb_make_metaclass): refactored. (singleton_class_of): extracted from rb_singleton_class. (rb_singleton_class): refactored. (rb_define_singleton_method): it needs a metaclass only but not its metametaclass. * object.c: booting class hierarchy was moved to class.c for keeping dependency between compilation units least. (Init_Object): extracting the booting into Init_class_hierarchy. (boot_defclass): moved to class.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-26* random.c (random_rand): unified random_int and random_float.nobu
[ruby-dev:39158]. and fixes [ruby-core:24655], [ruby-core:24677], [ruby-core:24679]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18* suppressed shorten-64-to-32 warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-12* object.c (rb_to_integer, rb_check_to_integer): return Bignumnobu
as-is. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01* hash.c (rb_hash_hash): documentation fix. a patch frommatz
Marc-Andre Lafortune. [ruby-core:23943] * object.c (rb_mod_cmp): ditto. * range.c (range_eq): ditto. * string.c (rb_str_partition, rb_str_rpartition): ditto. * struct.c (rb_struct_s_def): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-29Doxy-commentyugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-29Doxy-comments.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-29* object.c: updated the diagram of metaclass hierarchy in rdoc.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-24update rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14* string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),mame
include/ruby/intern.h: add Murmurhash API. [ruby-dev:37784] * complex.c (nucomp_hash), array.c (rb_ary_hash), time.c (time_hash), string.c (rb_str_hsah), object.c (rb_obj_hash), range.c (range_hash), struct.c (rb_struct_hash), hash.c (rb_any_hash), rational.c (nurat_hash): use Murmurhash. [ruby-dev:37784] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-31* include/ruby/ruby.h (STR2CSTR): removed.akr
(rb_str2cstr): removed. * object.c (rb_str2cstr): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-13* object.c (rb_obj_not_match): rdoc.yugui
Patch by Kornelius Kalnbach. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-31* object.c (rb_to_float): replaced by to_flo definition frommatz
math.c [ruby-dev:37668] * math.c (Need_Float): use rb_to_float(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-30* object.c (rb_to_float): prohibit conversion from nil to float.matz
[ruby-dev:37663] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29* pack.c (pack_pack): template f should not accept non floatmatz
values. [ruby-dev:37656] * object.c (rb_to_float): new function to type check floats. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* common.mk: clean upko1
- remove blockinlining.$(OBJEXT) to built - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h) - make VM_CORE_H_INCLUDES variable (vm_core.h) - simplify rules. - make depends rule to output depend status using gcc -MM. * include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h. * include/ruby.h: ditto. * load.c: add inclusion explicitly. * enumerator.c, object.c, parse.y, thread.c, vm_dump.c: remove useless inclusion. * eval_intern.h: cleanup inclusion. * vm_core.h: rb_thread_t should be defined in this file. * vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c. * vm.h, vm_exec.h: rename vm.h to vm_exec.h. * insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h. * vm.c, vm_insnhelper.c, vm_insnhelper.h: - rename vm_eval() to vm_exec_core(). - rename vm_eval_body() to vm_exec(). - cleanup include order. * vm_method.c: fix comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-14* object.c (Init_Object): added metameta-class initialization foryugui
BasicObject, Object, and Module. The metameta-classes of them are now the metaclass of Class, as the metameta-calss of Class is. * object.c (boot_defmetametaclass): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz
a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-29* object.c (rb_obj_freeze): update rdoc to mention RuntimeErrormatz
(not TypeError any longer) would be raised. [ruby-dev:35982] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* object.c (convert_type): call less rb_intern() less frequentlymatz
by using cache structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16* include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* object.c (rb_obj_untrusted): new method Object#untrusted?.shugo
(rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-22* object.c (rb_class_superclass): rdoc improvement, a patch fromnobu
Gaston Ramos <ramos.gaston AT gmail.com> in [ruby-core:17371]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18* marshal.c (w_object, marshal_dump, r_object0, marshal_load): searchnobu
public methods only. [ruby-core:17283] * object.c (convert_type): ditto. * lib/singleton.rb (Singleton#_dump): conversion method should be public. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu
* *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-04* object.c (rb_obj_alloc): RDoc updated. a patch from Gastonmatz
Ramos <ramos.gaston at gmail.com> in [ruby-core:17073]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31* suppress warnings with -Wwrite-string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-28* marshal.c (w_object, marshal_dump, r_object0, marshal_load): searchnobu
private methods too. [ruby-dev:34671] * object.c (convert_type): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-26* util.c (ruby_strtod): clear errno at the top of our ownmatz
impelementation of strtod(3). [ruby-dev:34834] [ruby-dev:34839] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24* object.c (rb_cstr_to_dbl): should clear errno before callingmatz
strtod(3). [ruby-dev:34834] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-16* math.c (to_flo): rb_Float() accepts even strings for input.matz
* complex.c (nucomp_to_f): fix wrong message. * complex.c (nucomp_to_r): ditto. * object.c (rb_Float): do not check NaN for error. NaN is a part of valid float values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-15* object.c (rb_cstr_to_dbl): no need for forceful warning whenmatz
converting to float. overflow is a nature of float values. * parse.y (parser_yylex): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e