Last active
August 29, 2015 13:56
-
-
Save beakr/9010964 to your computer and use it in GitHub Desktop.
Simple Ruby REPL with mruby. Made as a test for the mruby C API.
This file contains hidden or 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
#include <stdio.h> | |
#include <mruby.h> | |
#include <mruby/compile.h> | |
int main(int argc, char ** argv) | |
{ | |
mrb_state * mrb = mrb_open(); | |
char code[250]; | |
while (1) { | |
printf("[max:250]> "); | |
fgets(code, 250, stdin); | |
mrb_load_string(mrb, code); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment