summaryrefslogtreecommitdiffstats
path: root/object.c
Commit message (Collapse)AuthorAgeFilesLines
* Add documentation for Module#includeddave2004-08-301-3/+28
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval): copy on write for argument local variablematz2004-07-271-0/+1
| | | | | | | | | | | | | | | assignment. * eval.c (assign): ditto. * eval.c (rb_call0): update ruby_frame->argv with the default value used for the optional arguments. * object.c (Init_Object): "===" calls rb_obj_equal() directly. [ruby-list:39937] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_mod_freeze): prepare string representation beforematz2004-06-161-0/+16
| | | | | | | freezing. [ruby-talk:103646] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_class_inherited_p): singleton class inherits Classnobu2004-06-161-0/+5
| | | | | | | rather than its object's class. [ruby-dev:23690] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * range.c (range_each_func): terminates loop if generating valuematz2004-05-141-3/+1
| | | | | | | | | | | | | | | | is same to @end. [ruby-talk:100269] * string.c (rb_str_new4): should not reuse frozen shared string if the original is not an instance of String. [ruby-talk:100193] * time.c (time_mdump): preserve GMT bit in the marshal data. [ruby-talk:100213] * eval.c (is_defined): do not protect exception during receiver evaluation. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (string_content): turn off NODE_NEWLINE flag to avoidmatz2004-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | unnecessary line trace for inlined expression. (ruby-bugs PR#1320) * numeric.c (flo_to_s): tweak output string based to preserve decimal point and to remove trailing zeros. [ruby-talk:97891] * string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM search. [ruby-talk:97342] * hash.c (rb_hash_equal): returns true if two hashes have same set of key-value set. [ruby-talk:97559] * hash.c (rb_hash_eql): returns true if two hashes are equal and have same default values. * string.c (rb_str_equal): always returns true or false, never returns nil. [ruby-dev:23404] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,nobu2004-04-141-2/+2
| | | | | | | process.c, re.c, string.c: typos in RDoc comments. [ruby-core:02783] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_cvar_get): new method Module#class_variable_get.matz2004-03-231-0/+59
| | | | | | | | | | * object.c (rb_mod_cvar_set): ditto (Module#class_variable_set). * eval.c (rb_thread_atfork): 1.9 warns no more for thread termination. [ruby-dev:23212] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c: remove specialized version of rb_Array(). use simplematz2004-03-181-28/+0
| | | | | | | | | | | one defined in object.c. * object.c (Init_Object): remove Kernel#to_a. * enum.c (enum_zip): use "to_a" instead of "to_ary". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (method_proc): return bound Proc object. [ruby-dev:22854]nobu2004-02-101-6/+6
| | | | | | | | | | | | * eval.c (rb_mod_define_method): bind method body itself for Method object. * node.h (NODE_DMETHOD): deprecated. * object.c (rb_class_inherited_p): export. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_clone, rb_obj_dup): mentioned aboutnobu2004-02-101-0/+8
| | | | | | | initialize_copy. [ruby-core:02339] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * pack.c (num2i32): pack should not raise RangeError.matz2004-01-221-6/+9
| | | | | | | | | [ruby-dev:22654] * pack.c (pack_pack): do not auto convert nil to zero. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_set_class_path): do not set path ifmatz2004-01-191-1/+1
| | | | | | | | * lib/cgi.rb (CGI::QueryExtension): give extended string, not a delegater object. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, error.c, file.c, io.c, numeric.c, object.c, re.c, struct.c,nobu2004-01-181-2/+3
| | | | | | | time.c: marked init_copy functions nodoc. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add explicit line breaks in method signatures for ri. Fixup some comments in ↵dave2004-01-121-1/+1
| | | | | | object.c. Support changes comments for "in xxx.c" git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: install rdoc by default. if you do not want tomatz2004-01-101-13/+7
| | | | | | | | | | | | | | | | | | | | install rdoc, specify --disable-install-doc. * eval.c (eval): need to add message delimiter. [ruby-dev:22561] * defines.h (__NeXT__): Ensure that all standard S_IRUSR, S_IWGRP, S_IRWXO, etc. macros are defined since future code might require them (even though present code only requires a subset). * defines.h (__NeXT__): Bug fix: WORDS_BIGENDIAN was not being set correctly on Rhapsody when -arch compiler flag was used (via configure's --enable-fat-binary option). * ext/socket/socket.c (make_hostent): getaddrinfo(3) on BSD do not fill ai_canonname if serv is not supplied. (ruby-bugs PR#1243) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, object.c, process.c, re.c: don't use C++ style comments.eban2004-01-081-19/+19
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Finish documenting internal stuff. See Changelog for other detailsdave2004-01-021-24/+31
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* RDoc Struct and randomdave2003-12-281-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add RDoc documentation for stuff in object.cdave2003-12-281-22/+826
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* RDoc comments for Symboldave2003-12-271-0/+131
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_mod_init_copy): always copy singleton class.nobu2003-12-221-0/+1
| | | | | | | [ruby-dev:22325] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_check_inheritable): new function. [ruby-dev:22316]nobu2003-12-211-0/+3
| | | | | | | | | | | * intern.h: add prototype. * eval.c (superclass): use rb_check_inheritable(). * object.c (rb_class_initialize): check argument validity. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add file.c comments (and necessary support in parse_c.rb)dave2003-12-211-0/+48
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Document Class and Dirdave2003-12-191-23/+102
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_exec_end_proc): should not clear end_procs andmatz2003-12-051-0/+1
| | | | | | | | | | | | ephemeral_end_procs before execution. [ruby-dev:22144] * eval.c (rb_obj_extend): call Module#extended hook after extended_object. [ruby-list:38866] * object.c (Init_Object): Module#extended defined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_class_s_alloc): add function prototype to avoid VC++eban2003-08-131-3/+3
| | | | | | | warning. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call0): update ruby_class as well as ruby_cref.matz2003-08-061-24/+31
| | | | | | | | | | | | (ruby-bugs-ja PR#540) * eval.c (rb_yield_0): remove ruby_frame->cbase and unify to ruby_cref. [ruby-talk:78141] * eval.c: initialize /* OK */ variables by Qnil to stop warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gcc -Wall clean-up.matz2003-07-241-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_mod_const_missing): new method. [ruby-core:00441]matz2003-07-221-0/+1
| | | | | | | | | | | | | | | | * variable.c (rb_const_get_at): allow "const_missing" hook. * variable.c (rb_const_get_0): ditto. * eval.c (method_missing): rename from rb_undefined to clarify. * eval.c (ruby_finalize_0): update exit status if any of END proc raises SystemExit. [ruby-core:01256] * eval.c (rb_exec_end_proc): reduce rb_protect(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (num_equal): should not use rb_equal().matz2003-07-211-1/+1
| | | | | | | * object.c (rb_equal): back out the last change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_equal): should return nil for non stringmatz2003-07-211-1/+1
| | | | | | | | | operand to conform comparable convention. [ruby-dev:20759] * object.c (rb_equal): preserve nil if "==" returns nil. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_load): put rb_load_file() in a thread criticalmatz2003-07-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | section. [ruby-dev:20490] * eval.c (compile): put rb_compile_string() in a thread critical section. * variable.c (rb_const_get_0): should not warn if constant is not defined. (ruby-bugs-ja PR#509) * bignum.c (rb_big2dbl): give a warning on overflow. (ruby-bugs-ja PR#510) * util.c (ruby_strtod): change MDMAXEXPT from 511 to 308. * pack.c (utf8_to_uv): long is sufficient. LONG_LONG is not required. * bignum.c (rb_big2str): support 32 bit (without `long long' type) machines. (ruby-bugs-ja PR#512) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_define_class, rb_define_module): also set constant undernobu2003-07-011-0/+1
| | | | | | | | | | | | | Object. [ruby-dev:20445] * object.c (boot_defclass): ditto. * variable.c (rb_const_get_at, rb_const_get_0, rb_mod_const_at, rb_const_defined, mod_av_set, rb_const_assign): toplevel constants are now under Object, rb_class_tbl remains for GC. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (str_to_id): check for empty string before intern.matz2003-06-211-2/+12
| | | | | | | [ruby-talk:74006] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_to_id): use rb_str_intern() instead of rb_intern()nobu2003-06-211-2/+2
| | | | | | | directly, for sanity check. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_Proc): Block/Proc separation. [huge change]matz2003-05-261-18/+14
| | | | | | | | | | | | | | * eval.c (block_arity): returns exact arity number for Procs out of methods. also gives 1 for {|a|..}. * string.c (rb_str_match): revert use of String#index for invocation like string =~ string. * eval.c (rb_Array): move Object#to_a exclusion hack from splat_value(). need to be in eval.c for a while. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_clone): defer copying freezing state aftermatz2003-05-221-1/+2
| | | | | | | calling initialize_copy(). [ruby-dev:20276] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (init_copy): call initialize_copy at the end of copymatz2003-05-201-2/+2
| | | | | | | process. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_cmp): stupid comparison fixed.matz2003-05-191-2/+1
| | | | | | | | * io.c (Init_IO): ARGF.path added (alias to ARGF.filename). [ruby-dev:20197] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (init_copy): rename copy_object as initialize_copy,matz2003-05-191-17/+15
| | | | | | | | | | since it works as copy constructor. * eval.c (rb_add_method): initialize_copy should always be private, like initialize. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_class_allocate_instance): singleton class checkmatz2003-05-161-9/+8
| | | | | | | | | | moved to rb_obj_alloc(). (ruby-bugs-ja PR#345) * re.c (rb_reg_quote): should escape white space characters, \t, \f, \n, \r. (ruby-bugs-ja PR#231) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_le): returns nil if two classes/modules are notmatz2003-05-151-9/+15
| | | | | | | | | in class-superclass relationship. * object.c (rb_mod_cmp): uses new rb_mod_le() behavior. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_methods): list singleton methods if recurmatz2003-05-061-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | argument is false; list all methods otherwise. * numeric.c (num_step): double epsilon to make "1.1.step(1.5,0.1)" to work. * ext/gdbm/gdbm.c (fgdbm_values_at): new method to replace select(index..). * ext/sdbm/init.c (fsdbm_values_at): ditto. * ext/dbm/dbm.c (fdbm_values_at): ditto. * ext/dbm/dbm.c (DBM::VERSION): defined. * ext/gdbm/testgdbm.rb: replace select with values_at. * ext/sdbm/testsdbm.rb: ditto. * ext/dbm/testdbm.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_values_at): new method to replace select(index..).matz2003-05-041-21/+40
| | | | | | | | | | | | | | | | | | | | | | * hash.c (rb_hash_values_at,env_values_at): ditto. * re.c (match_values_at): ditto. * struct.c (rb_struct_values_at): ditto. * re.c (match_select): add iterator behavior. * ext/curses/curses.c, ext/digest/sha2/sha2.c, ext/iconv/iconv.c, ext/racc/cparse/cparse.c: include "ruby.h" at the top to shut up "_FILE_OFFSET_BITS redefined" warning on Solaris. * class.c (rb_class_protected_instance_methods): now gives warnings to show migration path. The default will be reversed on Jan 2004. * numeric.c (num_step): "1.1.step(1.5,0.1)" to work. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_ljust): now takes optional argument to specifymatz2003-05-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | pad string. [ruby-talk:70482] * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. * string.c (rb_str_justify): utility function. * eval.c (rb_add_method): call singleton_method_added or method_added for every method definition (after ruby_running). [ruby-talk:70471] * array.c (rb_ary_reverse_bang): Array#reverse! should not return nil even for arrays sized less than 2. * io.c (argf_eof): should not block after reading all argument files. (ruby-bugs-ja PR#449) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_mod_name): search module path if classname is notmatz2003-04-091-2/+2
| | | | | | | set yet. (ruby-bugs-ja PR#424) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (sock_s_unpack_sockaddr_in): remove structmatz2003-04-071-1/+1
| | | | | | | | | | | | | | | | | | | size check. getnameinfo(3) can handle. [ruby-dev:19967] * io.c (io_read): do not call rb_sys_fail() when required data length is zero. (ruby-bugs-ja PR#420) * eval.c (umethod_proc): should raise TypeError, instead of returning error causing Proc. Following the principle of "fail early". [ruby-core:00927] * pack.c (pack_pack): small but serious typo. * eval.c (backtrace): skip internal allocator frame. (ruby-bugs-ja PR#416) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (avalue_to_svalue): use rb_check_array_type() again.matz2003-03-291-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | Clarify how "to_ary" and "to_a" work. [ruby-talk:68155] * eval.c (svalue_to_avalue): ditto. * eval.c (svalue_to_mrhs): ditto. * eval.c (rb_eval): unary splat to use to_a, but we need a hack to exclude Object#to_a until it's removed. * object.c (rb_Array): check obj.respond_to?("to_a"). Currently all object respond_to "to_a", but Object#to_a will be removed. * range.c (Init_Range): undefine to_ary. * re.c (Init_Regexp): ditto. * regex.c (re_compile_pattern): do not warn if "-" is at the top or last of character class. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_initialize): should check rb_secure(4).matz2003-03-251-0/+7
| | | | | | | | | | | * dir.c (dir_s_getwd): should check rb_secure(4). * object.c (rb_obj_infect): function version of OBJ_INFECT(). * eval.c (rb_secure_update): new function to check object update. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e