Last active
July 13, 2016 09:12
-
-
Save kjunichi/bf9569894fac548bf78d8ddf38c56b40 to your computer and use it in GitHub Desktop.
mruby-julia
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
jl_function_t *func = jl_get_function(jl_main_module,"set_mrb_state"); | |
jl_value_t *argument = jl_box_voidpointer((void*)mrb); | |
ret = jl_call1(func, argument); |
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
jl = <<'EOS' | |
function set_mrb_state(ptr::Ptr{Void}) | |
global MRB_MRB_STATE = ptr | |
end | |
EOS | |
Julia.eval(jl) | |
jl = <<'EOS' | |
function mrb_test() | |
r = ccall( (:mrb_load_string, "libmruby"), Void, (Ptr{Void},Cstring), MRB_MRB_STATE, "puts 'Hello,World!'") | |
end | |
EOS | |
Julia.eval(jl) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment