Skip to content

Instantly share code, notes, and snippets.

@YanhaoYang
Created January 9, 2013 08:55
Show Gist options
  • Save YanhaoYang/4491678 to your computer and use it in GitHub Desktop.
Save YanhaoYang/4491678 to your computer and use it in GitHub Desktop.
For Symbols, `==` is exactly same as `===`
// 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