fix: headlist builtin on assoc lists
implement chooseunit for 0 args
This commit is contained in:
@@ -1543,7 +1543,14 @@ pub fn special_case_builtin(
|
||||
mut args: Vec<Term<Name>>,
|
||||
) -> Term<Name> {
|
||||
match func {
|
||||
DefaultFunction::IfThenElse
|
||||
DefaultFunction::ChooseUnit if count > 0 => {
|
||||
let term = args.pop().unwrap();
|
||||
let unit = args.pop().unwrap();
|
||||
|
||||
term.lambda("_").apply(unit)
|
||||
}
|
||||
DefaultFunction::ChooseUnit
|
||||
| DefaultFunction::IfThenElse
|
||||
| DefaultFunction::ChooseList
|
||||
| DefaultFunction::ChooseData
|
||||
| DefaultFunction::Trace => {
|
||||
@@ -1580,16 +1587,6 @@ pub fn special_case_builtin(
|
||||
|
||||
term
|
||||
}
|
||||
DefaultFunction::ChooseUnit => {
|
||||
if count == 0 {
|
||||
unimplemented!("Honestly, why are you doing this?")
|
||||
} else {
|
||||
let term = args.pop().unwrap();
|
||||
let unit = args.pop().unwrap();
|
||||
|
||||
term.lambda("_").apply(unit)
|
||||
}
|
||||
}
|
||||
DefaultFunction::UnConstrData => {
|
||||
let mut term: Term<Name> = (*func).into();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user