Implement equality for strings

This commit is contained in:
Olivier 'reivilibre' 2024-05-01 22:28:30 +01:00
parent 8fa06fc77e
commit 11316a9cfc

View File

@ -597,7 +597,9 @@ impl<'a, O: OutputSystem + Send, LS: LocalisationSystem + Sync + Send> Interpret
location: loc.clone(),
})
}
},
}
(Value::Str(lstr), Value::Str(rstr)) => Ok(Value::Bool(lstr == rstr)),
// TODO List vs List. Not *that* useful but can be occasionally. But it does involve recursion.
(lother, rother) => Err(InterpreterError::TypeError {
context: "Equals".to_string(),
conflict: format!("can't test {lother:?} and {rother:?} for equality!"),