Skip to content

Instantly share code, notes, and snippets.

@lispm
Created March 19, 2017 21:22
Show Gist options
  • Save lispm/cf0f9440c22f9a60b4bca886e81c4900 to your computer and use it in GitHub Desktop.
Save lispm/cf0f9440c22f9a60b4bca886e81c4900 to your computer and use it in GitHub Desktop.
(defvar *fli1*
(fli:register-module "/Applications/Julia-0.5.app/Contents/Resources/julia/lib/libjulia.0.5.1.dylib"))
(fli:define-foreign-function
(jl-init "jl_init" :source)
((julia-home-dir (:reference-pass :ef-mb-string)))
:result-type :void
:language :C
:calling-convention :cdecl)
(fli:define-foreign-function
(jl-eval-string "jl_eval_string" :source)
((julia-home-dir (:reference-pass :ef-mb-string)))
:result-type :void
:language :C
:calling-convention :cdecl)
#|
CL-USER 4 > (jl-init "/Applications/Julia-0.5.app/Contents/Resources/julia/lib/")
CL-USER 5 > (jl-eval-string "print(sqrt(2.0))")
1.4142135623730951
|#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment