Skip to content

Instantly share code, notes, and snippets.

@fjolnir
Created February 28, 2013 18:07
Show Gist options
  • Save fjolnir/5058798 to your computer and use it in GitHub Desktop.
Save fjolnir/5058798 to your computer and use it in GitHub Desktop.
% tranquil Tools/tqc.tq -dylib lib.tq -o test.dylib
% clang libtest.m -ltest -L. -rpath . -framework Foundation
% ./a.out
loaded
foo
HEY!
2013-03-01 03:07:09.267 a.out[38638:707] fromlib: <Klass: 0x7fab1240fe90>
% cat lib.tq
@Klass {
- init { "HEY!" print. self}
}
"loaded" print
% cat libtest.m
#import <stdio.h>
#import <Foundation/Foundation.h>
int main()
{
printf("foo\n");
NSLog(@"fromlib: %@", [[NSClassFromString(@"Klass") alloc] init]);
return 0;
}
%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment