Skip to content

Instantly share code, notes, and snippets.

@vishnugopal
Created November 18, 2009 19:12
Show Gist options
  • Save vishnugopal/238155 to your computer and use it in GitHub Desktop.
Save vishnugopal/238155 to your computer and use it in GitHub Desktop.
vishnugopal@Elena:Code/working/macruby % macrubyc world.rb
vishnugopal@Elena:Code/working/macruby % macrubyc hello.rb
vishnugopal@Elena:Code/working/macruby % ls
a.out* hello.o hello.rb world.o world.rb
vishnugopal@Elena:Code/working/macruby % macrubyc
vishnugopal@Elena:Code/working/macruby % ./a.out
no such file to load -- world (LoadError)
vishnugopal@Elena:Code/working/macruby % macrubyc hello.o world.o
/var/folders/nX/nXnuXaYeGIOkQo6WIXrqMU+++TI/-Tmp-/main.mm:9: error: expected unqualified-id before ‘void’
/var/folders/nX/nXnuXaYeGIOkQo6WIXrqMU+++TI/-Tmp-/main.mm:9: error: expected `)' before ‘void’
/var/folders/nX/nXnuXaYeGIOkQo6WIXrqMU+++TI/-Tmp-/main.mm:9: error: expected initializer before ‘void’
/var/folders/nX/nXnuXaYeGIOkQo6WIXrqMU+++TI/-Tmp-/main.mm:10: error: expected unqualified-id before ‘void’
/var/folders/nX/nXnuXaYeGIOkQo6WIXrqMU+++TI/-Tmp-/main.mm:10: error: expected `)' before ‘void’
/var/folders/nX/nXnuXaYeGIOkQo6WIXrqMU+++TI/-Tmp-/main.mm:10: error: expected initializer before ‘void’
Error when executing `/usr/bin/g++ /var/folders/nX/nXnuXaYeGIOkQo6WIXrqMU+++TI/-Tmp-/main.mm -c -arch x86_64 -o /var/folders/nX/nXnuXaYeGIOkQo6WIXrqMU+++TI/-Tmp-/main.o -fobjc-gc'
require 'world'
(1..10).each do |i|
p i
end
hello
extern "C" {
void ruby_sysinit(int *, char ***);
void ruby_init(void);
void ruby_set_argv(int, char **);
void rb_vm_init_compiler(void);
void *rb_vm_top_self(void);
void rb_vm_print_current_exception(void);
void rb_exit(int);
void *(void *, void *);
void *(void *, void *);
}
int main(int argc, char **argv)
{
ruby_sysinit(&argc, &argv);
if (argc > 0) {
argc--;
argv++;
}
ruby_init();
ruby_set_argv(argc, argv);
rb_vm_init_compiler();
try {
void *self = rb_vm_top_self();
(self, 0);
(self, 0);
}
catch (...) {
rb_vm_print_current_exception();
rb_exit(1);
}
rb_exit(0);
}
def hello
puts "Hello World"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment