Implemented not for built-in functios

This commit is contained in:
Erin 2022-02-13 00:07:23 +01:00 committed by ondra05
parent a1f6d1ae5f
commit d634692f12

View file

@ -838,7 +838,13 @@ impl ops::Not for Value {
Functio::Able { params, body }
}
Functio::Builtin(_) => todo!(),
Functio::Builtin(b) => {
let arity = b.arity;
Functio::Builtin(BuiltinFunctio::new(
move |args| b.call(&args.iter().cloned().rev().collect::<Vec<_>>()),
arity,
))
}
Functio::Chain { functios, kind } => {
let (a, b) = *functios;
Functio::Chain {