aboutsummaryrefslogtreecommitdiff
path: root/src/lisp/eval.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisp/eval.rs')
-rw-r--r--src/lisp/eval.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lisp/eval.rs b/src/lisp/eval.rs
index 0cf267c..b404662 100644
--- a/src/lisp/eval.rs
+++ b/src/lisp/eval.rs
@@ -217,12 +217,13 @@ where
217 217
218 pub fn eval_for(&mut self, args: &[LispExpr]) -> Result<LispExpr, LispError> { 218 pub fn eval_for(&mut self, args: &[LispExpr]) -> Result<LispExpr, LispError> {
219 let arity = Arity::Exact(2); 219 let arity = Arity::Exact(2);
220 let valid_binding_stmt = |expr: &LispExpr| 220 let valid_binding_stmt = |expr: &LispExpr| {
221 matches!( 221 matches!(
222 expr, 222 expr,
223 LispExpr::List(v) 223 LispExpr::List(v)
224 if v.len() == 2 224 if v.len() == 2
225 && matches!(v[0], LispExpr::Ident(_))); 225 && matches!(v[0], LispExpr::Ident(_)))
226 };
226 227
227 if !arity.check(args) { 228 if !arity.check(args) {
228 Err(arity.to_error()) 229 Err(arity.to_error())
@@ -258,8 +259,8 @@ where
258 } 259 }
259 _ => { 260 _ => {
260 error!("invalid for loop args"); 261 error!("invalid for loop args");
261 Err(EvalError::BadForm.into()) 262 Err(EvalError::BadForm.into())
262 }, 263 }
263 } 264 }
264 } 265 }
265 } 266 }