Added destructuring lambda/rec-lambda, changed let to use the same [] array destructuring syntax, added basic multiset & set-foldl. Fixed a bunch of bugs in fungll, hopefully close to working, but just realized that < is only defined for ints, while it's how the RB-Tree set/map sort their values/keys, so I'll need to extend it like = for all types. Tomorrow!

This commit is contained in:
Nathan Braswell
2021-08-04 00:56:04 -04:00
parent d38cd3e61e
commit 5a61d5f90c
6 changed files with 72 additions and 62 deletions

View File

@@ -1115,7 +1115,7 @@ fun main(argc: int, argv: **char): int {
if params.size <= 1 {
return make_pair(null<KPEnv>(), KPResult::Err(kpString(str("Need 2 or more params to <"))))
}
if !params[0].is_int() { return make_pair(null<KPEnv>(), KPResult::Err(kpString(str("called < with first not an int ") + pr_str(params[0], true)))); }
if !params[0].is_int() { return make_pair(null<KPEnv>(), KPResult::Err(kpString(str("called < with first not an int ") + pr_str(params[0], true) + "\nenv was\n" + dynamic_env->to_string()))); }
for (var i = 0; i < params.size - 1; i++;) {
if !params[i+1].is_int() { return make_pair(null<KPEnv>(), KPResult::Err(kpString(str("called < with param ") + (i+1) + " not an int " + pr_str(params[i+1], true)))); }
if !(params[i].get_int() < params[i+1].get_int()) {