Created
May 27, 2011 03:01
-
-
Save mattetti/994565 to your computer and use it in GitHub Desktop.
gcc reduction.m -o redux -framework Foundation -framework MacRuby -fobjc-gc
This file contains 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
#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