myplugin/core
turi-eval-autolink-hint
(turi-eval-autolink-hint :int)
emit build hints for the libturi linker and headers.
Since: Phase S2
Env/new
(Env/new :ptr<void>)
create a new unrestricted evaluation environment.
Since: Phase S2
Env/new-sandboxed
(Env/new-sandboxed :ptr<void>)
create a sandboxed environment with I/O and FFI disabled.
Since: Phase S2
Env/free
(Env/free [env :ptr<void>] :void)
free all resources owned by an environment.
| env | TuriEnv handle returned by Env/new or Env/new-sandboxed |
Since: Phase S2
eval
(eval [env :ptr<void> src :cstr] :ptr<void>)
evaluate a Turmeric source string and return a boxed result.
| env | TuriEnv evaluation environment | |
| src | Turmeric source code string |
Since: Phase S2
eval-file
(eval-file [env :ptr<void> path :cstr] :ptr<void>)
evaluate a file's contents in the given environment.
| env | TuriEnv evaluation environment | |
| path | path to the .tur file to evaluate |
Since: Phase S2
eval!
(eval! [env :ptr<void> src :cstr] :ptr<void>)
evaluate a source string and panic on error.
| env | TuriEnv evaluation environment | |
| src | Turmeric source code string |
Since: Phase S2
eval-free
(eval-free [result :ptr<void>] :void)
free a boxed TuriValue returned by eval or eval-file.
| result | ptr<void> previously returned by eval, eval-file, or eval! |
Since: Phase S2
eval-ok?
(eval-ok? [result :ptr<void>] :bool)
return true if the eval result is not an error.
| result | boxed TuriValue |
Since: Phase S2
eval-err?
(eval-err? [result :ptr<void>] :bool)
return true if the eval result is an error.
| result | boxed TuriValue |
Since: Phase S2
eval-err-msg
(eval-err-msg [result :ptr<void>] :cstr)
extract the error message from an error result.
| result | boxed TuriValue (should satisfy eval-err?) |
Since: Phase S2
eval-as-int
(eval-as-int [result :ptr<void>] :int)
extract the integer value from a TURI_INT result.
| result | boxed TuriValue with TURI_INT tag |
Since: Phase S2
eval-as-bool
(eval-as-bool [result :ptr<void>] :bool)
extract the boolean value from a TURI_BOOL result.
| result | boxed TuriValue with TURI_BOOL tag |
Since: Phase S2
eval-as-cstr
(eval-as-cstr [result :ptr<void>] :cstr)
extract the string value from a TURI_CSTR result.
| result | boxed TuriValue with TURI_CSTR tag |
Since: Phase S2
eval-tag
(eval-tag [result :ptr<void>] :int)
return the numeric tag of a TuriValue result.
| result | boxed TuriValue |
Since: Phase S2