Skip to content

Instantly share code, notes, and snippets.

@mattetti
Created May 27, 2011 03:01
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 mattetti/994565 to your computer and use it in GitHub Desktop.
Save mattetti/994565 to your computer and use it in GitHub Desktop.
gcc reduction.m -o redux -framework Foundation -framework MacRuby -fobjc-gc
#import <MacRuby/MacRuby.h>
int main(void) {
NSString *test = @"test";
[[MacRuby sharedRuntime] evaluateString:@"def value=(val); @val = val; end; def value; @val; end"];
[[MacRuby sharedRuntime] performRubySelector:sel_registerName("value=:") withArguments:test, nil];
id result = [[MacRuby sharedRuntime] evaluateString:@"value"];
NSLog(@"%@\n", result);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment