Skip to content

Instantly share code, notes, and snippets.

@dlitz
Created October 26, 2011 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlitz/1314989 to your computer and use it in GitHub Desktop.
Save dlitz/1314989 to your computer and use it in GitHub Desktop.
this is the test that happens for if, unless, etc.
RTEST(value) returns true if the value is implicitly true
./ruby.h:
#define RTEST(v) (((VALUE)(v) & ~Qnil) != 0)
...
#define Qfalse ((VALUE)0)
#define Qtrue ((VALUE)2)
#define Qnil ((VALUE)4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment