Project

General

Profile

Misc #10755 ยป using_rb_define_method_for_rbHash.patch

gogotanaka (Kazuki Tanaka), 01/18/2015 03:09 AM

View differences:

hash.c
3899 3899
    rb_define_method(rb_cHash,"eql?", rb_hash_eql, 1);
3900 3900
    rb_define_method(rb_cHash,"fetch", rb_hash_fetch_m, -1);
3901 3901
    rb_define_method(rb_cHash,"[]=", rb_hash_aset, 2);
3902
    rb_define_method(rb_cHash,"store", rb_hash_aset, 2);
3902
    rb_define_alias(rb_cHash,"store", "[]=");
3903 3903
    rb_define_method(rb_cHash,"default", rb_hash_default, -1);
3904 3904
    rb_define_method(rb_cHash,"default=", rb_hash_set_default, 1);
3905 3905
    rb_define_method(rb_cHash,"default_proc", rb_hash_default_proc, 0);
......
3907 3907
    rb_define_method(rb_cHash,"key", rb_hash_key, 1);
3908 3908
    rb_define_method(rb_cHash,"index", rb_hash_index, 1);
3909 3909
    rb_define_method(rb_cHash,"size", rb_hash_size, 0);
3910
    rb_define_method(rb_cHash,"length", rb_hash_size, 0);
3910
    rb_define_alias(rb_cHash,"length", "size");
3911 3911
    rb_define_method(rb_cHash,"empty?", rb_hash_empty_p, 0);
3912 3912
    rb_define_method(rb_cHash,"each_value", rb_hash_each_value, 0);
3913 3913
    rb_define_method(rb_cHash,"each_key", rb_hash_each_key, 0);
3914 3914
    rb_define_method(rb_cHash,"each_pair", rb_hash_each_pair, 0);
3915
    rb_define_method(rb_cHash,"each", rb_hash_each_pair, 0);
3915
    rb_define_alias(rb_cHash,"each", "each_pair");
3916 3916
    rb_define_method(rb_cHash,"keys", rb_hash_keys, 0);
3917 3917
    rb_define_method(rb_cHash,"values", rb_hash_values, 0);
......
3931 3931
    rb_define_method(rb_cHash,"invert", rb_hash_invert, 0);
3932 3932
    rb_define_method(rb_cHash,"update", rb_hash_update, 1);
3933
    rb_define_alias(rb_cHash,"merge!", "update");
3933 3934
    rb_define_method(rb_cHash,"replace", rb_hash_replace, 1);
3934
    rb_define_method(rb_cHash,"merge!", rb_hash_update, 1);
3935 3935
    rb_define_method(rb_cHash,"merge", rb_hash_merge, 1);
3936 3936
    rb_define_method(rb_cHash, "assoc", rb_hash_assoc, 1);
3937 3937
    rb_define_method(rb_cHash, "rassoc", rb_hash_rassoc, 1);
3938 3938
    rb_define_method(rb_cHash, "flatten", rb_hash_flatten, -1);
3939
    rb_define_method(rb_cHash,"include?", rb_hash_has_key, 1);
3940
    rb_define_method(rb_cHash,"member?", rb_hash_has_key, 1);
3941
    rb_define_method(rb_cHash,"has_key?", rb_hash_has_key, 1);
3942
    rb_define_method(rb_cHash,"has_value?", rb_hash_has_value, 1);
3943
    rb_define_method(rb_cHash,"key?", rb_hash_has_key, 1);
3944
    rb_define_method(rb_cHash,"value?", rb_hash_has_value, 1);
3939
    rb_define_method(rb_cHash, "has_key?", rb_hash_has_key, 1);
3940
    rb_define_alias(rb_cHash, "include?", "has_key?");
3941
    rb_define_alias(rb_cHash, "member?", "has_key?");
3942
    rb_define_alias(rb_cHash, "key?", "has_key?");
3943
    rb_define_method(rb_cHash, "has_value?", rb_hash_has_value, 1);
3944
    rb_define_alias(rb_cHash, "value?", "has_value?");
3945 3945
    rb_define_method(rb_cHash,"compare_by_identity", rb_hash_compare_by_id, 0);
3946 3946
    rb_define_method(rb_cHash,"compare_by_identity?", rb_hash_compare_by_id_p, 0);
3947
-