diff --git a/src/interpreter/callable.rs b/src/interpreter/callable.rs index 26a8390..695f300 100644 --- a/src/interpreter/callable.rs +++ b/src/interpreter/callable.rs @@ -1,4 +1,4 @@ -use std::fmt::Debug; +use std::{cell::RefCell, fmt::Debug, rc::Rc}; use crate::errors::InterpreterError; @@ -17,3 +17,6 @@ pub trait Callable: Debug + ToString { arguments: Vec, ) -> Result; } + +/// A reference to a callable. +pub type CallableRef = Rc>; diff --git a/src/interpreter/mod.rs b/src/interpreter/mod.rs index 4041801..d6ed7a1 100644 --- a/src/interpreter/mod.rs +++ b/src/interpreter/mod.rs @@ -4,7 +4,7 @@ mod interpretable; mod native_fn; mod value; -pub use callable::Callable; +pub use callable::{Callable, CallableRef}; pub use environment::*; pub use interpretable::*; pub use value::*;