pub struct Interpreter { /* private fields */ }Implementations§
Source§impl Interpreter
impl Interpreter
pub fn new() -> Self
Sourcepub fn new_with_system() -> Self
pub fn new_with_system() -> Self
Interpreter with both pure builtins AND system-effects built in
(println/sleep/exit/env/read-file/write-file/shell). Call this
from host-side embedders like tatara-init --eval; leave sealed
terreiros using new() so they stay I/O-free.
Sourcepub fn eval_source(&self, src: &str) -> Result<Value>
pub fn eval_source(&self, src: &str) -> Result<Value>
Evaluate a single source string. Returns the value of the last form.
pub fn eval_forms(&self, forms: &[Sexp]) -> Result<Value>
pub fn root_env(&self) -> Env
Sourcepub fn define(&self, name: impl Into<String>, value: Value)
pub fn define(&self, name: impl Into<String>, value: Value)
Install a binding in the top-level environment.
pub fn eval(&self, s: &Sexp, env: &Env) -> Result<Value>
pub fn apply(&self, f: &Value, args: &[Value]) -> Result<Value>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Interpreter
impl RefUnwindSafe for Interpreter
impl Send for Interpreter
impl Sync for Interpreter
impl Unpin for Interpreter
impl UnsafeUnpin for Interpreter
impl UnwindSafe for Interpreter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more