Created
January 9, 2013 08:55
-
-
Save YanhaoYang/4491678 to your computer and use it in GitHub Desktop.
For Symbols, `==` is exactly same as `===`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// string.c in ruby-1.9.3-p125 src | |
7896 rb_define_method(rb_cSymbol, "==", sym_equal, 1); | |
7897 rb_define_method(rb_cSymbol, "===", sym_equal, 1); | |
7395 static VALUE | |
7396 sym_equal(VALUE sym1, VALUE sym2) | |
7397 { | |
7398 if (sym1 == sym2) return Qtrue; | |
7399 return Qfalse; | |
7400 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment