use cljrs_value::Value;
#[derive(Debug, thiserror::Error)]
pub enum EvalError {
#[error("runtime error: {0}")]
Runtime(String),
#[error("unbound symbol: {0}")]
UnboundSymbol(String),
#[error("arity error calling {name}: expected {expected}, got {got}")]
Arity {
name: String,
expected: String,
got: usize,
},
#[error("not callable: {0}")]
NotCallable(String),
#[error("{0}")]
Thrown(Value),
#[error("read error: {0}")]
Read(#[from] cljrs_types::error::CljxError),
#[doc(hidden)]
#[error("internal: recur outside loop or fn")]
Recur(Vec<Value>),
}
pub type EvalResult<T = Value> = Result<T, EvalError>;