Added tuples

This commit is contained in:
2023-08-03 14:39:53 -07:00
parent bc3bd3d1fc
commit 999f24ce52
7 changed files with 85 additions and 4 deletions

View File

@ -32,6 +32,15 @@ pub fn eval_function(g: &Expression) -> Result<Expression, (LineLocation, EvalEr
if args.len() != 1 {panic!()};
let a = &args[0];
// All the functions below take only one argument
if let Expression::Tuple(l, v) = a {
return Err((
*l + *loc,
EvalError::BadArguments(f.to_string(), 1, v.len())
))
};
let Expression::Quantity(l, q) = a else {panic!()};