summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-26 08:22:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-26 08:22:33 +0000
commitb4fd4d6018a8ad72f69912606c60ec42ee3b62b8 (patch)
tree7d8e6794c8b14219eb3a1902d6538ea27a239065 /hash.c
parentea325deab0729bf17d3f366aa6369d93a4db54fd (diff)
* eval.c (Init_Proc): Block/Proc separation. [huge change]
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@3867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hash.c b/hash.c
index 57c580e..ebb1cbc 100644
--- a/hash.c
+++ b/hash.c
@@ -45,7 +45,7 @@ rb_hash_freeze(hash)
VALUE rb_cHash;
static VALUE envtbl;
-static ID id_hash, id_yield, id_default;
+static ID id_hash, id_call, id_default;
VALUE
rb_hash(obj)
@@ -329,7 +329,7 @@ rb_hash_default(argc, argv, hash)
rb_scan_args(argc, argv, "01", &key);
if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
- return rb_funcall(RHASH(hash)->ifnone, id_yield, 2, hash, key);
+ return rb_funcall(RHASH(hash)->ifnone, id_call, 2, hash, key);
}
return RHASH(hash)->ifnone;
}
@@ -453,7 +453,7 @@ rb_hash_shift(hash)
return rb_assoc_new(var.key, var.val);
}
else if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
- return rb_funcall(RHASH(hash)->ifnone, id_yield, 2, hash, Qnil);
+ return rb_funcall(RHASH(hash)->ifnone, id_call, 2, hash, Qnil);
}
else {
return RHASH(hash)->ifnone;
@@ -1730,7 +1730,7 @@ void
Init_Hash()
{
id_hash = rb_intern("hash");
- id_yield = rb_intern("yield");
+ id_call = rb_intern("call");
id_default = rb_intern("default");
rb_cHash = rb_define_class("Hash", rb_cObject);