diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..8bb3582 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,8 @@ +# Booting the kernel now loads the standard library from the Lib/StLib Shen +# sources (kernel/stlib/), whose type-checked load recurses well past the +# 2 MB default stack of cargo's test threads. The `shen-rust` binary already +# boots on a >=64 MB thread (bin/shen-rust/src/main.rs); this sets the same +# floor for every thread cargo spawns (tests, doctests) so `cargo test` and a +# bare `cargo run` behave without a hand-set RUST_MIN_STACK. +[env] +RUST_MIN_STACK = "268435456" diff --git a/STATUS.md b/STATUS.md index e685edc..ce2dffa 100644 --- a/STATUS.md +++ b/STATUS.md @@ -108,8 +108,9 @@ model, not a single hot spot. On served workloads the story inverts: VM ## Known limitations -- Boot loads + AOT-installs 18 kernel files every startup (~sub-second release); - shen-cl uses pre-compiled FASLs. +- Boot loads + AOT-installs 17 kernel files every startup, then loads the + standard library from the `kernel/stlib/` Shen sources (~sub-second + release); shen-cl uses pre-compiled FASLs. - GC collection is opt-in (`SHEN_RUST_GC=1`) and requires aarch64 macOS/Linux (the conservative stack scan is unimplemented elsewhere — refused with a warning, heap stays grow-only). Hosts embedding the engine diff --git a/crates/klcompile/src/lib.rs b/crates/klcompile/src/lib.rs index c8249f6..153adce 100644 --- a/crates/klcompile/src/lib.rs +++ b/crates/klcompile/src/lib.rs @@ -135,16 +135,16 @@ pub struct CompileReport { } /// Kernel defuns whose source is so large (deeply nested cons literals) -/// that LLVM optimization takes minutes per release build. They run -/// once at boot, so AOT gives no speedup — leave them tree-walked. -/// This is the KERNEL invocation's policy (see `CompileOptions::kernel`), -/// not a property of the compiler. -pub const KERNEL_SLOW_DEFUNS: &[&str] = &[ - "stlib.initialise-sources", - "stlib.initialise-types", - "stlib.initialise-environment", - "stlib.initialise-arities", -]; +/// that LLVM optimization takes minutes per release build, so the kernel +/// AOT invocation leaves them tree-walked. This list is the KERNEL +/// invocation's policy (see `CompileOptions::kernel`), not a property of +/// the compiler. +/// +/// Empty since the S41.2 refresh: the only members were the four +/// `stlib.initialise-*` defuns in the community `stlib.kl`, which is +/// retired — the standard library now loads from the `Lib/StLib` Shen +/// sources at boot (`kernel/stlib/`) and is not part of the kernel AOT set. +pub const KERNEL_SLOW_DEFUNS: &[&str] = &[]; /// Compile KL source text to a Rust module. Pure: no filesystem access. /// One `Codegen` per call, so `__tN` numbering matches the historical @@ -1110,9 +1110,10 @@ mod tests { p } - /// Pin the kernel skip set: with the kernel options, the only - /// force-skipped defuns across all kernel .kl files are exactly the - /// legacy four. A budget heuristic must never silently change this — + /// Pin the kernel skip set: with the kernel options, no defun across + /// the kernel .kl files is force-skipped (empty since the S41.2 refresh + /// retired `stlib.kl`, whose four `stlib.initialise-*` defuns were the + /// only members). A budget heuristic must never silently change this — /// the kernel AOT bytes are frozen behind Gate 6. #[test] fn kernel_skip_set_is_exactly_the_legacy_four() { diff --git a/crates/shen-rust/src/aot/kernel/mod.rs b/crates/shen-rust/src/aot/kernel/mod.rs index bdfc429..938023e 100644 --- a/crates/shen-rust/src/aot/kernel/mod.rs +++ b/crates/shen-rust/src/aot/kernel/mod.rs @@ -30,7 +30,6 @@ pub mod macros; pub mod prolog; pub mod reader; pub mod sequent; -pub mod stlib; pub mod sys; pub mod t_star; pub mod toplevel; @@ -61,7 +60,6 @@ pub fn install_all(interp: &mut Interp) { t_star::install(interp); yacc::install(interp); types::install(interp); - stlib::install(interp); extension_features::install(interp); extension_expand_dynamic::install(interp); extension_launcher::install(interp); diff --git a/crates/shen-rust/src/aot/kernel/stlib.rs b/crates/shen-rust/src/aot/kernel/stlib.rs deleted file mode 100644 index 059ac53..0000000 --- a/crates/shen-rust/src/aot/kernel/stlib.rs +++ /dev/null @@ -1,31222 +0,0 @@ -//! Auto-generated by `klcompile` from kernel/klambda/stlib.kl. -//! -//! DO NOT EDIT. Re-run klcompile to regenerate. - -#![allow( - unused_variables, - unused_braces, - unused_imports, - clippy::let_and_return, - clippy::needless_question_mark, - clippy::redundant_clone, - clippy::needless_late_init, - clippy::len_zero, - clippy::needless_borrow, - clippy::approx_constant, - clippy::redundant_closure_call, - non_snake_case -)] - -use crate::aot::runtime as rt; -use crate::error::{ShenError, ShenResult}; -use crate::interp::eval::Interp; -use crate::value::Value; -use std::rc::Rc; - -/// AOT-compiled from KL `(defun concat* ...)` -pub fn aot_concat_x2a_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "concat*: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V3 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V4 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W5 = { - let __t0 = v_V3.clone(); - let __t1 = v_V4.clone(); - rt::apply_direct(interp, "concat", &[__t0, __t1])? - }; - { - let __t3 = { - let __t2 = v_W5.clone(); - rt::is_symbol(&__t2) - }; - if match rt::is_truthy(interp, &__t3) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_W5.clone()); - } else { - break Ok({ - let __t9 = { - let __t4 = Value::str("'"); - let __t8 = { - let __t5 = v_W5.clone(); - let __t6 = Value::str("' is not a symbol\n"); - let __t7 = Value::sym(interp.intern("shen.a")); - rt::apply_direct(interp, "shen.app", &[__t5, __t6, __t7])? - }; - rt::apply_direct(interp, "cn", &[__t4, __t8])? - }; - rt::apply_direct(interp, "simple-error", &[__t9])? - }); - } - } - } - } -} - -fn install_concat_x2a_(interp: &mut Interp) { - interp.register_native("concat*", 2, aot_concat_x2a_); - interp.register_aot_direct("concat*", aot_concat_x2a_); -} - -/// AOT-compiled from KL `(defun newv ...)` -pub fn aot_newv(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "newv: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t10 = Value::sym(interp.intern("X")); - rt::apply_direct(interp, "gensym", &[__t10])? - }); - } -} - -fn install_newv(interp: &mut Interp) { - interp.register_native("newv", 0, aot_newv); - interp.register_aot_direct("newv", aot_newv); -} - -/// AOT-compiled from KL `(defun maths.maths-macro ...)` -pub fn aot_maths_x2e_maths_x2d_macro(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "maths.maths-macro: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V8 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1202 = { - let __t1190 = { - let __t1176 = v_V8.clone(); - rt::is_cons(&__t1176) - }; - if !rt::is_truthy(interp, &__t1190)? { - Value::bool(false) - } else { - let __t1191 = { - let __t1188 = { - let __t1177 = Value::sym(interp.intern("log10")); - let __t1179 = { - let __t1178 = v_V8.clone(); - rt::hd(&__t1178)? - }; - rt::eq(&__t1177, &__t1179) - }; - if !rt::is_truthy(interp, &__t1188)? { - Value::bool(false) - } else { - let __t1189 = { - let __t1186 = { - let __t1181 = { - let __t1180 = v_V8.clone(); - rt::tl(&__t1180)? - }; - rt::is_cons(&__t1181) - }; - if !rt::is_truthy(interp, &__t1186)? { - Value::bool(false) - } else { - let __t1187 = { - let __t1182 = Value::nil(); - let __t1185 = { - let __t1184 = { - let __t1183 = v_V8.clone(); - rt::tl(&__t1183)? - }; - rt::tl(&__t1184)? - }; - rt::eq(&__t1182, &__t1185) - }; - Value::bool(rt::is_truthy(interp, &__t1187)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1189)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1191)?) - } - }; - if match rt::is_truthy(interp, &__t1202) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1192 = Value::sym(interp.intern("log10")); - let __t1201 = { - let __t1195 = { - let __t1194 = { - let __t1193 = v_V8.clone(); - rt::tl(&__t1193)? - }; - rt::hd(&__t1194)? - }; - let __t1200 = { - let __t1198 = { - let __t1196 = Value::sym(interp.intern("tolerance")); - let __t1197 = Value::nil(); - rt::cons(&__t1196, &__t1197) - }; - let __t1199 = Value::nil(); - rt::cons(&__t1198, &__t1199) - }; - rt::cons(&__t1195, &__t1200) - }; - rt::cons(&__t1192, &__t1201) - }); - } else { - { - let __t1175 = { - let __t1163 = { - let __t1149 = v_V8.clone(); - rt::is_cons(&__t1149) - }; - if !rt::is_truthy(interp, &__t1163)? { - Value::bool(false) - } else { - let __t1164 = { - let __t1161 = { - let __t1150 = Value::sym(interp.intern("log2")); - let __t1152 = { - let __t1151 = v_V8.clone(); - rt::hd(&__t1151)? - }; - rt::eq(&__t1150, &__t1152) - }; - if !rt::is_truthy(interp, &__t1161)? { - Value::bool(false) - } else { - let __t1162 = { - let __t1159 = { - let __t1154 = { - let __t1153 = v_V8.clone(); - rt::tl(&__t1153)? - }; - rt::is_cons(&__t1154) - }; - if !rt::is_truthy(interp, &__t1159)? { - Value::bool(false) - } else { - let __t1160 = { - let __t1155 = Value::nil(); - let __t1158 = { - let __t1157 = { - let __t1156 = v_V8.clone(); - rt::tl(&__t1156)? - }; - rt::tl(&__t1157)? - }; - rt::eq(&__t1155, &__t1158) - }; - Value::bool(rt::is_truthy(interp, &__t1160)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1162)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1164)?) - } - }; - if match rt::is_truthy(interp, &__t1175) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1165 = Value::sym(interp.intern("log2")); - let __t1174 = { - let __t1168 = { - let __t1167 = { - let __t1166 = v_V8.clone(); - rt::tl(&__t1166)? - }; - rt::hd(&__t1167)? - }; - let __t1173 = { - let __t1171 = { - let __t1169 = Value::sym(interp.intern("tolerance")); - let __t1170 = Value::nil(); - rt::cons(&__t1169, &__t1170) - }; - let __t1172 = Value::nil(); - rt::cons(&__t1171, &__t1172) - }; - rt::cons(&__t1168, &__t1173) - }; - rt::cons(&__t1165, &__t1174) - }); - } else { - { - let __t1148 = { - let __t1136 = { - let __t1122 = v_V8.clone(); - rt::is_cons(&__t1122) - }; - if !rt::is_truthy(interp, &__t1136)? { - Value::bool(false) - } else { - let __t1137 = { - let __t1134 = { - let __t1123 = Value::sym(interp.intern("loge")); - let __t1125 = { - let __t1124 = v_V8.clone(); - rt::hd(&__t1124)? - }; - rt::eq(&__t1123, &__t1125) - }; - if !rt::is_truthy(interp, &__t1134)? { - Value::bool(false) - } else { - let __t1135 = { - let __t1132 = { - let __t1127 = { - let __t1126 = v_V8.clone(); - rt::tl(&__t1126)? - }; - rt::is_cons(&__t1127) - }; - if !rt::is_truthy(interp, &__t1132)? { - Value::bool(false) - } else { - let __t1133 = { - let __t1128 = Value::nil(); - let __t1131 = { - let __t1130 = { - let __t1129 = v_V8.clone(); - rt::tl(&__t1129)? - }; - rt::tl(&__t1130)? - }; - rt::eq(&__t1128, &__t1131) - }; - Value::bool(rt::is_truthy(interp, &__t1133)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1135)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1137)?) - } - }; - if match rt::is_truthy(interp, &__t1148) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1138 = Value::sym(interp.intern("loge")); - let __t1147 = { - let __t1141 = { - let __t1140 = { - let __t1139 = v_V8.clone(); - rt::tl(&__t1139)? - }; - rt::hd(&__t1140)? - }; - let __t1146 = { - let __t1144 = { - let __t1142 = - Value::sym(interp.intern("tolerance")); - let __t1143 = Value::nil(); - rt::cons(&__t1142, &__t1143) - }; - let __t1145 = Value::nil(); - rt::cons(&__t1144, &__t1145) - }; - rt::cons(&__t1141, &__t1146) - }; - rt::cons(&__t1138, &__t1147) - }); - } else { - { - let __t1121 = { - let __t1104 = { - let __t1084 = v_V8.clone(); - rt::is_cons(&__t1084) - }; - if !rt::is_truthy(interp, &__t1104)? { - Value::bool(false) - } else { - let __t1105 = { - let __t1102 = { - let __t1085 = Value::sym(interp.intern("log")); - let __t1087 = { - let __t1086 = v_V8.clone(); - rt::hd(&__t1086)? - }; - rt::eq(&__t1085, &__t1087) - }; - if !rt::is_truthy(interp, &__t1102)? { - Value::bool(false) - } else { - let __t1103 = { - let __t1100 = { - let __t1089 = { - let __t1088 = v_V8.clone(); - rt::tl(&__t1088)? - }; - rt::is_cons(&__t1089) - }; - if !rt::is_truthy(interp, &__t1100)? { - Value::bool(false) - } else { - let __t1101 = { - let __t1098 = { - let __t1092 = { - let __t1091 = { - let __t1090 = - v_V8.clone(); - rt::tl(&__t1090)? - }; - rt::tl(&__t1091)? - }; - rt::is_cons(&__t1092) - }; - if !rt::is_truthy(interp, &__t1098)? - { - Value::bool(false) - } else { - let __t1099 = { - let __t1093 = Value::nil(); - let __t1097 = { - let __t1096 = { - let __t1095 = { - let __t1094 = - v_V8.clone( - ); - rt::tl( - &__t1094, - )? - }; - rt::tl(&__t1095)? - }; - rt::tl(&__t1096)? - }; - rt::eq(&__t1093, &__t1097) - }; - Value::bool(rt::is_truthy( - interp, &__t1099, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t1101, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1103)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1105)?) - } - }; - if match rt::is_truthy(interp, &__t1121) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1106 = Value::sym(interp.intern("log")); - let __t1120 = { - let __t1109 = { - let __t1108 = { - let __t1107 = v_V8.clone(); - rt::tl(&__t1107)? - }; - rt::hd(&__t1108)? - }; - let __t1119 = { - let __t1113 = { - let __t1112 = { - let __t1111 = { - let __t1110 = v_V8.clone(); - rt::tl(&__t1110)? - }; - rt::tl(&__t1111)? - }; - rt::hd(&__t1112)? - }; - let __t1118 = { - let __t1116 = { - let __t1114 = Value::sym( - interp.intern("tolerance"), - ); - let __t1115 = Value::nil(); - rt::cons(&__t1114, &__t1115) - }; - let __t1117 = Value::nil(); - rt::cons(&__t1116, &__t1117) - }; - rt::cons(&__t1113, &__t1118) - }; - rt::cons(&__t1109, &__t1119) - }; - rt::cons(&__t1106, &__t1120) - }); - } else { - { - let __t1083 = { - let __t1071 = { - let __t1057 = v_V8.clone(); - rt::is_cons(&__t1057) - }; - if !rt::is_truthy(interp, &__t1071)? { - Value::bool(false) - } else { - let __t1072 = { - let __t1069 = { - let __t1058 = - Value::sym(interp.intern("sin")); - let __t1060 = { - let __t1059 = v_V8.clone(); - rt::hd(&__t1059)? - }; - rt::eq(&__t1058, &__t1060) - }; - if !rt::is_truthy(interp, &__t1069)? { - Value::bool(false) - } else { - let __t1070 = { - let __t1067 = { - let __t1062 = { - let __t1061 = v_V8.clone(); - rt::tl(&__t1061)? - }; - rt::is_cons(&__t1062) - }; - if !rt::is_truthy(interp, &__t1067)? - { - Value::bool(false) - } else { - let __t1068 = { - let __t1063 = Value::nil(); - let __t1066 = { - let __t1065 = { - let __t1064 = - v_V8.clone(); - rt::tl(&__t1064)? - }; - rt::tl(&__t1065)? - }; - rt::eq(&__t1063, &__t1066) - }; - Value::bool(rt::is_truthy( - interp, &__t1068, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t1070, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1072)?) - } - }; - if match rt::is_truthy(interp, &__t1083) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1073 = Value::sym(interp.intern("sin")); - let __t1082 = { - let __t1076 = { - let __t1075 = { - let __t1074 = v_V8.clone(); - rt::tl(&__t1074)? - }; - rt::hd(&__t1075)? - }; - let __t1081 = { - let __t1079 = { - let __t1077 = Value::sym( - interp.intern("tolerance"), - ); - let __t1078 = Value::nil(); - rt::cons(&__t1077, &__t1078) - }; - let __t1080 = Value::nil(); - rt::cons(&__t1079, &__t1080) - }; - rt::cons(&__t1076, &__t1081) - }; - rt::cons(&__t1073, &__t1082) - }); - } else { - { - let __t1056 = { - let __t1044 = { - let __t1030 = v_V8.clone(); - rt::is_cons(&__t1030) - }; - if !rt::is_truthy(interp, &__t1044)? { - Value::bool(false) - } else { - let __t1045 = { - let __t1042 = { - let __t1031 = Value::sym( - interp.intern("tan"), - ); - let __t1033 = { - let __t1032 = v_V8.clone(); - rt::hd(&__t1032)? - }; - rt::eq(&__t1031, &__t1033) - }; - if !rt::is_truthy(interp, &__t1042)? - { - Value::bool(false) - } else { - let __t1043 = { - let __t1040 = { - let __t1035 = { - let __t1034 = - v_V8.clone(); - rt::tl(&__t1034)? - }; - rt::is_cons(&__t1035) - }; - if !rt::is_truthy( - interp, &__t1040, - )? { - Value::bool(false) - } else { - let __t1041 = { - let __t1036 = - Value::nil(); - let __t1039 = { - let __t1038 = { - let __t1037 = v_V8.clone(); - rt::tl(&__t1037)? - }; - rt::tl( - &__t1038, - )? - }; - rt::eq( - &__t1036, - &__t1039, - ) - }; - Value::bool( - rt::is_truthy( - interp, - &__t1041, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t1043, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t1045, - )?) - } - }; - if match rt::is_truthy(interp, &__t1056) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1046 = - Value::sym(interp.intern("tan")); - let __t1055 = { - let __t1049 = { - let __t1048 = { - let __t1047 = v_V8.clone(); - rt::tl(&__t1047)? - }; - rt::hd(&__t1048)? - }; - let __t1054 = { - let __t1052 = { - let __t1050 = Value::sym( - interp.intern( - "tolerance", - ), - ); - let __t1051 = Value::nil(); - rt::cons(&__t1050, &__t1051) - }; - let __t1053 = Value::nil(); - rt::cons(&__t1052, &__t1053) - }; - rt::cons(&__t1049, &__t1054) - }; - rt::cons(&__t1046, &__t1055) - }); - } else { - { - let __t1029 = { - let __t1017 = { - let __t1003 = v_V8.clone(); - rt::is_cons(&__t1003) - }; - if !rt::is_truthy(interp, &__t1017)? - { - Value::bool(false) - } else { - let __t1018 = { - let __t1015 = { - let __t1004 = - Value::sym( - interp.intern( - "cos", - ), - ); - let __t1006 = { - let __t1005 = - v_V8.clone(); - rt::hd(&__t1005)? - }; - rt::eq( - &__t1004, &__t1006, - ) - }; - if !rt::is_truthy( - interp, &__t1015, - )? { - Value::bool(false) - } else { - let __t1016 = { - let __t1013 = { - let __t1008 = { - let __t1007 = v_V8.clone(); - rt::tl(&__t1007)? - }; - rt::is_cons( - &__t1008, - ) - }; - if !rt::is_truthy( - interp, - &__t1013, - )? { - Value::bool( - false, - ) - } else { - let __t1014 = { - let __t1009 = Value::nil(); - let __t1012 = { - let __t1011 = { - let __t1010 = v_V8.clone(); - rt::tl(&__t1010)? - }; - rt::tl(&__t1011)? - }; - rt::eq(&__t1009, &__t1012) - }; - Value::bool(rt::is_truthy(interp, &__t1014)?) - } - }; - Value::bool( - rt::is_truthy( - interp, - &__t1016, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t1018, - )?) - } - }; - if match rt::is_truthy(interp, &__t1029) - { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1019 = Value::sym( - interp.intern("cos"), - ); - let __t1028 = { - let __t1022 = { - let __t1021 = { - let __t1020 = - v_V8.clone(); - rt::tl(&__t1020)? - }; - rt::hd(&__t1021)? - }; - let __t1027 = { - let __t1025 = { - let __t1023 = Value::sym(interp.intern("tolerance")); - let __t1024 = - Value::nil(); - rt::cons( - &__t1023, - &__t1024, - ) - }; - let __t1026 = - Value::nil(); - rt::cons( - &__t1025, &__t1026, - ) - }; - rt::cons(&__t1022, &__t1027) - }; - rt::cons(&__t1019, &__t1028) - }); - } else { - { - let __t1002 = { - let __t990 = { - let __t976 = - v_V8.clone(); - rt::is_cons(&__t976) - }; - if !rt::is_truthy( - interp, &__t990, - )? { - Value::bool(false) - } else { - let __t991 = { - let __t988 = { - let __t977 = Value::sym(interp.intern("tanh")); - let __t979 = { - let __t978 = v_V8.clone(); - rt::hd( - &__t978, - )? - }; - rt::eq( - &__t977, - &__t979, - ) - }; - if !rt::is_truthy( - interp, &__t988, - )? { - Value::bool( - false, - ) - } else { - let __t989 = { - let __t986 = { - let __t981 = { - let __t980 = v_V8.clone(); - rt::tl(&__t980)? - }; - rt::is_cons(&__t981) - }; - if !rt::is_truthy(interp, &__t986)? { Value::bool(false) } else { let __t987 = { let __t982 = Value::nil(); let __t985 = { let __t984 = { let __t983 = v_V8.clone(); rt::tl(&__t983)? }; rt::tl(&__t984)? }; rt::eq(&__t982, &__t985) }; Value::bool(rt::is_truthy(interp, &__t987)?) } - }; - Value::bool(rt::is_truthy(interp, &__t989)?) - } - }; - Value::bool( - rt::is_truthy( - interp, &__t991, - )?, - ) - } - }; - if match rt::is_truthy( - interp, &__t1002, - ) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t992 = Value::sym( - interp - .intern("tanh"), - ); - let __t1001 = { - let __t995 = { - let __t994 = { - let __t993 = v_V8.clone(); - rt::tl( - &__t993, - )? - }; - rt::hd(&__t994)? - }; - let __t1000 = { - let __t998 = { - let __t996 = Value::sym(interp.intern("tolerance")); - let __t997 = Value::nil(); - rt::cons( - &__t996, - &__t997, - ) - }; - let __t999 = - Value::nil( - ); - rt::cons( - &__t998, - &__t999, - ) - }; - rt::cons( - &__t995, - &__t1000, - ) - }; - rt::cons( - &__t992, &__t1001, - ) - }); - } else { - { - let __t975 = { - let __t963 = { - let __t949 = - v_V8.clone( - ); - rt::is_cons( - &__t949, - ) - }; - if !rt::is_truthy( - interp, &__t963, - )? { - Value::bool( - false, - ) - } else { - let __t964 = { - let __t961 = { - let __t950 = Value::sym(interp.intern("cosh")); - let __t952 = { - let __t951 = v_V8.clone(); - rt::hd(&__t951)? - }; - rt::eq(&__t950, &__t952) - }; - if !rt::is_truthy(interp, &__t961)? { Value::bool(false) } else { let __t962 = { let __t959 = { let __t954 = { let __t953 = v_V8.clone(); rt::tl(&__t953)? }; rt::is_cons(&__t954) }; if !rt::is_truthy(interp, &__t959)? { Value::bool(false) } else { let __t960 = { let __t955 = Value::nil(); let __t958 = { let __t957 = { let __t956 = v_V8.clone(); rt::tl(&__t956)? }; rt::tl(&__t957)? }; rt::eq(&__t955, &__t958) }; Value::bool(rt::is_truthy(interp, &__t960)?) } }; Value::bool(rt::is_truthy(interp, &__t962)?) } - }; - Value::bool(rt::is_truthy(interp, &__t964)?) - } - }; - if match rt::is_truthy( - interp, &__t975, - ) { - Ok(b) => b, - Err(e) => { - break Err(e) - } - } { - break Ok({ - let __t965 = Value::sym(interp.intern("cosh")); - let __t974 = { - let __t968 = { - let __t967 = { - let __t966 = v_V8.clone(); - rt::tl(&__t966)? - }; - rt::hd(&__t967)? - }; - let __t973 = { - let __t971 = { - let __t969 = Value::sym(interp.intern("tolerance")); - let __t970 = Value::nil(); - rt::cons(&__t969, &__t970) - }; - let __t972 = Value::nil(); - rt::cons(&__t971, &__t972) - }; - rt::cons( - &__t968, - &__t973, - ) - }; - rt::cons( - &__t965, - &__t974, - ) - }); - } else { - { - let __t948 = { - let __t936 = { - let __t922 = v_V8.clone(); - rt::is_cons(&__t922) - }; - if !rt::is_truthy(interp, &__t936)? { Value::bool(false) } else { let __t937 = { let __t934 = { let __t923 = Value::sym(interp.intern("sinh")); let __t925 = { let __t924 = v_V8.clone(); rt::hd(&__t924)? }; rt::eq(&__t923, &__t925) }; if !rt::is_truthy(interp, &__t934)? { Value::bool(false) } else { let __t935 = { let __t932 = { let __t927 = { let __t926 = v_V8.clone(); rt::tl(&__t926)? }; rt::is_cons(&__t927) }; if !rt::is_truthy(interp, &__t932)? { Value::bool(false) } else { let __t933 = { let __t928 = Value::nil(); let __t931 = { let __t930 = { let __t929 = v_V8.clone(); rt::tl(&__t929)? }; rt::tl(&__t930)? }; rt::eq(&__t928, &__t931) }; Value::bool(rt::is_truthy(interp, &__t933)?) } }; Value::bool(rt::is_truthy(interp, &__t935)?) } }; Value::bool(rt::is_truthy(interp, &__t937)?) } - }; - if match rt::is_truthy(interp, &__t948) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t938 = Value::sym(interp.intern("sinh")); let __t947 = { let __t941 = { let __t940 = { let __t939 = v_V8.clone(); rt::tl(&__t939)? }; rt::hd(&__t940)? }; let __t946 = { let __t944 = { let __t942 = Value::sym(interp.intern("tolerance")); let __t943 = Value::nil(); rt::cons(&__t942, &__t943) }; let __t945 = Value::nil(); rt::cons(&__t944, &__t945) }; rt::cons(&__t941, &__t946) }; rt::cons(&__t938, &__t947) }); } else { { let __t921 = { let __t909 = { let __t895 = v_V8.clone(); rt::is_cons(&__t895) }; if !rt::is_truthy(interp, &__t909)? { Value::bool(false) } else { let __t910 = { let __t907 = { let __t896 = Value::sym(interp.intern("sech")); let __t898 = { let __t897 = v_V8.clone(); rt::hd(&__t897)? }; rt::eq(&__t896, &__t898) }; if !rt::is_truthy(interp, &__t907)? { Value::bool(false) } else { let __t908 = { let __t905 = { let __t900 = { let __t899 = v_V8.clone(); rt::tl(&__t899)? }; rt::is_cons(&__t900) }; if !rt::is_truthy(interp, &__t905)? { Value::bool(false) } else { let __t906 = { let __t901 = Value::nil(); let __t904 = { let __t903 = { let __t902 = v_V8.clone(); rt::tl(&__t902)? }; rt::tl(&__t903)? }; rt::eq(&__t901, &__t904) }; Value::bool(rt::is_truthy(interp, &__t906)?) } }; Value::bool(rt::is_truthy(interp, &__t908)?) } }; Value::bool(rt::is_truthy(interp, &__t910)?) } }; if match rt::is_truthy(interp, &__t921) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t911 = Value::sym(interp.intern("sech")); let __t920 = { let __t914 = { let __t913 = { let __t912 = v_V8.clone(); rt::tl(&__t912)? }; rt::hd(&__t913)? }; let __t919 = { let __t917 = { let __t915 = Value::sym(interp.intern("tolerance")); let __t916 = Value::nil(); rt::cons(&__t915, &__t916) }; let __t918 = Value::nil(); rt::cons(&__t917, &__t918) }; rt::cons(&__t914, &__t919) }; rt::cons(&__t911, &__t920) }); } else { { let __t894 = { let __t882 = { let __t868 = v_V8.clone(); rt::is_cons(&__t868) }; if !rt::is_truthy(interp, &__t882)? { Value::bool(false) } else { let __t883 = { let __t880 = { let __t869 = Value::sym(interp.intern("csch")); let __t871 = { let __t870 = v_V8.clone(); rt::hd(&__t870)? }; rt::eq(&__t869, &__t871) }; if !rt::is_truthy(interp, &__t880)? { Value::bool(false) } else { let __t881 = { let __t878 = { let __t873 = { let __t872 = v_V8.clone(); rt::tl(&__t872)? }; rt::is_cons(&__t873) }; if !rt::is_truthy(interp, &__t878)? { Value::bool(false) } else { let __t879 = { let __t874 = Value::nil(); let __t877 = { let __t876 = { let __t875 = v_V8.clone(); rt::tl(&__t875)? }; rt::tl(&__t876)? }; rt::eq(&__t874, &__t877) }; Value::bool(rt::is_truthy(interp, &__t879)?) } }; Value::bool(rt::is_truthy(interp, &__t881)?) } }; Value::bool(rt::is_truthy(interp, &__t883)?) } }; if match rt::is_truthy(interp, &__t894) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t884 = Value::sym(interp.intern("csch")); let __t893 = { let __t887 = { let __t886 = { let __t885 = v_V8.clone(); rt::tl(&__t885)? }; rt::hd(&__t886)? }; let __t892 = { let __t890 = { let __t888 = Value::sym(interp.intern("tolerance")); let __t889 = Value::nil(); rt::cons(&__t888, &__t889) }; let __t891 = Value::nil(); rt::cons(&__t890, &__t891) }; rt::cons(&__t887, &__t892) }; rt::cons(&__t884, &__t893) }); } else { { let __t867 = { let __t855 = { let __t841 = v_V8.clone(); rt::is_cons(&__t841) }; if !rt::is_truthy(interp, &__t855)? { Value::bool(false) } else { let __t856 = { let __t853 = { let __t842 = Value::sym(interp.intern("coth")); let __t844 = { let __t843 = v_V8.clone(); rt::hd(&__t843)? }; rt::eq(&__t842, &__t844) }; if !rt::is_truthy(interp, &__t853)? { Value::bool(false) } else { let __t854 = { let __t851 = { let __t846 = { let __t845 = v_V8.clone(); rt::tl(&__t845)? }; rt::is_cons(&__t846) }; if !rt::is_truthy(interp, &__t851)? { Value::bool(false) } else { let __t852 = { let __t847 = Value::nil(); let __t850 = { let __t849 = { let __t848 = v_V8.clone(); rt::tl(&__t848)? }; rt::tl(&__t849)? }; rt::eq(&__t847, &__t850) }; Value::bool(rt::is_truthy(interp, &__t852)?) } }; Value::bool(rt::is_truthy(interp, &__t854)?) } }; Value::bool(rt::is_truthy(interp, &__t856)?) } }; if match rt::is_truthy(interp, &__t867) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t857 = Value::sym(interp.intern("coth")); let __t866 = { let __t860 = { let __t859 = { let __t858 = v_V8.clone(); rt::tl(&__t858)? }; rt::hd(&__t859)? }; let __t865 = { let __t863 = { let __t861 = Value::sym(interp.intern("tolerance")); let __t862 = Value::nil(); rt::cons(&__t861, &__t862) }; let __t864 = Value::nil(); rt::cons(&__t863, &__t864) }; rt::cons(&__t860, &__t865) }; rt::cons(&__t857, &__t866) }); } else { { let __t840 = { let __t823 = { let __t803 = v_V8.clone(); rt::is_cons(&__t803) }; if !rt::is_truthy(interp, &__t823)? { Value::bool(false) } else { let __t824 = { let __t821 = { let __t804 = Value::sym(interp.intern("nthrt")); let __t806 = { let __t805 = v_V8.clone(); rt::hd(&__t805)? }; rt::eq(&__t804, &__t806) }; if !rt::is_truthy(interp, &__t821)? { Value::bool(false) } else { let __t822 = { let __t819 = { let __t808 = { let __t807 = v_V8.clone(); rt::tl(&__t807)? }; rt::is_cons(&__t808) }; if !rt::is_truthy(interp, &__t819)? { Value::bool(false) } else { let __t820 = { let __t817 = { let __t811 = { let __t810 = { let __t809 = v_V8.clone(); rt::tl(&__t809)? }; rt::tl(&__t810)? }; rt::is_cons(&__t811) }; if !rt::is_truthy(interp, &__t817)? { Value::bool(false) } else { let __t818 = { let __t812 = Value::nil(); let __t816 = { let __t815 = { let __t814 = { let __t813 = v_V8.clone(); rt::tl(&__t813)? }; rt::tl(&__t814)? }; rt::tl(&__t815)? }; rt::eq(&__t812, &__t816) }; Value::bool(rt::is_truthy(interp, &__t818)?) } }; Value::bool(rt::is_truthy(interp, &__t820)?) } }; Value::bool(rt::is_truthy(interp, &__t822)?) } }; Value::bool(rt::is_truthy(interp, &__t824)?) } }; if match rt::is_truthy(interp, &__t840) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t825 = Value::sym(interp.intern("nthrt")); let __t839 = { let __t828 = { let __t827 = { let __t826 = v_V8.clone(); rt::tl(&__t826)? }; rt::hd(&__t827)? }; let __t838 = { let __t832 = { let __t831 = { let __t830 = { let __t829 = v_V8.clone(); rt::tl(&__t829)? }; rt::tl(&__t830)? }; rt::hd(&__t831)? }; let __t837 = { let __t835 = { let __t833 = Value::sym(interp.intern("tolerance")); let __t834 = Value::nil(); rt::cons(&__t833, &__t834) }; let __t836 = Value::nil(); rt::cons(&__t835, &__t836) }; rt::cons(&__t832, &__t837) }; rt::cons(&__t828, &__t838) }; rt::cons(&__t825, &__t839) }); } else { { let __t802 = { let __t790 = { let __t776 = v_V8.clone(); rt::is_cons(&__t776) }; if !rt::is_truthy(interp, &__t790)? { Value::bool(false) } else { let __t791 = { let __t788 = { let __t777 = Value::sym(interp.intern("sqrt")); let __t779 = { let __t778 = v_V8.clone(); rt::hd(&__t778)? }; rt::eq(&__t777, &__t779) }; if !rt::is_truthy(interp, &__t788)? { Value::bool(false) } else { let __t789 = { let __t786 = { let __t781 = { let __t780 = v_V8.clone(); rt::tl(&__t780)? }; rt::is_cons(&__t781) }; if !rt::is_truthy(interp, &__t786)? { Value::bool(false) } else { let __t787 = { let __t782 = Value::nil(); let __t785 = { let __t784 = { let __t783 = v_V8.clone(); rt::tl(&__t783)? }; rt::tl(&__t784)? }; rt::eq(&__t782, &__t785) }; Value::bool(rt::is_truthy(interp, &__t787)?) } }; Value::bool(rt::is_truthy(interp, &__t789)?) } }; Value::bool(rt::is_truthy(interp, &__t791)?) } }; if match rt::is_truthy(interp, &__t802) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t792 = Value::sym(interp.intern("sqrt")); let __t801 = { let __t795 = { let __t794 = { let __t793 = v_V8.clone(); rt::tl(&__t793)? }; rt::hd(&__t794)? }; let __t800 = { let __t798 = { let __t796 = Value::sym(interp.intern("tolerance")); let __t797 = Value::nil(); rt::cons(&__t796, &__t797) }; let __t799 = Value::nil(); rt::cons(&__t798, &__t799) }; rt::cons(&__t795, &__t800) }; rt::cons(&__t792, &__t801) }); } else { { let __t775 = { let __t758 = { let __t738 = v_V8.clone(); rt::is_cons(&__t738) }; if !rt::is_truthy(interp, &__t758)? { Value::bool(false) } else { let __t759 = { let __t756 = { let __t739 = Value::sym(interp.intern("expt")); let __t741 = { let __t740 = v_V8.clone(); rt::hd(&__t740)? }; rt::eq(&__t739, &__t741) }; if !rt::is_truthy(interp, &__t756)? { Value::bool(false) } else { let __t757 = { let __t754 = { let __t743 = { let __t742 = v_V8.clone(); rt::tl(&__t742)? }; rt::is_cons(&__t743) }; if !rt::is_truthy(interp, &__t754)? { Value::bool(false) } else { let __t755 = { let __t752 = { let __t746 = { let __t745 = { let __t744 = v_V8.clone(); rt::tl(&__t744)? }; rt::tl(&__t745)? }; rt::is_cons(&__t746) }; if !rt::is_truthy(interp, &__t752)? { Value::bool(false) } else { let __t753 = { let __t747 = Value::nil(); let __t751 = { let __t750 = { let __t749 = { let __t748 = v_V8.clone(); rt::tl(&__t748)? }; rt::tl(&__t749)? }; rt::tl(&__t750)? }; rt::eq(&__t747, &__t751) }; Value::bool(rt::is_truthy(interp, &__t753)?) } }; Value::bool(rt::is_truthy(interp, &__t755)?) } }; Value::bool(rt::is_truthy(interp, &__t757)?) } }; Value::bool(rt::is_truthy(interp, &__t759)?) } }; if match rt::is_truthy(interp, &__t775) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t760 = Value::sym(interp.intern("expt")); let __t774 = { let __t763 = { let __t762 = { let __t761 = v_V8.clone(); rt::tl(&__t761)? }; rt::hd(&__t762)? }; let __t773 = { let __t767 = { let __t766 = { let __t765 = { let __t764 = v_V8.clone(); rt::tl(&__t764)? }; rt::tl(&__t765)? }; rt::hd(&__t766)? }; let __t772 = { let __t770 = { let __t768 = Value::sym(interp.intern("tolerance")); let __t769 = Value::nil(); rt::cons(&__t768, &__t769) }; let __t771 = Value::nil(); rt::cons(&__t770, &__t771) }; rt::cons(&__t767, &__t772) }; rt::cons(&__t763, &__t773) }; rt::cons(&__t760, &__t774) }); } else { { let __t737 = { let __t723 = { let __t704 = v_V8.clone(); rt::is_cons(&__t704) }; if !rt::is_truthy(interp, &__t723)? { Value::bool(false) } else { let __t724 = { let __t721 = { let __t705 = Value::sym(interp.intern("max")); let __t707 = { let __t706 = v_V8.clone(); rt::hd(&__t706)? }; rt::eq(&__t705, &__t707) }; if !rt::is_truthy(interp, &__t721)? { Value::bool(false) } else { let __t722 = { let __t719 = { let __t709 = { let __t708 = v_V8.clone(); rt::tl(&__t708)? }; rt::is_cons(&__t709) }; if !rt::is_truthy(interp, &__t719)? { Value::bool(false) } else { let __t720 = { let __t717 = { let __t712 = { let __t711 = { let __t710 = v_V8.clone(); rt::tl(&__t710)? }; rt::tl(&__t711)? }; rt::is_cons(&__t712) }; if !rt::is_truthy(interp, &__t717)? { Value::bool(false) } else { let __t718 = { let __t716 = { let __t715 = { let __t714 = { let __t713 = v_V8.clone(); rt::tl(&__t713)? }; rt::tl(&__t714)? }; rt::tl(&__t715)? }; rt::is_cons(&__t716) }; Value::bool(rt::is_truthy(interp, &__t718)?) } }; Value::bool(rt::is_truthy(interp, &__t720)?) } }; Value::bool(rt::is_truthy(interp, &__t722)?) } }; Value::bool(rt::is_truthy(interp, &__t724)?) } }; if match rt::is_truthy(interp, &__t737) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t725 = Value::sym(interp.intern("max")); let __t736 = { let __t728 = { let __t727 = { let __t726 = v_V8.clone(); rt::tl(&__t726)? }; rt::hd(&__t727)? }; let __t735 = { let __t733 = { let __t729 = Value::sym(interp.intern("max")); let __t732 = { let __t731 = { let __t730 = v_V8.clone(); rt::tl(&__t730)? }; rt::tl(&__t731)? }; rt::cons(&__t729, &__t732) }; let __t734 = Value::nil(); rt::cons(&__t733, &__t734) }; rt::cons(&__t728, &__t735) }; rt::cons(&__t725, &__t736) }); } else { { let __t703 = { let __t689 = { let __t670 = v_V8.clone(); rt::is_cons(&__t670) }; if !rt::is_truthy(interp, &__t689)? { Value::bool(false) } else { let __t690 = { let __t687 = { let __t671 = Value::sym(interp.intern("min")); let __t673 = { let __t672 = v_V8.clone(); rt::hd(&__t672)? }; rt::eq(&__t671, &__t673) }; if !rt::is_truthy(interp, &__t687)? { Value::bool(false) } else { let __t688 = { let __t685 = { let __t675 = { let __t674 = v_V8.clone(); rt::tl(&__t674)? }; rt::is_cons(&__t675) }; if !rt::is_truthy(interp, &__t685)? { Value::bool(false) } else { let __t686 = { let __t683 = { let __t678 = { let __t677 = { let __t676 = v_V8.clone(); rt::tl(&__t676)? }; rt::tl(&__t677)? }; rt::is_cons(&__t678) }; if !rt::is_truthy(interp, &__t683)? { Value::bool(false) } else { let __t684 = { let __t682 = { let __t681 = { let __t680 = { let __t679 = v_V8.clone(); rt::tl(&__t679)? }; rt::tl(&__t680)? }; rt::tl(&__t681)? }; rt::is_cons(&__t682) }; Value::bool(rt::is_truthy(interp, &__t684)?) } }; Value::bool(rt::is_truthy(interp, &__t686)?) } }; Value::bool(rt::is_truthy(interp, &__t688)?) } }; Value::bool(rt::is_truthy(interp, &__t690)?) } }; if match rt::is_truthy(interp, &__t703) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t691 = Value::sym(interp.intern("min")); let __t702 = { let __t694 = { let __t693 = { let __t692 = v_V8.clone(); rt::tl(&__t692)? }; rt::hd(&__t693)? }; let __t701 = { let __t699 = { let __t695 = Value::sym(interp.intern("min")); let __t698 = { let __t697 = { let __t696 = v_V8.clone(); rt::tl(&__t696)? }; rt::tl(&__t697)? }; rt::cons(&__t695, &__t698) }; let __t700 = Value::nil(); rt::cons(&__t699, &__t700) }; rt::cons(&__t694, &__t701) }; rt::cons(&__t691, &__t702) }); } else { { let __t669 = { let __t664 = { let __t650 = v_V8.clone(); rt::is_cons(&__t650) }; if !rt::is_truthy(interp, &__t664)? { Value::bool(false) } else { let __t665 = { let __t662 = { let __t651 = Value::sym(interp.intern("tolerance")); let __t653 = { let __t652 = v_V8.clone(); rt::hd(&__t652)? }; rt::eq(&__t651, &__t653) }; if !rt::is_truthy(interp, &__t662)? { Value::bool(false) } else { let __t663 = { let __t660 = { let __t655 = { let __t654 = v_V8.clone(); rt::tl(&__t654)? }; rt::is_cons(&__t655) }; if !rt::is_truthy(interp, &__t660)? { Value::bool(false) } else { let __t661 = { let __t656 = Value::nil(); let __t659 = { let __t658 = { let __t657 = v_V8.clone(); rt::tl(&__t657)? }; rt::tl(&__t658)? }; rt::eq(&__t656, &__t659) }; Value::bool(rt::is_truthy(interp, &__t661)?) } }; Value::bool(rt::is_truthy(interp, &__t663)?) } }; Value::bool(rt::is_truthy(interp, &__t665)?) } }; if match rt::is_truthy(interp, &__t669) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t666 = Value::sym(interp.intern("maths.tolerance=n")); let __t668 = { let __t667 = v_V8.clone(); rt::tl(&__t667)? }; rt::cons(&__t666, &__t668) }); } else { { let __t649 = { let __t594 = { let __t510 = v_V8.clone(); rt::is_cons(&__t510) }; if !rt::is_truthy(interp, &__t594)? { Value::bool(false) } else { let __t595 = { let __t592 = { let __t511 = Value::sym(interp.intern("for")); let __t513 = { let __t512 = v_V8.clone(); rt::hd(&__t512)? }; rt::eq(&__t511, &__t513) }; if !rt::is_truthy(interp, &__t592)? { Value::bool(false) } else { let __t593 = { let __t590 = { let __t515 = { let __t514 = v_V8.clone(); rt::tl(&__t514)? }; rt::is_cons(&__t515) }; if !rt::is_truthy(interp, &__t590)? { Value::bool(false) } else { let __t591 = { let __t588 = { let __t518 = { let __t517 = { let __t516 = v_V8.clone(); rt::tl(&__t516)? }; rt::tl(&__t517)? }; rt::is_cons(&__t518) }; if !rt::is_truthy(interp, &__t588)? { Value::bool(false) } else { let __t589 = { let __t586 = { let __t519 = Value::sym(interp.intern("=")); let __t523 = { let __t522 = { let __t521 = { let __t520 = v_V8.clone(); rt::tl(&__t520)? }; rt::tl(&__t521)? }; rt::hd(&__t522)? }; rt::eq(&__t519, &__t523) }; if !rt::is_truthy(interp, &__t586)? { Value::bool(false) } else { let __t587 = { let __t584 = { let __t527 = { let __t526 = { let __t525 = { let __t524 = v_V8.clone(); rt::tl(&__t524)? }; rt::tl(&__t525)? }; rt::tl(&__t526)? }; rt::is_cons(&__t527) }; if !rt::is_truthy(interp, &__t584)? { Value::bool(false) } else { let __t585 = { let __t582 = { let __t532 = { let __t531 = { let __t530 = { let __t529 = { let __t528 = v_V8.clone(); rt::tl(&__t528)? }; rt::tl(&__t529)? }; rt::tl(&__t530)? }; rt::tl(&__t531)? }; rt::is_cons(&__t532) }; if !rt::is_truthy(interp, &__t582)? { Value::bool(false) } else { let __t583 = { let __t580 = { let __t538 = { let __t537 = { let __t536 = { let __t535 = { let __t534 = { let __t533 = v_V8.clone(); rt::tl(&__t533)? }; rt::tl(&__t534)? }; rt::tl(&__t535)? }; rt::tl(&__t536)? }; rt::tl(&__t537)? }; rt::is_cons(&__t538) }; if !rt::is_truthy(interp, &__t580)? { Value::bool(false) } else { let __t581 = { let __t578 = { let __t545 = { let __t544 = { let __t543 = { let __t542 = { let __t541 = { let __t540 = { let __t539 = v_V8.clone(); rt::tl(&__t539)? }; rt::tl(&__t540)? }; rt::tl(&__t541)? }; rt::tl(&__t542)? }; rt::tl(&__t543)? }; rt::tl(&__t544)? }; rt::is_cons(&__t545) }; if !rt::is_truthy(interp, &__t578)? { Value::bool(false) } else { let __t579 = { let __t576 = { let __t553 = { let __t552 = { let __t551 = { let __t550 = { let __t549 = { let __t548 = { let __t547 = { let __t546 = v_V8.clone(); rt::tl(&__t546)? }; rt::tl(&__t547)? }; rt::tl(&__t548)? }; rt::tl(&__t549)? }; rt::tl(&__t550)? }; rt::tl(&__t551)? }; rt::tl(&__t552)? }; rt::is_cons(&__t553) }; if !rt::is_truthy(interp, &__t576)? { Value::bool(false) } else { let __t577 = { let __t574 = { let __t554 = Value::sym(interp.intern("and")); let __t563 = { let __t562 = { let __t561 = { let __t560 = { let __t559 = { let __t558 = { let __t557 = { let __t556 = { let __t555 = v_V8.clone(); rt::tl(&__t555)? }; rt::tl(&__t556)? }; rt::tl(&__t557)? }; rt::tl(&__t558)? }; rt::tl(&__t559)? }; rt::tl(&__t560)? }; rt::tl(&__t561)? }; rt::hd(&__t562)? }; rt::eq(&__t554, &__t563) }; if !rt::is_truthy(interp, &__t574)? { Value::bool(false) } else { let __t575 = { let __t564 = Value::nil(); let __t573 = { let __t572 = { let __t571 = { let __t570 = { let __t569 = { let __t568 = { let __t567 = { let __t566 = { let __t565 = v_V8.clone(); rt::tl(&__t565)? }; rt::tl(&__t566)? }; rt::tl(&__t567)? }; rt::tl(&__t568)? }; rt::tl(&__t569)? }; rt::tl(&__t570)? }; rt::tl(&__t571)? }; rt::tl(&__t572)? }; rt::eq(&__t564, &__t573) }; Value::bool(rt::is_truthy(interp, &__t575)?) } }; Value::bool(rt::is_truthy(interp, &__t577)?) } }; Value::bool(rt::is_truthy(interp, &__t579)?) } }; Value::bool(rt::is_truthy(interp, &__t581)?) } }; Value::bool(rt::is_truthy(interp, &__t583)?) } }; Value::bool(rt::is_truthy(interp, &__t585)?) } }; Value::bool(rt::is_truthy(interp, &__t587)?) } }; Value::bool(rt::is_truthy(interp, &__t589)?) } }; Value::bool(rt::is_truthy(interp, &__t591)?) } }; Value::bool(rt::is_truthy(interp, &__t593)?) } }; Value::bool(rt::is_truthy(interp, &__t595)?) } }; if match rt::is_truthy(interp, &__t649) { Ok(b) => b, Err(e) => break Err(e), } { { let v_W9 = { rt::make_aot_closure("", 1, move |interp, args| { let v_Z10 = args[0].clone(); Ok({ let v_Z10 = v_Z10.clone(); rt::make_aot_closure("", 1, move |interp, args| { let v_Z11 = args[0].clone(); Ok({ let __t606 = { let __t598 = { let __t596 = v_Z10.clone(); let __t597 = v_Z11.clone(); rt::apply_direct(interp, "occurrences", &[__t596, __t597])? }; let __t599 = Value::int(0i64); rt::gt(&__t598, &__t599)? }; if rt::is_truthy(interp, &__t606)? { { let __t600 = Value::sym(interp.intern("/.")); let __t605 = { let __t601 = v_Z10.clone(); let __t604 = { let __t602 = v_Z11.clone(); let __t603 = Value::nil(); rt::cons(&__t602, &__t603) }; rt::cons(&__t601, &__t604) }; rt::cons(&__t600, &__t605) } } else { v_Z11.clone() } }) }, vec![v_Z10], interp) }) }, Vec::new(), interp) }; break Ok({ let __t607 = Value::sym(interp.intern("maths.lazyfor-and")); let __t648 = { let __t612 = { let __t611 = { let __t610 = { let __t609 = { let __t608 = v_V8.clone(); rt::tl(&__t608)? }; rt::tl(&__t609)? }; rt::tl(&__t610)? }; rt::hd(&__t611)? }; let __t647 = { let __t623 = { let __t616 = { let __t615 = { let __t614 = { let __t613 = v_V8.clone(); rt::tl(&__t613)? }; rt::hd(&__t614)? }; rt::apply_value(interp, v_W9.clone(), &[__t615])? }; let __t622 = { let __t621 = { let __t620 = { let __t619 = { let __t618 = { let __t617 = v_V8.clone(); rt::tl(&__t617)? }; rt::tl(&__t618)? }; rt::tl(&__t619)? }; rt::tl(&__t620)? }; rt::hd(&__t621)? }; rt::apply_value(interp, __t616, &[__t622])? }; let __t646 = { let __t635 = { let __t627 = { let __t626 = { let __t625 = { let __t624 = v_V8.clone(); rt::tl(&__t624)? }; rt::hd(&__t625)? }; rt::apply_value(interp, v_W9.clone(), &[__t626])? }; let __t634 = { let __t633 = { let __t632 = { let __t631 = { let __t630 = { let __t629 = { let __t628 = v_V8.clone(); rt::tl(&__t628)? }; rt::tl(&__t629)? }; rt::tl(&__t630)? }; rt::tl(&__t631)? }; rt::tl(&__t632)? }; rt::hd(&__t633)? }; rt::apply_value(interp, __t627, &[__t634])? }; let __t645 = { let __t643 = { let __t642 = { let __t641 = { let __t640 = { let __t639 = { let __t638 = { let __t637 = { let __t636 = v_V8.clone(); rt::tl(&__t636)? }; rt::tl(&__t637)? }; rt::tl(&__t638)? }; rt::tl(&__t639)? }; rt::tl(&__t640)? }; rt::tl(&__t641)? }; rt::hd(&__t642)? }; let __t644 = Value::nil(); rt::cons(&__t643, &__t644) }; rt::cons(&__t635, &__t645) }; rt::cons(&__t623, &__t646) }; rt::cons(&__t612, &__t647) }; rt::cons(&__t607, &__t648) }); } } else { { let __t509 = { let __t454 = { let __t370 = v_V8.clone(); rt::is_cons(&__t370) }; if !rt::is_truthy(interp, &__t454)? { Value::bool(false) } else { let __t455 = { let __t452 = { let __t371 = Value::sym(interp.intern("for")); let __t373 = { let __t372 = v_V8.clone(); rt::hd(&__t372)? }; rt::eq(&__t371, &__t373) }; if !rt::is_truthy(interp, &__t452)? { Value::bool(false) } else { let __t453 = { let __t450 = { let __t375 = { let __t374 = v_V8.clone(); rt::tl(&__t374)? }; rt::is_cons(&__t375) }; if !rt::is_truthy(interp, &__t450)? { Value::bool(false) } else { let __t451 = { let __t448 = { let __t378 = { let __t377 = { let __t376 = v_V8.clone(); rt::tl(&__t376)? }; rt::tl(&__t377)? }; rt::is_cons(&__t378) }; if !rt::is_truthy(interp, &__t448)? { Value::bool(false) } else { let __t449 = { let __t446 = { let __t379 = Value::sym(interp.intern("=")); let __t383 = { let __t382 = { let __t381 = { let __t380 = v_V8.clone(); rt::tl(&__t380)? }; rt::tl(&__t381)? }; rt::hd(&__t382)? }; rt::eq(&__t379, &__t383) }; if !rt::is_truthy(interp, &__t446)? { Value::bool(false) } else { let __t447 = { let __t444 = { let __t387 = { let __t386 = { let __t385 = { let __t384 = v_V8.clone(); rt::tl(&__t384)? }; rt::tl(&__t385)? }; rt::tl(&__t386)? }; rt::is_cons(&__t387) }; if !rt::is_truthy(interp, &__t444)? { Value::bool(false) } else { let __t445 = { let __t442 = { let __t392 = { let __t391 = { let __t390 = { let __t389 = { let __t388 = v_V8.clone(); rt::tl(&__t388)? }; rt::tl(&__t389)? }; rt::tl(&__t390)? }; rt::tl(&__t391)? }; rt::is_cons(&__t392) }; if !rt::is_truthy(interp, &__t442)? { Value::bool(false) } else { let __t443 = { let __t440 = { let __t398 = { let __t397 = { let __t396 = { let __t395 = { let __t394 = { let __t393 = v_V8.clone(); rt::tl(&__t393)? }; rt::tl(&__t394)? }; rt::tl(&__t395)? }; rt::tl(&__t396)? }; rt::tl(&__t397)? }; rt::is_cons(&__t398) }; if !rt::is_truthy(interp, &__t440)? { Value::bool(false) } else { let __t441 = { let __t438 = { let __t405 = { let __t404 = { let __t403 = { let __t402 = { let __t401 = { let __t400 = { let __t399 = v_V8.clone(); rt::tl(&__t399)? }; rt::tl(&__t400)? }; rt::tl(&__t401)? }; rt::tl(&__t402)? }; rt::tl(&__t403)? }; rt::tl(&__t404)? }; rt::is_cons(&__t405) }; if !rt::is_truthy(interp, &__t438)? { Value::bool(false) } else { let __t439 = { let __t436 = { let __t413 = { let __t412 = { let __t411 = { let __t410 = { let __t409 = { let __t408 = { let __t407 = { let __t406 = v_V8.clone(); rt::tl(&__t406)? }; rt::tl(&__t407)? }; rt::tl(&__t408)? }; rt::tl(&__t409)? }; rt::tl(&__t410)? }; rt::tl(&__t411)? }; rt::tl(&__t412)? }; rt::is_cons(&__t413) }; if !rt::is_truthy(interp, &__t436)? { Value::bool(false) } else { let __t437 = { let __t434 = { let __t414 = Value::sym(interp.intern("or")); let __t423 = { let __t422 = { let __t421 = { let __t420 = { let __t419 = { let __t418 = { let __t417 = { let __t416 = { let __t415 = v_V8.clone(); rt::tl(&__t415)? }; rt::tl(&__t416)? }; rt::tl(&__t417)? }; rt::tl(&__t418)? }; rt::tl(&__t419)? }; rt::tl(&__t420)? }; rt::tl(&__t421)? }; rt::hd(&__t422)? }; rt::eq(&__t414, &__t423) }; if !rt::is_truthy(interp, &__t434)? { Value::bool(false) } else { let __t435 = { let __t424 = Value::nil(); let __t433 = { let __t432 = { let __t431 = { let __t430 = { let __t429 = { let __t428 = { let __t427 = { let __t426 = { let __t425 = v_V8.clone(); rt::tl(&__t425)? }; rt::tl(&__t426)? }; rt::tl(&__t427)? }; rt::tl(&__t428)? }; rt::tl(&__t429)? }; rt::tl(&__t430)? }; rt::tl(&__t431)? }; rt::tl(&__t432)? }; rt::eq(&__t424, &__t433) }; Value::bool(rt::is_truthy(interp, &__t435)?) } }; Value::bool(rt::is_truthy(interp, &__t437)?) } }; Value::bool(rt::is_truthy(interp, &__t439)?) } }; Value::bool(rt::is_truthy(interp, &__t441)?) } }; Value::bool(rt::is_truthy(interp, &__t443)?) } }; Value::bool(rt::is_truthy(interp, &__t445)?) } }; Value::bool(rt::is_truthy(interp, &__t447)?) } }; Value::bool(rt::is_truthy(interp, &__t449)?) } }; Value::bool(rt::is_truthy(interp, &__t451)?) } }; Value::bool(rt::is_truthy(interp, &__t453)?) } }; Value::bool(rt::is_truthy(interp, &__t455)?) } }; if match rt::is_truthy(interp, &__t509) { Ok(b) => b, Err(e) => break Err(e), } { { let v_W12 = { rt::make_aot_closure("", 1, move |interp, args| { let v_Z13 = args[0].clone(); Ok({ let v_Z13 = v_Z13.clone(); rt::make_aot_closure("", 1, move |interp, args| { let v_Z14 = args[0].clone(); Ok({ let __t466 = { let __t458 = { let __t456 = v_Z13.clone(); let __t457 = v_Z14.clone(); rt::apply_direct(interp, "occurrences", &[__t456, __t457])? }; let __t459 = Value::int(0i64); rt::gt(&__t458, &__t459)? }; if rt::is_truthy(interp, &__t466)? { { let __t460 = Value::sym(interp.intern("/.")); let __t465 = { let __t461 = v_Z13.clone(); let __t464 = { let __t462 = v_Z14.clone(); let __t463 = Value::nil(); rt::cons(&__t462, &__t463) }; rt::cons(&__t461, &__t464) }; rt::cons(&__t460, &__t465) } } else { v_Z14.clone() } }) }, vec![v_Z13], interp) }) }, Vec::new(), interp) }; break Ok({ let __t467 = Value::sym(interp.intern("maths.lazyfor-or")); let __t508 = { let __t472 = { let __t471 = { let __t470 = { let __t469 = { let __t468 = v_V8.clone(); rt::tl(&__t468)? }; rt::tl(&__t469)? }; rt::tl(&__t470)? }; rt::hd(&__t471)? }; let __t507 = { let __t483 = { let __t476 = { let __t475 = { let __t474 = { let __t473 = v_V8.clone(); rt::tl(&__t473)? }; rt::hd(&__t474)? }; rt::apply_value(interp, v_W12.clone(), &[__t475])? }; let __t482 = { let __t481 = { let __t480 = { let __t479 = { let __t478 = { let __t477 = v_V8.clone(); rt::tl(&__t477)? }; rt::tl(&__t478)? }; rt::tl(&__t479)? }; rt::tl(&__t480)? }; rt::hd(&__t481)? }; rt::apply_value(interp, __t476, &[__t482])? }; let __t506 = { let __t495 = { let __t487 = { let __t486 = { let __t485 = { let __t484 = v_V8.clone(); rt::tl(&__t484)? }; rt::hd(&__t485)? }; rt::apply_value(interp, v_W12.clone(), &[__t486])? }; let __t494 = { let __t493 = { let __t492 = { let __t491 = { let __t490 = { let __t489 = { let __t488 = v_V8.clone(); rt::tl(&__t488)? }; rt::tl(&__t489)? }; rt::tl(&__t490)? }; rt::tl(&__t491)? }; rt::tl(&__t492)? }; rt::hd(&__t493)? }; rt::apply_value(interp, __t487, &[__t494])? }; let __t505 = { let __t503 = { let __t502 = { let __t501 = { let __t500 = { let __t499 = { let __t498 = { let __t497 = { let __t496 = v_V8.clone(); rt::tl(&__t496)? }; rt::tl(&__t497)? }; rt::tl(&__t498)? }; rt::tl(&__t499)? }; rt::tl(&__t500)? }; rt::tl(&__t501)? }; rt::hd(&__t502)? }; let __t504 = Value::nil(); rt::cons(&__t503, &__t504) }; rt::cons(&__t495, &__t505) }; rt::cons(&__t483, &__t506) }; rt::cons(&__t472, &__t507) }; rt::cons(&__t467, &__t508) }); } } else { { let __t369 = { let __t317 = { let __t245 = v_V8.clone(); rt::is_cons(&__t245) }; if !rt::is_truthy(interp, &__t317)? { Value::bool(false) } else { let __t318 = { let __t315 = { let __t246 = Value::sym(interp.intern("for")); let __t248 = { let __t247 = v_V8.clone(); rt::hd(&__t247)? }; rt::eq(&__t246, &__t248) }; if !rt::is_truthy(interp, &__t315)? { Value::bool(false) } else { let __t316 = { let __t313 = { let __t250 = { let __t249 = v_V8.clone(); rt::tl(&__t249)? }; rt::is_cons(&__t250) }; if !rt::is_truthy(interp, &__t313)? { Value::bool(false) } else { let __t314 = { let __t311 = { let __t253 = { let __t252 = { let __t251 = v_V8.clone(); rt::tl(&__t251)? }; rt::tl(&__t252)? }; rt::is_cons(&__t253) }; if !rt::is_truthy(interp, &__t311)? { Value::bool(false) } else { let __t312 = { let __t309 = { let __t254 = Value::sym(interp.intern("=")); let __t258 = { let __t257 = { let __t256 = { let __t255 = v_V8.clone(); rt::tl(&__t255)? }; rt::tl(&__t256)? }; rt::hd(&__t257)? }; rt::eq(&__t254, &__t258) }; if !rt::is_truthy(interp, &__t309)? { Value::bool(false) } else { let __t310 = { let __t307 = { let __t262 = { let __t261 = { let __t260 = { let __t259 = v_V8.clone(); rt::tl(&__t259)? }; rt::tl(&__t260)? }; rt::tl(&__t261)? }; rt::is_cons(&__t262) }; if !rt::is_truthy(interp, &__t307)? { Value::bool(false) } else { let __t308 = { let __t305 = { let __t267 = { let __t266 = { let __t265 = { let __t264 = { let __t263 = v_V8.clone(); rt::tl(&__t263)? }; rt::tl(&__t264)? }; rt::tl(&__t265)? }; rt::tl(&__t266)? }; rt::is_cons(&__t267) }; if !rt::is_truthy(interp, &__t305)? { Value::bool(false) } else { let __t306 = { let __t303 = { let __t273 = { let __t272 = { let __t271 = { let __t270 = { let __t269 = { let __t268 = v_V8.clone(); rt::tl(&__t268)? }; rt::tl(&__t269)? }; rt::tl(&__t270)? }; rt::tl(&__t271)? }; rt::tl(&__t272)? }; rt::is_cons(&__t273) }; if !rt::is_truthy(interp, &__t303)? { Value::bool(false) } else { let __t304 = { let __t301 = { let __t280 = { let __t279 = { let __t278 = { let __t277 = { let __t276 = { let __t275 = { let __t274 = v_V8.clone(); rt::tl(&__t274)? }; rt::tl(&__t275)? }; rt::tl(&__t276)? }; rt::tl(&__t277)? }; rt::tl(&__t278)? }; rt::tl(&__t279)? }; rt::is_cons(&__t280) }; if !rt::is_truthy(interp, &__t301)? { Value::bool(false) } else { let __t302 = { let __t299 = { let __t288 = { let __t287 = { let __t286 = { let __t285 = { let __t284 = { let __t283 = { let __t282 = { let __t281 = v_V8.clone(); rt::tl(&__t281)? }; rt::tl(&__t282)? }; rt::tl(&__t283)? }; rt::tl(&__t284)? }; rt::tl(&__t285)? }; rt::tl(&__t286)? }; rt::tl(&__t287)? }; rt::is_cons(&__t288) }; if !rt::is_truthy(interp, &__t299)? { Value::bool(false) } else { let __t300 = { let __t289 = Value::nil(); let __t298 = { let __t297 = { let __t296 = { let __t295 = { let __t294 = { let __t293 = { let __t292 = { let __t291 = { let __t290 = v_V8.clone(); rt::tl(&__t290)? }; rt::tl(&__t291)? }; rt::tl(&__t292)? }; rt::tl(&__t293)? }; rt::tl(&__t294)? }; rt::tl(&__t295)? }; rt::tl(&__t296)? }; rt::tl(&__t297)? }; rt::eq(&__t289, &__t298) }; Value::bool(rt::is_truthy(interp, &__t300)?) } }; Value::bool(rt::is_truthy(interp, &__t302)?) } }; Value::bool(rt::is_truthy(interp, &__t304)?) } }; Value::bool(rt::is_truthy(interp, &__t306)?) } }; Value::bool(rt::is_truthy(interp, &__t308)?) } }; Value::bool(rt::is_truthy(interp, &__t310)?) } }; Value::bool(rt::is_truthy(interp, &__t312)?) } }; Value::bool(rt::is_truthy(interp, &__t314)?) } }; Value::bool(rt::is_truthy(interp, &__t316)?) } }; Value::bool(rt::is_truthy(interp, &__t318)?) } }; if match rt::is_truthy(interp, &__t369) { Ok(b) => b, Err(e) => break Err(e), } { { let v_W15 = { rt::make_aot_closure("", 1, move |interp, args| { let v_Z16 = args[0].clone(); Ok({ let v_Z16 = v_Z16.clone(); rt::make_aot_closure("", 1, move |interp, args| { let v_Z17 = args[0].clone(); Ok({ let __t329 = { let __t321 = { let __t319 = v_Z16.clone(); let __t320 = v_Z17.clone(); rt::apply_direct(interp, "occurrences", &[__t319, __t320])? }; let __t322 = Value::int(0i64); rt::gt(&__t321, &__t322)? }; if rt::is_truthy(interp, &__t329)? { { let __t323 = Value::sym(interp.intern("/.")); let __t328 = { let __t324 = v_Z16.clone(); let __t327 = { let __t325 = v_Z17.clone(); let __t326 = Value::nil(); rt::cons(&__t325, &__t326) }; rt::cons(&__t324, &__t327) }; rt::cons(&__t323, &__t328) } } else { v_Z17.clone() } }) }, vec![v_Z16], interp) }) }, Vec::new(), interp) }; break Ok({ let __t330 = Value::sym(interp.intern("for")); let __t368 = { let __t335 = { let __t334 = { let __t333 = { let __t332 = { let __t331 = v_V8.clone(); rt::tl(&__t331)? }; rt::tl(&__t332)? }; rt::tl(&__t333)? }; rt::hd(&__t334)? }; let __t367 = { let __t346 = { let __t339 = { let __t338 = { let __t337 = { let __t336 = v_V8.clone(); rt::tl(&__t336)? }; rt::hd(&__t337)? }; rt::apply_value(interp, v_W15.clone(), &[__t338])? }; let __t345 = { let __t344 = { let __t343 = { let __t342 = { let __t341 = { let __t340 = v_V8.clone(); rt::tl(&__t340)? }; rt::tl(&__t341)? }; rt::tl(&__t342)? }; rt::tl(&__t343)? }; rt::hd(&__t344)? }; rt::apply_value(interp, __t339, &[__t345])? }; let __t366 = { let __t358 = { let __t350 = { let __t349 = { let __t348 = { let __t347 = v_V8.clone(); rt::tl(&__t347)? }; rt::hd(&__t348)? }; rt::apply_value(interp, v_W15.clone(), &[__t349])? }; let __t357 = { let __t356 = { let __t355 = { let __t354 = { let __t353 = { let __t352 = { let __t351 = v_V8.clone(); rt::tl(&__t351)? }; rt::tl(&__t352)? }; rt::tl(&__t353)? }; rt::tl(&__t354)? }; rt::tl(&__t355)? }; rt::hd(&__t356)? }; rt::apply_value(interp, __t350, &[__t357])? }; let __t365 = { let __t364 = { let __t363 = { let __t362 = { let __t361 = { let __t360 = { let __t359 = v_V8.clone(); rt::tl(&__t359)? }; rt::tl(&__t360)? }; rt::tl(&__t361)? }; rt::tl(&__t362)? }; rt::tl(&__t363)? }; rt::tl(&__t364)? }; rt::cons(&__t358, &__t365) }; rt::cons(&__t346, &__t366) }; rt::cons(&__t335, &__t367) }; rt::cons(&__t330, &__t368) }); } } else { { let __t244 = { let __t183 = { let __t122 = v_V8.clone(); rt::is_cons(&__t122) }; if !rt::is_truthy(interp, &__t183)? { Value::bool(false) } else { let __t184 = { let __t181 = { let __t123 = Value::sym(interp.intern("for")); let __t125 = { let __t124 = v_V8.clone(); rt::hd(&__t124)? }; rt::eq(&__t123, &__t125) }; if !rt::is_truthy(interp, &__t181)? { Value::bool(false) } else { let __t182 = { let __t179 = { let __t127 = { let __t126 = v_V8.clone(); rt::tl(&__t126)? }; rt::is_cons(&__t127) }; if !rt::is_truthy(interp, &__t179)? { Value::bool(false) } else { let __t180 = { let __t177 = { let __t130 = { let __t129 = { let __t128 = v_V8.clone(); rt::tl(&__t128)? }; rt::tl(&__t129)? }; rt::is_cons(&__t130) }; if !rt::is_truthy(interp, &__t177)? { Value::bool(false) } else { let __t178 = { let __t175 = { let __t131 = Value::sym(interp.intern("=")); let __t135 = { let __t134 = { let __t133 = { let __t132 = v_V8.clone(); rt::tl(&__t132)? }; rt::tl(&__t133)? }; rt::hd(&__t134)? }; rt::eq(&__t131, &__t135) }; if !rt::is_truthy(interp, &__t175)? { Value::bool(false) } else { let __t176 = { let __t173 = { let __t139 = { let __t138 = { let __t137 = { let __t136 = v_V8.clone(); rt::tl(&__t136)? }; rt::tl(&__t137)? }; rt::tl(&__t138)? }; rt::is_cons(&__t139) }; if !rt::is_truthy(interp, &__t173)? { Value::bool(false) } else { let __t174 = { let __t171 = { let __t144 = { let __t143 = { let __t142 = { let __t141 = { let __t140 = v_V8.clone(); rt::tl(&__t140)? }; rt::tl(&__t141)? }; rt::tl(&__t142)? }; rt::tl(&__t143)? }; rt::is_cons(&__t144) }; if !rt::is_truthy(interp, &__t171)? { Value::bool(false) } else { let __t172 = { let __t169 = { let __t150 = { let __t149 = { let __t148 = { let __t147 = { let __t146 = { let __t145 = v_V8.clone(); rt::tl(&__t145)? }; rt::tl(&__t146)? }; rt::tl(&__t147)? }; rt::tl(&__t148)? }; rt::tl(&__t149)? }; rt::is_cons(&__t150) }; if !rt::is_truthy(interp, &__t169)? { Value::bool(false) } else { let __t170 = { let __t167 = { let __t157 = { let __t156 = { let __t155 = { let __t154 = { let __t153 = { let __t152 = { let __t151 = v_V8.clone(); rt::tl(&__t151)? }; rt::tl(&__t152)? }; rt::tl(&__t153)? }; rt::tl(&__t154)? }; rt::tl(&__t155)? }; rt::tl(&__t156)? }; rt::is_cons(&__t157) }; if !rt::is_truthy(interp, &__t167)? { Value::bool(false) } else { let __t168 = { let __t158 = Value::nil(); let __t166 = { let __t165 = { let __t164 = { let __t163 = { let __t162 = { let __t161 = { let __t160 = { let __t159 = v_V8.clone(); rt::tl(&__t159)? }; rt::tl(&__t160)? }; rt::tl(&__t161)? }; rt::tl(&__t162)? }; rt::tl(&__t163)? }; rt::tl(&__t164)? }; rt::tl(&__t165)? }; rt::eq(&__t158, &__t166) }; Value::bool(rt::is_truthy(interp, &__t168)?) } }; Value::bool(rt::is_truthy(interp, &__t170)?) } }; Value::bool(rt::is_truthy(interp, &__t172)?) } }; Value::bool(rt::is_truthy(interp, &__t174)?) } }; Value::bool(rt::is_truthy(interp, &__t176)?) } }; Value::bool(rt::is_truthy(interp, &__t178)?) } }; Value::bool(rt::is_truthy(interp, &__t180)?) } }; Value::bool(rt::is_truthy(interp, &__t182)?) } }; Value::bool(rt::is_truthy(interp, &__t184)?) } }; if match rt::is_truthy(interp, &__t244) { Ok(b) => b, Err(e) => break Err(e), } { { let v_W18 = { rt::make_aot_closure("", 1, move |interp, args| { let v_Z19 = args[0].clone(); Ok({ let v_Z19 = v_Z19.clone(); rt::make_aot_closure("", 1, move |interp, args| { let v_Z20 = args[0].clone(); Ok({ let __t195 = { let __t187 = { let __t185 = v_Z19.clone(); let __t186 = v_Z20.clone(); rt::apply_direct(interp, "occurrences", &[__t185, __t186])? }; let __t188 = Value::int(0i64); rt::gt(&__t187, &__t188)? }; if rt::is_truthy(interp, &__t195)? { { let __t189 = Value::sym(interp.intern("/.")); let __t194 = { let __t190 = v_Z19.clone(); let __t193 = { let __t191 = v_Z20.clone(); let __t192 = Value::nil(); rt::cons(&__t191, &__t192) }; rt::cons(&__t190, &__t193) }; rt::cons(&__t189, &__t194) } } else { v_Z20.clone() } }) }, vec![v_Z19], interp) }) }, Vec::new(), interp) }; break Ok({ let __t196 = Value::sym(interp.intern("for")); let __t243 = { let __t201 = { let __t200 = { let __t199 = { let __t198 = { let __t197 = v_V8.clone(); rt::tl(&__t197)? }; rt::tl(&__t198)? }; rt::tl(&__t199)? }; rt::hd(&__t200)? }; let __t242 = { let __t212 = { let __t205 = { let __t204 = { let __t203 = { let __t202 = v_V8.clone(); rt::tl(&__t202)? }; rt::hd(&__t203)? }; rt::apply_value(interp, v_W18.clone(), &[__t204])? }; let __t211 = { let __t210 = { let __t209 = { let __t208 = { let __t207 = { let __t206 = v_V8.clone(); rt::tl(&__t206)? }; rt::tl(&__t207)? }; rt::tl(&__t208)? }; rt::tl(&__t209)? }; rt::hd(&__t210)? }; rt::apply_value(interp, __t205, &[__t211])? }; let __t241 = { let __t224 = { let __t216 = { let __t215 = { let __t214 = { let __t213 = v_V8.clone(); rt::tl(&__t213)? }; rt::hd(&__t214)? }; rt::apply_value(interp, v_W18.clone(), &[__t215])? }; let __t223 = { let __t222 = { let __t221 = { let __t220 = { let __t219 = { let __t218 = { let __t217 = v_V8.clone(); rt::tl(&__t217)? }; rt::tl(&__t218)? }; rt::tl(&__t219)? }; rt::tl(&__t220)? }; rt::tl(&__t221)? }; rt::hd(&__t222)? }; rt::apply_value(interp, __t216, &[__t223])? }; let __t240 = { let __t232 = { let __t231 = { let __t230 = { let __t229 = { let __t228 = { let __t227 = { let __t226 = { let __t225 = v_V8.clone(); rt::tl(&__t225)? }; rt::tl(&__t226)? }; rt::tl(&__t227)? }; rt::tl(&__t228)? }; rt::tl(&__t229)? }; rt::tl(&__t230)? }; rt::hd(&__t231)? }; let __t239 = { let __t237 = { let __t233 = Value::sym(interp.intern("fn")); let __t236 = { let __t234 = Value::sym(interp.intern("do")); let __t235 = Value::nil(); rt::cons(&__t234, &__t235) }; rt::cons(&__t233, &__t236) }; let __t238 = Value::nil(); rt::cons(&__t237, &__t238) }; rt::cons(&__t232, &__t239) }; rt::cons(&__t224, &__t240) }; rt::cons(&__t212, &__t241) }; rt::cons(&__t201, &__t242) }; rt::cons(&__t196, &__t243) }); } } else { { let __t121 = { let __t63 = { let __t12 = v_V8.clone(); rt::is_cons(&__t12) }; if !rt::is_truthy(interp, &__t63)? { Value::bool(false) } else { let __t64 = { let __t61 = { let __t13 = Value::sym(interp.intern("for")); let __t15 = { let __t14 = v_V8.clone(); rt::hd(&__t14)? }; rt::eq(&__t13, &__t15) }; if !rt::is_truthy(interp, &__t61)? { Value::bool(false) } else { let __t62 = { let __t59 = { let __t17 = { let __t16 = v_V8.clone(); rt::tl(&__t16)? }; rt::is_cons(&__t17) }; if !rt::is_truthy(interp, &__t59)? { Value::bool(false) } else { let __t60 = { let __t57 = { let __t20 = { let __t19 = { let __t18 = v_V8.clone(); rt::tl(&__t18)? }; rt::tl(&__t19)? }; rt::is_cons(&__t20) }; if !rt::is_truthy(interp, &__t57)? { Value::bool(false) } else { let __t58 = { let __t55 = { let __t21 = Value::sym(interp.intern("=")); let __t25 = { let __t24 = { let __t23 = { let __t22 = v_V8.clone(); rt::tl(&__t22)? }; rt::tl(&__t23)? }; rt::hd(&__t24)? }; rt::eq(&__t21, &__t25) }; if !rt::is_truthy(interp, &__t55)? { Value::bool(false) } else { let __t56 = { let __t53 = { let __t29 = { let __t28 = { let __t27 = { let __t26 = v_V8.clone(); rt::tl(&__t26)? }; rt::tl(&__t27)? }; rt::tl(&__t28)? }; rt::is_cons(&__t29) }; if !rt::is_truthy(interp, &__t53)? { Value::bool(false) } else { let __t54 = { let __t51 = { let __t34 = { let __t33 = { let __t32 = { let __t31 = { let __t30 = v_V8.clone(); rt::tl(&__t30)? }; rt::tl(&__t31)? }; rt::tl(&__t32)? }; rt::tl(&__t33)? }; rt::is_cons(&__t34) }; if !rt::is_truthy(interp, &__t51)? { Value::bool(false) } else { let __t52 = { let __t49 = { let __t40 = { let __t39 = { let __t38 = { let __t37 = { let __t36 = { let __t35 = v_V8.clone(); rt::tl(&__t35)? }; rt::tl(&__t36)? }; rt::tl(&__t37)? }; rt::tl(&__t38)? }; rt::tl(&__t39)? }; rt::is_cons(&__t40) }; if !rt::is_truthy(interp, &__t49)? { Value::bool(false) } else { let __t50 = { let __t41 = Value::nil(); let __t48 = { let __t47 = { let __t46 = { let __t45 = { let __t44 = { let __t43 = { let __t42 = v_V8.clone(); rt::tl(&__t42)? }; rt::tl(&__t43)? }; rt::tl(&__t44)? }; rt::tl(&__t45)? }; rt::tl(&__t46)? }; rt::tl(&__t47)? }; rt::eq(&__t41, &__t48) }; Value::bool(rt::is_truthy(interp, &__t50)?) } }; Value::bool(rt::is_truthy(interp, &__t52)?) } }; Value::bool(rt::is_truthy(interp, &__t54)?) } }; Value::bool(rt::is_truthy(interp, &__t56)?) } }; Value::bool(rt::is_truthy(interp, &__t58)?) } }; Value::bool(rt::is_truthy(interp, &__t60)?) } }; Value::bool(rt::is_truthy(interp, &__t62)?) } }; Value::bool(rt::is_truthy(interp, &__t64)?) } }; if match rt::is_truthy(interp, &__t121) { Ok(b) => b, Err(e) => break Err(e), } { { let v_W21 = { rt::make_aot_closure("", 1, move |interp, args| { let v_Z22 = args[0].clone(); Ok({ let v_Z22 = v_Z22.clone(); rt::make_aot_closure("", 1, move |interp, args| { let v_Z23 = args[0].clone(); Ok({ let __t75 = { let __t67 = { let __t65 = v_Z22.clone(); let __t66 = v_Z23.clone(); rt::apply_direct(interp, "occurrences", &[__t65, __t66])? }; let __t68 = Value::int(0i64); rt::gt(&__t67, &__t68)? }; if rt::is_truthy(interp, &__t75)? { { let __t69 = Value::sym(interp.intern("/.")); let __t74 = { let __t70 = v_Z22.clone(); let __t73 = { let __t71 = v_Z23.clone(); let __t72 = Value::nil(); rt::cons(&__t71, &__t72) }; rt::cons(&__t70, &__t73) }; rt::cons(&__t69, &__t74) } } else { v_Z23.clone() } }) }, vec![v_Z22], interp) }) }, Vec::new(), interp) }; break Ok({ let __t76 = Value::sym(interp.intern("for")); let __t120 = { let __t81 = { let __t80 = { let __t79 = { let __t78 = { let __t77 = v_V8.clone(); rt::tl(&__t77)? }; rt::tl(&__t78)? }; rt::tl(&__t79)? }; rt::hd(&__t80)? }; let __t119 = { let __t92 = { let __t85 = { let __t84 = { let __t83 = { let __t82 = v_V8.clone(); rt::tl(&__t82)? }; rt::hd(&__t83)? }; rt::apply_value(interp, v_W21.clone(), &[__t84])? }; let __t91 = { let __t90 = { let __t89 = { let __t88 = { let __t87 = { let __t86 = v_V8.clone(); rt::tl(&__t86)? }; rt::tl(&__t87)? }; rt::tl(&__t88)? }; rt::tl(&__t89)? }; rt::hd(&__t90)? }; rt::apply_value(interp, __t85, &[__t91])? }; let __t118 = { let __t104 = { let __t93 = Value::sym(interp.intern("/.")); let __t103 = { let __t96 = { let __t95 = { let __t94 = v_V8.clone(); rt::tl(&__t94)? }; rt::hd(&__t95)? }; let __t102 = { let __t101 = { let __t100 = { let __t99 = { let __t98 = { let __t97 = v_V8.clone(); rt::tl(&__t97)? }; rt::tl(&__t98)? }; rt::tl(&__t99)? }; rt::tl(&__t100)? }; rt::tl(&__t101)? }; rt::cons(&__t96, &__t102) }; rt::cons(&__t93, &__t103) }; let __t117 = { let __t109 = { let __t105 = Value::sym(interp.intern("+")); let __t108 = { let __t106 = Value::int(1i64); let __t107 = Value::nil(); rt::cons(&__t106, &__t107) }; rt::cons(&__t105, &__t108) }; let __t116 = { let __t114 = { let __t110 = Value::sym(interp.intern("fn")); let __t113 = { let __t111 = Value::sym(interp.intern("do")); let __t112 = Value::nil(); rt::cons(&__t111, &__t112) }; rt::cons(&__t110, &__t113) }; let __t115 = Value::nil(); rt::cons(&__t114, &__t115) }; rt::cons(&__t109, &__t116) }; rt::cons(&__t104, &__t117) }; rt::cons(&__t92, &__t118) }; rt::cons(&__t81, &__t119) }; rt::cons(&__t76, &__t120) }); } } else { { let __t11 = Value::bool(true); if match rt::is_truthy(interp, &__t11) { Ok(b) => b, Err(e) => break Err(e), } { break Ok(v_V8.clone()); } else { break Err(ShenError::new("cond: no clause matched")); } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_maths_x2e_maths_x2d_macro(interp: &mut Interp) { - interp.register_native("maths.maths-macro", 1, aot_maths_x2e_maths_x2d_macro); - interp.register_aot_direct("maths.maths-macro", aot_maths_x2e_maths_x2d_macro); -} - -/// AOT-compiled from KL `(defun set-tolerance ...)` -pub fn aot_set_x2d_tolerance(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "set-tolerance: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V249 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1203 = Value::sym(interp.intern("maths.*tolerance*")); - let __t1204 = v_V249.clone(); - rt::apply_direct(interp, "set", &[__t1203, __t1204])? - }); - } -} - -fn install_set_x2d_tolerance(interp: &mut Interp) { - interp.register_native("set-tolerance", 1, aot_set_x2d_tolerance); - interp.register_aot_direct("set-tolerance", aot_set_x2d_tolerance); -} - -/// AOT-compiled from KL `(defun tolerance ...)` -pub fn aot_tolerance(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "tolerance: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1205 = Value::sym(interp.intern("maths.*tolerance*")); - rt::apply_direct(interp, "value", &[__t1205])? - }); - } -} - -fn install_tolerance(interp: &mut Interp) { - interp.register_native("tolerance", 0, aot_tolerance); - interp.register_aot_direct("tolerance", aot_tolerance); -} - -/// AOT-compiled from KL `(defun sq ...)` -pub fn aot_sq(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "sq: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V251 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1206 = v_V251.clone(); - let __t1207 = v_V251.clone(); - rt::mul(&__t1206, &__t1207)? - }); - } -} - -fn install_sq(interp: &mut Interp) { - interp.register_native("sq", 1, aot_sq); - interp.register_aot_direct("sq", aot_sq); -} - -/// AOT-compiled from KL `(defun cube ...)` -pub fn aot_cube(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "cube: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V253 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1208 = v_V253.clone(); - let __t1211 = { - let __t1209 = v_V253.clone(); - let __t1210 = v_V253.clone(); - rt::mul(&__t1209, &__t1210)? - }; - rt::mul(&__t1208, &__t1211)? - }); - } -} - -fn install_cube(interp: &mut Interp) { - interp.register_native("cube", 1, aot_cube); - interp.register_aot_direct("cube", aot_cube); -} - -/// AOT-compiled from KL `(defun for ...)` -pub fn aot_for(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 5 { - return Err(ShenError::new(format!( - "for: expected 5 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V255 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V256 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V257 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V258 = args[3].clone(); - #[allow(unused_mut)] - let mut v_V259 = args[4].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1213 = { - let __t1212 = v_V255.clone(); - rt::apply_value(interp, v_V258.clone(), &[__t1212])? - }; - let __t1214 = v_V256.clone(); - let __t1215 = v_V257.clone(); - let __t1216 = v_V258.clone(); - let __t1217 = v_V259.clone(); - let __t1219 = { - let __t1218 = v_V255.clone(); - rt::apply_value(interp, v_V257.clone(), &[__t1218])? - }; - rt::apply_direct( - interp, - "maths.for-h", - &[__t1213, __t1214, __t1215, __t1216, __t1217, __t1219], - )? - }); - } -} - -fn install_for(interp: &mut Interp) { - interp.register_native("for", 5, aot_for); - interp.register_aot_direct("for", aot_for); -} - -/// AOT-compiled from KL `(defun maths.for-h ...)` -pub fn aot_maths_x2e_for_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 6 { - return Err(ShenError::new(format!( - "maths.for-h: expected 6 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V268 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V269 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V270 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V271 = args[3].clone(); - #[allow(unused_mut)] - let mut v_V272 = args[4].clone(); - #[allow(unused_mut)] - let mut v_V273 = args[5].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1234 = { - let __t1233 = { - let __t1232 = v_V268.clone(); - rt::apply_value(interp, v_V269.clone(), &[__t1232])? - }; - rt::apply_direct(interp, "not", &[__t1233])? - }; - if match rt::is_truthy(interp, &__t1234) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V273.clone()); - } else { - { - let __t1231 = Value::bool(true); - if match rt::is_truthy(interp, &__t1231) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1221 = { - let __t1220 = v_V268.clone(); - rt::apply_value(interp, v_V271.clone(), &[__t1220])? - }; - let __t1222 = v_V269.clone(); - let __t1223 = v_V270.clone(); - let __t1224 = v_V271.clone(); - let __t1225 = v_V272.clone(); - let __t1230 = { - let __t1227 = { - let __t1226 = v_V273.clone(); - rt::apply_value(interp, v_V272.clone(), &[__t1226])? - }; - let __t1229 = { - let __t1228 = v_V268.clone(); - rt::apply_value(interp, v_V270.clone(), &[__t1228])? - }; - rt::apply_value(interp, __t1227, &[__t1229])? - }; - v_V268 = __t1221; - v_V269 = __t1222; - v_V270 = __t1223; - v_V271 = __t1224; - v_V272 = __t1225; - v_V273 = __t1230; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_maths_x2e_for_x2d_h(interp: &mut Interp) { - interp.register_native("maths.for-h", 6, aot_maths_x2e_for_x2d_h); - interp.register_aot_direct("maths.for-h", aot_maths_x2e_for_x2d_h); -} - -/// AOT-compiled from KL `(defun maths.lazyfor-and ...)` -pub fn aot_maths_x2e_lazyfor_x2d_and(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "maths.lazyfor-and: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V290 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V291 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V292 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V293 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1245 = { - let __t1244 = { - let __t1243 = v_V290.clone(); - rt::apply_value(interp, v_V291.clone(), &[__t1243])? - }; - rt::apply_direct(interp, "not", &[__t1244])? - }; - if match rt::is_truthy(interp, &__t1245) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t1242 = { - let __t1236 = v_V290.clone(); - rt::apply_value(interp, v_V292.clone(), &[__t1236])? - }; - if match rt::is_truthy(interp, &__t1242) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1238 = { - let __t1237 = v_V290.clone(); - rt::apply_value(interp, v_V293.clone(), &[__t1237])? - }; - let __t1239 = v_V291.clone(); - let __t1240 = v_V292.clone(); - let __t1241 = v_V293.clone(); - v_V290 = __t1238; - v_V291 = __t1239; - v_V292 = __t1240; - v_V293 = __t1241; - continue; - } - } else { - { - let __t1235 = Value::bool(true); - if match rt::is_truthy(interp, &__t1235) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_maths_x2e_lazyfor_x2d_and(interp: &mut Interp) { - interp.register_native("maths.lazyfor-and", 4, aot_maths_x2e_lazyfor_x2d_and); - interp.register_aot_direct("maths.lazyfor-and", aot_maths_x2e_lazyfor_x2d_and); -} - -/// AOT-compiled from KL `(defun maths.lazyfor-or ...)` -pub fn aot_maths_x2e_lazyfor_x2d_or(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "maths.lazyfor-or: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V300 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V301 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V302 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V303 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1256 = { - let __t1255 = { - let __t1254 = v_V300.clone(); - rt::apply_value(interp, v_V301.clone(), &[__t1254])? - }; - rt::apply_direct(interp, "not", &[__t1255])? - }; - if match rt::is_truthy(interp, &__t1256) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t1253 = { - let __t1252 = v_V300.clone(); - rt::apply_value(interp, v_V302.clone(), &[__t1252])? - }; - if match rt::is_truthy(interp, &__t1253) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t1251 = Value::bool(true); - if match rt::is_truthy(interp, &__t1251) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1247 = { - let __t1246 = v_V300.clone(); - rt::apply_value(interp, v_V303.clone(), &[__t1246])? - }; - let __t1248 = v_V301.clone(); - let __t1249 = v_V302.clone(); - let __t1250 = v_V303.clone(); - v_V300 = __t1247; - v_V301 = __t1248; - v_V302 = __t1249; - v_V303 = __t1250; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_maths_x2e_lazyfor_x2d_or(interp: &mut Interp) { - interp.register_native("maths.lazyfor-or", 4, aot_maths_x2e_lazyfor_x2d_or); - interp.register_aot_direct("maths.lazyfor-or", aot_maths_x2e_lazyfor_x2d_or); -} - -/// AOT-compiled from KL `(defun max ...)` -pub fn aot_max(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "max: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V310 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V311 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1260 = { - let __t1258 = v_V311.clone(); - let __t1259 = v_V310.clone(); - rt::gt(&__t1258, &__t1259)? - }; - if match rt::is_truthy(interp, &__t1260) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V311.clone()); - } else { - { - let __t1257 = Value::bool(true); - if match rt::is_truthy(interp, &__t1257) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V310.clone()); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_max(interp: &mut Interp) { - interp.register_native("max", 2, aot_max); - interp.register_aot_direct("max", aot_max); -} - -/// AOT-compiled from KL `(defun expt ...)` -pub fn aot_expt(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "expt: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V320 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V321 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V322 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1263 = { - let __t1261 = v_V321.clone(); - let __t1262 = Value::int(0i64); - rt::eq(&__t1261, &__t1262) - }; - if match rt::is_truthy(interp, &__t1263) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(1i64)); - } else { - { - let __t1265 = { - let __t1264 = v_V321.clone(); - rt::apply_direct(interp, "positive?", &[__t1264])? - }; - if match rt::is_truthy(interp, &__t1265) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1266 = v_V320.clone(); - let __t1269 = { - let __t1267 = v_V321.clone(); - let __t1268 = Value::int(1i64); - rt::apply_direct(interp, "maths.n->r", &[__t1267, __t1268])? - }; - let __t1270 = v_V322.clone(); - rt::apply_direct(interp, "maths.expt-h", &[__t1266, __t1269, __t1270])? - }); - } else { - break Ok({ - let __t1271 = Value::int(1i64); - let __t1278 = { - let __t1272 = v_V320.clone(); - let __t1276 = { - let __t1274 = { - let __t1273 = v_V321.clone(); - rt::apply_direct(interp, "~", &[__t1273])? - }; - let __t1275 = Value::int(1i64); - rt::apply_direct(interp, "maths.n->r", &[__t1274, __t1275])? - }; - let __t1277 = v_V322.clone(); - rt::apply_direct( - interp, - "maths.expt-h", - &[__t1272, __t1276, __t1277], - )? - }; - rt::div(&__t1271, &__t1278)? - }); - } - } - } - } - } -} - -fn install_expt(interp: &mut Interp) { - interp.register_native("expt", 3, aot_expt); - interp.register_aot_direct("expt", aot_expt); -} - -/// AOT-compiled from KL `(defun maths.n->r ...)` -pub fn aot_maths_x2e_n_x2d__x3e_r(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "maths.n->r: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V326 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V327 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1289 = { - let __t1286 = v_V326.clone(); - rt::apply_direct(interp, "integer?", &[__t1286])? - }; - if match rt::is_truthy(interp, &__t1289) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1287 = v_V326.clone(); - let __t1288 = v_V327.clone(); - rt::apply_direct(interp, "@p", &[__t1287, __t1288])? - }); - } else { - { - let __t1285 = Value::bool(true); - if match rt::is_truthy(interp, &__t1285) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1281 = { - let __t1279 = v_V326.clone(); - let __t1280 = Value::int(10i64); - rt::mul(&__t1279, &__t1280)? - }; - let __t1284 = { - let __t1282 = v_V327.clone(); - let __t1283 = Value::int(10i64); - rt::mul(&__t1282, &__t1283)? - }; - v_V326 = __t1281; - v_V327 = __t1284; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_maths_x2e_n_x2d__x3e_r(interp: &mut Interp) { - interp.register_native("maths.n->r", 2, aot_maths_x2e_n_x2d__x3e_r); - interp.register_aot_direct("maths.n->r", aot_maths_x2e_n_x2d__x3e_r); -} - -/// AOT-compiled from KL `(defun maths.expt-h ...)` -pub fn aot_maths_x2e_expt_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "maths.expt-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V330 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V331 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V332 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1300 = { - let __t1292 = v_V331.clone(); - rt::apply_direct(interp, "tuple?", &[__t1292])? - }; - if match rt::is_truthy(interp, &__t1300) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1297 = { - let __t1293 = v_V330.clone(); - let __t1295 = { - let __t1294 = v_V331.clone(); - rt::apply_direct(interp, "snd", &[__t1294])? - }; - let __t1296 = v_V332.clone(); - rt::apply_direct(interp, "nthrt", &[__t1293, __t1295, __t1296])? - }; - let __t1299 = { - let __t1298 = v_V331.clone(); - rt::apply_direct(interp, "fst", &[__t1298])? - }; - rt::apply_direct(interp, "power", &[__t1297, __t1299])? - }); - } else { - { - let __t1291 = Value::bool(true); - if match rt::is_truthy(interp, &__t1291) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1290 = Value::sym(interp.intern("maths.expt-h")); - rt::apply_direct(interp, "shen.f-error", &[__t1290])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_maths_x2e_expt_x2d_h(interp: &mut Interp) { - interp.register_native("maths.expt-h", 3, aot_maths_x2e_expt_x2d_h); - interp.register_aot_direct("maths.expt-h", aot_maths_x2e_expt_x2d_h); -} - -/// AOT-compiled from KL `(defun gcd ...)` -pub fn aot_gcd(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "gcd: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V336 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V337 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1305 = { - let __t1303 = { - let __t1301 = v_V336.clone(); - rt::apply_direct(interp, "integer?", &[__t1301])? - }; - if !rt::is_truthy(interp, &__t1303)? { - Value::bool(false) - } else { - let __t1304 = { - let __t1302 = v_V337.clone(); - rt::apply_direct(interp, "integer?", &[__t1302])? - }; - Value::bool(rt::is_truthy(interp, &__t1304)?) - } - }; - if match rt::is_truthy(interp, &__t1305) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W338 = { - let __t1306 = v_V336.clone(); - rt::apply_direct(interp, "abs", &[__t1306])? - }; - { - let v_W339 = { - let __t1307 = v_V337.clone(); - rt::apply_direct(interp, "abs", &[__t1307])? - }; - { - let __t1310 = { - let __t1308 = v_W338.clone(); - let __t1309 = v_W339.clone(); - rt::gt(&__t1308, &__t1309)? - }; - if match rt::is_truthy(interp, &__t1310) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1313 = { - let __t1311 = v_W338.clone(); - let __t1312 = v_W339.clone(); - rt::sub(&__t1311, &__t1312)? - }; - let __t1314 = v_W339.clone(); - rt::apply_direct(interp, "maths.gcd-help", &[__t1313, __t1314])? - }); - } else { - break Ok({ - let __t1315 = v_W338.clone(); - let __t1318 = { - let __t1316 = v_W339.clone(); - let __t1317 = v_W338.clone(); - rt::sub(&__t1316, &__t1317)? - }; - rt::apply_direct(interp, "maths.gcd-help", &[__t1315, __t1318])? - }); - } - } - } - } - } else { - break Ok({ - let __t1319 = Value::str("gcd expects integer inputs"); - rt::apply_direct(interp, "simple-error", &[__t1319])? - }); - } - } - } -} - -fn install_gcd(interp: &mut Interp) { - interp.register_native("gcd", 2, aot_gcd); - interp.register_aot_direct("gcd", aot_gcd); -} - -/// AOT-compiled from KL `(defun maths.gcd-help ...)` -pub fn aot_maths_x2e_gcd_x2d_help(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "maths.gcd-help: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V342 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V343 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1322 = { - let __t1320 = v_V342.clone(); - let __t1321 = v_V343.clone(); - rt::gt(&__t1320, &__t1321)? - }; - if match rt::is_truthy(interp, &__t1322) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1323 = v_V342.clone(); - let __t1324 = v_V343.clone(); - let __t1325 = v_V343.clone(); - rt::apply_direct(interp, "maths.gcd-loop", &[__t1323, __t1324, __t1325])? - }); - } else { - break Ok({ - let __t1326 = v_V342.clone(); - let __t1327 = v_V343.clone(); - let __t1328 = v_V342.clone(); - rt::apply_direct(interp, "maths.gcd-loop", &[__t1326, __t1327, __t1328])? - }); - } - } - } -} - -fn install_maths_x2e_gcd_x2d_help(interp: &mut Interp) { - interp.register_native("maths.gcd-help", 2, aot_maths_x2e_gcd_x2d_help); - interp.register_aot_direct("maths.gcd-help", aot_maths_x2e_gcd_x2d_help); -} - -/// AOT-compiled from KL `(defun maths.gcd-loop ...)` -pub fn aot_maths_x2e_gcd_x2d_loop(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "maths.gcd-loop: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V350 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V351 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V352 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1346 = { - let __t1344 = Value::int(1i64); - let __t1345 = v_V352.clone(); - rt::eq(&__t1344, &__t1345) - }; - if match rt::is_truthy(interp, &__t1346) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(1i64)); - } else { - { - let __t1343 = { - let __t1341 = { - let __t1337 = { - let __t1335 = v_V350.clone(); - let __t1336 = v_V352.clone(); - rt::div(&__t1335, &__t1336)? - }; - rt::apply_direct(interp, "integer?", &[__t1337])? - }; - if !rt::is_truthy(interp, &__t1341)? { - Value::bool(false) - } else { - let __t1342 = { - let __t1340 = { - let __t1338 = v_V351.clone(); - let __t1339 = v_V352.clone(); - rt::div(&__t1338, &__t1339)? - }; - rt::apply_direct(interp, "integer?", &[__t1340])? - }; - Value::bool(rt::is_truthy(interp, &__t1342)?) - } - }; - if match rt::is_truthy(interp, &__t1343) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V352.clone()); - } else { - { - let __t1334 = Value::bool(true); - if match rt::is_truthy(interp, &__t1334) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1329 = v_V350.clone(); - let __t1330 = v_V351.clone(); - let __t1333 = { - let __t1331 = v_V352.clone(); - let __t1332 = Value::int(1i64); - rt::sub(&__t1331, &__t1332)? - }; - v_V350 = __t1329; - v_V351 = __t1330; - v_V352 = __t1333; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_maths_x2e_gcd_x2d_loop(interp: &mut Interp) { - interp.register_native("maths.gcd-loop", 3, aot_maths_x2e_gcd_x2d_loop); - interp.register_aot_direct("maths.gcd-loop", aot_maths_x2e_gcd_x2d_loop); -} - -/// AOT-compiled from KL `(defun lcd ...)` -pub fn aot_lcd(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "lcd: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V356 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V357 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1359 = { - let __t1357 = { - let __t1355 = v_V356.clone(); - rt::apply_direct(interp, "even?", &[__t1355])? - }; - if !rt::is_truthy(interp, &__t1357)? { - Value::bool(false) - } else { - let __t1358 = { - let __t1356 = v_V357.clone(); - rt::apply_direct(interp, "even?", &[__t1356])? - }; - Value::bool(rt::is_truthy(interp, &__t1358)?) - } - }; - if match rt::is_truthy(interp, &__t1359) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(2i64)); - } else { - { - let __t1354 = Value::bool(true); - if match rt::is_truthy(interp, &__t1354) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1347 = v_V356.clone(); - let __t1348 = v_V357.clone(); - let __t1352 = { - let __t1351 = { - let __t1349 = v_V356.clone(); - let __t1350 = v_V357.clone(); - rt::gt(&__t1349, &__t1350)? - }; - if rt::is_truthy(interp, &__t1351)? { - v_V357.clone() - } else { - v_V356.clone() - } - }; - let __t1353 = Value::int(3i64); - rt::apply_direct( - interp, - "maths.lcd-loop", - &[__t1347, __t1348, __t1352, __t1353], - )? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_lcd(interp: &mut Interp) { - interp.register_native("lcd", 2, aot_lcd); - interp.register_aot_direct("lcd", aot_lcd); -} - -/// AOT-compiled from KL `(defun maths.lcd-loop ...)` -pub fn aot_maths_x2e_lcd_x2d_loop(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "maths.lcd-loop: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V363 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V364 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V365 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V366 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1378 = { - let __t1376 = v_V366.clone(); - let __t1377 = v_V365.clone(); - rt::gt(&__t1376, &__t1377)? - }; - if match rt::is_truthy(interp, &__t1378) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(1i64)); - } else { - { - let __t1375 = { - let __t1373 = { - let __t1369 = { - let __t1367 = v_V363.clone(); - let __t1368 = v_V366.clone(); - rt::div(&__t1367, &__t1368)? - }; - rt::apply_direct(interp, "integer?", &[__t1369])? - }; - if !rt::is_truthy(interp, &__t1373)? { - Value::bool(false) - } else { - let __t1374 = { - let __t1372 = { - let __t1370 = v_V364.clone(); - let __t1371 = v_V366.clone(); - rt::div(&__t1370, &__t1371)? - }; - rt::apply_direct(interp, "integer?", &[__t1372])? - }; - Value::bool(rt::is_truthy(interp, &__t1374)?) - } - }; - if match rt::is_truthy(interp, &__t1375) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V366.clone()); - } else { - { - let __t1366 = Value::bool(true); - if match rt::is_truthy(interp, &__t1366) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1360 = v_V363.clone(); - let __t1361 = v_V364.clone(); - let __t1362 = v_V365.clone(); - let __t1365 = { - let __t1363 = Value::int(2i64); - let __t1364 = v_V366.clone(); - rt::add(&__t1363, &__t1364)? - }; - v_V363 = __t1360; - v_V364 = __t1361; - v_V365 = __t1362; - v_V366 = __t1365; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_maths_x2e_lcd_x2d_loop(interp: &mut Interp) { - interp.register_native("maths.lcd-loop", 4, aot_maths_x2e_lcd_x2d_loop); - interp.register_aot_direct("maths.lcd-loop", aot_maths_x2e_lcd_x2d_loop); -} - -/// AOT-compiled from KL `(defun isqrt ...)` -pub fn aot_isqrt(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "isqrt: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V371 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1379 = v_V371.clone(); - let __t1380 = Value::int(0i64); - rt::apply_direct(interp, "maths.isqrt-loop", &[__t1379, __t1380])? - }); - } -} - -fn install_isqrt(interp: &mut Interp) { - interp.register_native("isqrt", 1, aot_isqrt); - interp.register_aot_direct("isqrt", aot_isqrt); -} - -/// AOT-compiled from KL `(defun maths.isqrt-loop ...)` -pub fn aot_maths_x2e_isqrt_x2d_loop(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "maths.isqrt-loop: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V373 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V374 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1397 = { - let __t1395 = { - let __t1393 = v_V374.clone(); - let __t1394 = v_V374.clone(); - rt::mul(&__t1393, &__t1394)? - }; - let __t1396 = v_V373.clone(); - rt::eq(&__t1395, &__t1396) - }; - if match rt::is_truthy(interp, &__t1397) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V374.clone()); - } else { - { - let __t1392 = { - let __t1388 = { - let __t1386 = v_V374.clone(); - let __t1387 = v_V374.clone(); - rt::mul(&__t1386, &__t1387)? - }; - let __t1389 = v_V373.clone(); - rt::gt(&__t1388, &__t1389)? - }; - if match rt::is_truthy(interp, &__t1392) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1390 = v_V374.clone(); - let __t1391 = Value::int(1i64); - rt::sub(&__t1390, &__t1391)? - }); - } else { - { - let __t1385 = Value::bool(true); - if match rt::is_truthy(interp, &__t1385) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1381 = v_V373.clone(); - let __t1384 = { - let __t1382 = v_V374.clone(); - let __t1383 = Value::int(1i64); - rt::add(&__t1382, &__t1383)? - }; - v_V373 = __t1381; - v_V374 = __t1384; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_maths_x2e_isqrt_x2d_loop(interp: &mut Interp) { - interp.register_native("maths.isqrt-loop", 2, aot_maths_x2e_isqrt_x2d_loop); - interp.register_aot_direct("maths.isqrt-loop", aot_maths_x2e_isqrt_x2d_loop); -} - -/// AOT-compiled from KL `(defun div ...)` -pub fn aot_div(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "div: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V377 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V378 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1400 = { - let __t1398 = v_V377.clone(); - let __t1399 = v_V378.clone(); - rt::div(&__t1398, &__t1399)? - }; - rt::apply_direct(interp, "floor", &[__t1400])? - }); - } -} - -fn install_div(interp: &mut Interp) { - interp.register_native("div", 2, aot_div); - interp.register_aot_direct("div", aot_div); -} - -/// AOT-compiled from KL `(defun modf ...)` -pub fn aot_modf(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "modf: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V381 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W382 = { - let __t1401 = v_V381.clone(); - rt::apply_direct(interp, "floor", &[__t1401])? - }; - break Ok({ - let __t1402 = v_W382.clone(); - let __t1405 = { - let __t1403 = v_V381.clone(); - let __t1404 = v_W382.clone(); - rt::sub(&__t1403, &__t1404)? - }; - rt::apply_direct(interp, "@p", &[__t1402, __t1405])? - }); - } - } -} - -fn install_modf(interp: &mut Interp) { - interp.register_native("modf", 1, aot_modf); - interp.register_aot_direct("modf", aot_modf); -} - -/// AOT-compiled from KL `(defun floor ...)` -pub fn aot_floor(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "floor: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V384 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1415 = { - let __t1411 = v_V384.clone(); - rt::apply_direct(interp, "negative?", &[__t1411])? - }; - if match rt::is_truthy(interp, &__t1415) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1414 = { - let __t1413 = { - let __t1412 = v_V384.clone(); - rt::apply_direct(interp, "~", &[__t1412])? - }; - rt::apply_direct(interp, "ceiling", &[__t1413])? - }; - rt::apply_direct(interp, "~", &[__t1414])? - }); - } else { - { - let __t1410 = Value::bool(true); - if match rt::is_truthy(interp, &__t1410) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1406 = Value::sym(interp.intern("floor")); - let __t1407 = v_V384.clone(); - let __t1408 = Value::int(15i64); - let __t1409 = Value::int(0i64); - rt::apply_direct( - interp, - "maths.rounding-loop", - &[__t1406, __t1407, __t1408, __t1409], - )? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_floor(interp: &mut Interp) { - interp.register_native("floor", 1, aot_floor); - interp.register_aot_direct("floor", aot_floor); -} - -/// AOT-compiled from KL `(defun maths.rounding-loop ...)` -pub fn aot_maths_x2e_rounding_x2d_loop(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "maths.rounding-loop: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V389 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V390 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V391 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V392 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1474 = { - let __t1472 = { - let __t1468 = Value::int(0i64); - let __t1469 = v_V391.clone(); - rt::eq(&__t1468, &__t1469) - }; - if !rt::is_truthy(interp, &__t1472)? { - Value::bool(false) - } else { - let __t1473 = { - let __t1470 = v_V390.clone(); - let __t1471 = v_V392.clone(); - rt::eq(&__t1470, &__t1471) - }; - Value::bool(rt::is_truthy(interp, &__t1473)?) - } - }; - if match rt::is_truthy(interp, &__t1474) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V392.clone()); - } else { - { - let __t1467 = { - let __t1442 = { - let __t1438 = Value::int(0i64); - let __t1439 = v_V391.clone(); - rt::eq(&__t1438, &__t1439) - }; - if !rt::is_truthy(interp, &__t1442)? { - Value::bool(false) - } else { - let __t1443 = { - let __t1440 = v_V392.clone(); - let __t1441 = v_V390.clone(); - rt::gt(&__t1440, &__t1441)? - }; - Value::bool(rt::is_truthy(interp, &__t1443)?) - } - }; - if match rt::is_truthy(interp, &__t1467) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1446 = { - let __t1444 = v_V389.clone(); - let __t1445 = Value::sym(interp.intern("floor")); - rt::eq(&__t1444, &__t1445) - }; - if match rt::is_truthy(interp, &__t1446) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1447 = v_V392.clone(); - let __t1448 = Value::int(1i64); - rt::sub(&__t1447, &__t1448)? - }); - } else { - { - let __t1451 = { - let __t1449 = v_V389.clone(); - let __t1450 = Value::sym(interp.intern("ceiling")); - rt::eq(&__t1449, &__t1450) - }; - if match rt::is_truthy(interp, &__t1451) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V392.clone()); - } else { - { - let __t1454 = { - let __t1452 = v_V389.clone(); - let __t1453 = Value::sym(interp.intern("round")); - rt::eq(&__t1452, &__t1453) - }; - if match rt::is_truthy(interp, &__t1454) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W393 = { - let __t1455 = v_V392.clone(); - let __t1456 = v_V390.clone(); - rt::sub(&__t1455, &__t1456)? - }; - { - let v_W394 = { - let __t1457 = v_V390.clone(); - let __t1460 = { - let __t1458 = v_V392.clone(); - let __t1459 = Value::int(1i64); - rt::sub(&__t1458, &__t1459)? - }; - rt::sub(&__t1457, &__t1460)? - }; - { - let __t1463 = { - let __t1461 = v_W393.clone(); - let __t1462 = v_W394.clone(); - rt::gt(&__t1461, &__t1462)? - }; - if match rt::is_truthy(interp, &__t1463) - { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1464 = v_V392.clone(); - let __t1465 = Value::int(1i64); - rt::sub(&__t1464, &__t1465)? - }); - } else { - break Ok(v_V392.clone()); - } - } - } - } - } else { - break Ok({ - let __t1466 = - Value::str("error: cases exhausted"); - rt::apply_direct( - interp, - "simple-error", - &[__t1466], - )? - }); - } - } - } - } - } - } - } else { - { - let __t1437 = { - let __t1427 = v_V390.clone(); - let __t1428 = v_V392.clone(); - rt::gt(&__t1427, &__t1428)? - }; - if match rt::is_truthy(interp, &__t1437) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1429 = v_V389.clone(); - let __t1430 = v_V390.clone(); - let __t1431 = v_V391.clone(); - let __t1436 = { - let __t1432 = v_V392.clone(); - let __t1435 = { - let __t1433 = Value::int(10i64); - let __t1434 = v_V391.clone(); - rt::apply_direct(interp, "power", &[__t1433, __t1434])? - }; - rt::add(&__t1432, &__t1435)? - }; - v_V389 = __t1429; - v_V390 = __t1430; - v_V391 = __t1431; - v_V392 = __t1436; - continue; - } - } else { - { - let __t1426 = Value::bool(true); - if match rt::is_truthy(interp, &__t1426) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1416 = v_V389.clone(); - let __t1417 = v_V390.clone(); - let __t1420 = { - let __t1418 = v_V391.clone(); - let __t1419 = Value::int(1i64); - rt::sub(&__t1418, &__t1419)? - }; - let __t1425 = { - let __t1421 = v_V392.clone(); - let __t1424 = { - let __t1422 = Value::int(10i64); - let __t1423 = v_V391.clone(); - rt::apply_direct( - interp, - "power", - &[__t1422, __t1423], - )? - }; - rt::sub(&__t1421, &__t1424)? - }; - v_V389 = __t1416; - v_V390 = __t1417; - v_V391 = __t1420; - v_V392 = __t1425; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_maths_x2e_rounding_x2d_loop(interp: &mut Interp) { - interp.register_native("maths.rounding-loop", 4, aot_maths_x2e_rounding_x2d_loop); - interp.register_aot_direct("maths.rounding-loop", aot_maths_x2e_rounding_x2d_loop); -} - -/// AOT-compiled from KL `(defun maths.float->pair ...)` -pub fn aot_maths_x2e_float_x2d__x3e_pair(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "maths.float->pair: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V399 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W400 = { - let __t1475 = v_V399.clone(); - rt::apply_direct(interp, "floor", &[__t1475])? - }; - break Ok({ - let __t1476 = v_W400.clone(); - let __t1479 = { - let __t1477 = v_V399.clone(); - let __t1478 = v_W400.clone(); - rt::sub(&__t1477, &__t1478)? - }; - rt::apply_direct(interp, "@p", &[__t1476, __t1479])? - }); - } - } -} - -fn install_maths_x2e_float_x2d__x3e_pair(interp: &mut Interp) { - interp.register_native("maths.float->pair", 1, aot_maths_x2e_float_x2d__x3e_pair); - interp.register_aot_direct("maths.float->pair", aot_maths_x2e_float_x2d__x3e_pair); -} - -/// AOT-compiled from KL `(defun ceiling ...)` -pub fn aot_ceiling(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "ceiling: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V402 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1489 = { - let __t1485 = v_V402.clone(); - rt::apply_direct(interp, "negative?", &[__t1485])? - }; - if match rt::is_truthy(interp, &__t1489) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1488 = { - let __t1487 = { - let __t1486 = v_V402.clone(); - rt::apply_direct(interp, "~", &[__t1486])? - }; - rt::apply_direct(interp, "floor", &[__t1487])? - }; - rt::apply_direct(interp, "~", &[__t1488])? - }); - } else { - { - let __t1484 = Value::bool(true); - if match rt::is_truthy(interp, &__t1484) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1480 = Value::sym(interp.intern("ceiling")); - let __t1481 = v_V402.clone(); - let __t1482 = Value::int(15i64); - let __t1483 = Value::int(0i64); - rt::apply_direct( - interp, - "maths.rounding-loop", - &[__t1480, __t1481, __t1482, __t1483], - )? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_ceiling(interp: &mut Interp) { - interp.register_native("ceiling", 1, aot_ceiling); - interp.register_aot_direct("ceiling", aot_ceiling); -} - -/// AOT-compiled from KL `(defun round ...)` -pub fn aot_round(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "round: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V404 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1499 = { - let __t1495 = v_V404.clone(); - rt::apply_direct(interp, "negative?", &[__t1495])? - }; - if match rt::is_truthy(interp, &__t1499) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1498 = { - let __t1497 = { - let __t1496 = v_V404.clone(); - rt::apply_direct(interp, "~", &[__t1496])? - }; - rt::apply_direct(interp, "round", &[__t1497])? - }; - rt::apply_direct(interp, "~", &[__t1498])? - }); - } else { - { - let __t1494 = Value::bool(true); - if match rt::is_truthy(interp, &__t1494) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1490 = Value::sym(interp.intern("round")); - let __t1491 = v_V404.clone(); - let __t1492 = Value::int(15i64); - let __t1493 = Value::int(0i64); - rt::apply_direct( - interp, - "maths.rounding-loop", - &[__t1490, __t1491, __t1492, __t1493], - )? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_round(interp: &mut Interp) { - interp.register_native("round", 1, aot_round); - interp.register_aot_direct("round", aot_round); -} - -/// AOT-compiled from KL `(defun mod ...)` -pub fn aot_mod(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "mod: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V406 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V407 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W408 = { - let __t1500 = v_V406.clone(); - let __t1501 = v_V407.clone(); - rt::div(&__t1500, &__t1501)? - }; - { - let v_W409 = { - let __t1502 = v_W408.clone(); - rt::apply_direct(interp, "floor", &[__t1502])? - }; - { - let __t1507 = { - let __t1505 = { - let __t1503 = v_V406.clone(); - rt::apply_direct(interp, "integer?", &[__t1503])? - }; - if !rt::is_truthy(interp, &__t1505)? { - Value::bool(false) - } else { - let __t1506 = { - let __t1504 = v_V407.clone(); - rt::apply_direct(interp, "integer?", &[__t1504])? - }; - Value::bool(rt::is_truthy(interp, &__t1506)?) - } - }; - if match rt::is_truthy(interp, &__t1507) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1512 = { - let __t1508 = v_V407.clone(); - let __t1511 = { - let __t1509 = v_W408.clone(); - let __t1510 = v_W409.clone(); - rt::sub(&__t1509, &__t1510)? - }; - rt::mul(&__t1508, &__t1511)? - }; - rt::apply_direct(interp, "round", &[__t1512])? - }); - } else { - break Ok({ - let __t1513 = v_V407.clone(); - let __t1516 = { - let __t1514 = v_W408.clone(); - let __t1515 = v_W409.clone(); - rt::sub(&__t1514, &__t1515)? - }; - rt::mul(&__t1513, &__t1516)? - }); - } - } - } - } - } -} - -fn install_mod(interp: &mut Interp) { - interp.register_native("mod", 2, aot_mod); - interp.register_aot_direct("mod", aot_mod); -} - -/// AOT-compiled from KL `(defun lcm ...)` -pub fn aot_lcm(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "lcm: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V412 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W413 = { - let __t1517 = v_V412.clone(); - rt::apply_direct(interp, "maths.greatest", &[__t1517])? - }; - break Ok({ - let __t1518 = v_W413.clone(); - let __t1519 = v_W413.clone(); - let __t1520 = v_V412.clone(); - rt::apply_direct(interp, "maths.lcm-h", &[__t1518, __t1519, __t1520])? - }); - } - } -} - -fn install_lcm(interp: &mut Interp) { - interp.register_native("lcm", 1, aot_lcm); - interp.register_aot_direct("lcm", aot_lcm); -} - -/// AOT-compiled from KL `(defun maths.greatest ...)` -pub fn aot_maths_x2e_greatest(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "maths.greatest: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V417 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1557 = { - let __t1554 = { - let __t1550 = v_V417.clone(); - rt::is_cons(&__t1550) - }; - if !rt::is_truthy(interp, &__t1554)? { - Value::bool(false) - } else { - let __t1555 = { - let __t1551 = Value::nil(); - let __t1553 = { - let __t1552 = v_V417.clone(); - rt::tl(&__t1552)? - }; - rt::eq(&__t1551, &__t1553) - }; - Value::bool(rt::is_truthy(interp, &__t1555)?) - } - }; - if match rt::is_truthy(interp, &__t1557) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1556 = v_V417.clone(); - rt::hd(&__t1556)? - }); - } else { - { - let __t1549 = { - let __t1541 = { - let __t1531 = v_V417.clone(); - rt::is_cons(&__t1531) - }; - if !rt::is_truthy(interp, &__t1541)? { - Value::bool(false) - } else { - let __t1542 = { - let __t1539 = { - let __t1533 = { - let __t1532 = v_V417.clone(); - rt::tl(&__t1532)? - }; - rt::is_cons(&__t1533) - }; - if !rt::is_truthy(interp, &__t1539)? { - Value::bool(false) - } else { - let __t1540 = { - let __t1535 = { - let __t1534 = v_V417.clone(); - rt::hd(&__t1534)? - }; - let __t1538 = { - let __t1537 = { - let __t1536 = v_V417.clone(); - rt::tl(&__t1536)? - }; - rt::hd(&__t1537)? - }; - rt::gt(&__t1535, &__t1538)? - }; - Value::bool(rt::is_truthy(interp, &__t1540)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1542)?) - } - }; - if match rt::is_truthy(interp, &__t1549) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1548 = { - let __t1544 = { - let __t1543 = v_V417.clone(); - rt::hd(&__t1543)? - }; - let __t1547 = { - let __t1546 = { - let __t1545 = v_V417.clone(); - rt::tl(&__t1545)? - }; - rt::tl(&__t1546)? - }; - rt::cons(&__t1544, &__t1547) - }; - v_V417 = __t1548; - continue; - } - } else { - { - let __t1530 = { - let __t1526 = { - let __t1523 = v_V417.clone(); - rt::is_cons(&__t1523) - }; - if !rt::is_truthy(interp, &__t1526)? { - Value::bool(false) - } else { - let __t1527 = { - let __t1525 = { - let __t1524 = v_V417.clone(); - rt::tl(&__t1524)? - }; - rt::is_cons(&__t1525) - }; - Value::bool(rt::is_truthy(interp, &__t1527)?) - } - }; - if match rt::is_truthy(interp, &__t1530) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1529 = { - let __t1528 = v_V417.clone(); - rt::tl(&__t1528)? - }; - v_V417 = __t1529; - continue; - } - } else { - { - let __t1522 = Value::bool(true); - if match rt::is_truthy(interp, &__t1522) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1521 = - Value::sym(interp.intern("maths.greatest")); - rt::apply_direct(interp, "shen.f-error", &[__t1521])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_maths_x2e_greatest(interp: &mut Interp) { - interp.register_native("maths.greatest", 1, aot_maths_x2e_greatest); - interp.register_aot_direct("maths.greatest", aot_maths_x2e_greatest); -} - -/// AOT-compiled from KL `(defun maths.lcm-h ...)` -pub fn aot_maths_x2e_lcm_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "maths.lcm-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V419 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V420 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V421 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1566 = { - let __t1564 = v_V419.clone(); - let __t1565 = v_V421.clone(); - rt::apply_direct(interp, "maths.lcm?", &[__t1564, __t1565])? - }; - if match rt::is_truthy(interp, &__t1566) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V419.clone()); - } else { - { - let __t1563 = Value::bool(true); - if match rt::is_truthy(interp, &__t1563) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1560 = { - let __t1558 = v_V419.clone(); - let __t1559 = v_V420.clone(); - rt::add(&__t1558, &__t1559)? - }; - let __t1561 = v_V420.clone(); - let __t1562 = v_V421.clone(); - v_V419 = __t1560; - v_V420 = __t1561; - v_V421 = __t1562; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_maths_x2e_lcm_x2d_h(interp: &mut Interp) { - interp.register_native("maths.lcm-h", 3, aot_maths_x2e_lcm_x2d_h); - interp.register_aot_direct("maths.lcm-h", aot_maths_x2e_lcm_x2d_h); -} - -/// AOT-compiled from KL `(defun maths.lcm? ...)` -pub fn aot_maths_x2e_lcm_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "maths.lcm?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V427 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V428 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1581 = { - let __t1579 = Value::nil(); - let __t1580 = v_V428.clone(); - rt::eq(&__t1579, &__t1580) - }; - if match rt::is_truthy(interp, &__t1581) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t1578 = { - let __t1569 = v_V428.clone(); - rt::is_cons(&__t1569) - }; - if match rt::is_truthy(interp, &__t1578) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1574 = { - let __t1573 = { - let __t1570 = v_V427.clone(); - let __t1572 = { - let __t1571 = v_V428.clone(); - rt::hd(&__t1571)? - }; - rt::div(&__t1570, &__t1572)? - }; - rt::apply_direct(interp, "integer?", &[__t1573])? - }; - if !match rt::is_truthy(interp, &__t1574) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t1575 = v_V427.clone(); - let __t1577 = { - let __t1576 = v_V428.clone(); - rt::tl(&__t1576)? - }; - v_V427 = __t1575; - v_V428 = __t1577; - continue; - } - } - } - } else { - { - let __t1568 = Value::bool(true); - if match rt::is_truthy(interp, &__t1568) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1567 = Value::sym(interp.intern("maths.lcm?")); - rt::apply_direct(interp, "shen.f-error", &[__t1567])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_maths_x2e_lcm_x3f_(interp: &mut Interp) { - interp.register_native("maths.lcm?", 2, aot_maths_x2e_lcm_x3f_); - interp.register_aot_direct("maths.lcm?", aot_maths_x2e_lcm_x3f_); -} - -/// AOT-compiled from KL `(defun random ...)` -pub fn aot_random(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "random: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V431 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V432 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W433 = { - let __t1583 = { - let __t1582 = Value::sym(interp.intern("maths.*seed*")); - rt::apply_direct(interp, "value", &[__t1582])? - }; - rt::apply_direct(interp, "maths.bbs", &[__t1583])? - }; - { - let v_W434 = { - let __t1584 = Value::sym(interp.intern("maths.*seed*")); - let __t1585 = v_W433.clone(); - rt::apply_direct(interp, "set", &[__t1584, __t1585])? - }; - { - let v_W435 = { - let __t1586 = v_V431.clone(); - let __t1587 = v_V432.clone(); - rt::apply_direct(interp, "min", &[__t1586, __t1587])? - }; - break Ok({ - let __t1588 = v_W435.clone(); - let __t1596 = { - let __t1589 = v_W434.clone(); - let __t1595 = { - let __t1594 = { - let __t1590 = Value::int(1i64); - let __t1593 = { - let __t1591 = v_V432.clone(); - let __t1592 = v_V431.clone(); - rt::sub(&__t1591, &__t1592)? - }; - rt::add(&__t1590, &__t1593)? - }; - rt::apply_direct(interp, "abs", &[__t1594])? - }; - rt::apply_direct(interp, "mod", &[__t1589, __t1595])? - }; - rt::add(&__t1588, &__t1596)? - }); - } - } - } - } -} - -fn install_random(interp: &mut Interp) { - interp.register_native("random", 2, aot_random); - interp.register_aot_direct("random", aot_random); -} - -/// AOT-compiled from KL `(defun min ...)` -pub fn aot_min(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "min: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V440 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V441 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1600 = { - let __t1598 = v_V440.clone(); - let __t1599 = v_V441.clone(); - rt::gt(&__t1598, &__t1599)? - }; - if match rt::is_truthy(interp, &__t1600) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V441.clone()); - } else { - { - let __t1597 = Value::bool(true); - if match rt::is_truthy(interp, &__t1597) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V440.clone()); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_min(interp: &mut Interp) { - interp.register_native("min", 2, aot_min); - interp.register_aot_direct("min", aot_min); -} - -/// AOT-compiled from KL `(defun reseed ...)` -pub fn aot_reseed(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "reseed: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1601 = Value::sym(interp.intern("maths.*seed*")); - let __t1603 = { - let __t1602 = Value::sym(interp.intern("unix")); - rt::apply_direct(interp, "get-time", &[__t1602])? - }; - rt::apply_direct(interp, "set", &[__t1601, __t1603])? - }); - } -} - -fn install_reseed(interp: &mut Interp) { - interp.register_native("reseed", 0, aot_reseed); - interp.register_aot_direct("reseed", aot_reseed); -} - -/// AOT-compiled from KL `(defun maths.bbs ...)` -pub fn aot_maths_x2e_bbs(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "maths.bbs: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V444 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W445 = { - let __t1604 = Value::int(1201i64); - let __t1605 = Value::int(1213i64); - rt::mul(&__t1604, &__t1605)? - }; - break Ok({ - let __t1608 = { - let __t1606 = v_V444.clone(); - let __t1607 = v_V444.clone(); - rt::mul(&__t1606, &__t1607)? - }; - let __t1609 = v_W445.clone(); - rt::apply_direct(interp, "mod", &[__t1608, __t1609])? - }); - } - } -} - -fn install_maths_x2e_bbs(interp: &mut Interp) { - interp.register_native("maths.bbs", 1, aot_maths_x2e_bbs); - interp.register_aot_direct("maths.bbs", aot_maths_x2e_bbs); -} - -/// AOT-compiled from KL `(defun ~ ...)` -pub fn aot__x7e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "~: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V447 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1610 = Value::int(0i64); - let __t1611 = v_V447.clone(); - rt::sub(&__t1610, &__t1611)? - }); - } -} - -fn install__x7e_(interp: &mut Interp) { - interp.register_native("~", 1, aot__x7e_); - interp.register_aot_direct("~", aot__x7e_); -} - -/// AOT-compiled from KL `(defun positive? ...)` -pub fn aot_positive_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "positive?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V449 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1612 = v_V449.clone(); - let __t1613 = Value::int(0i64); - rt::gt(&__t1612, &__t1613)? - }); - } -} - -fn install_positive_x3f_(interp: &mut Interp) { - interp.register_native("positive?", 1, aot_positive_x3f_); - interp.register_aot_direct("positive?", aot_positive_x3f_); -} - -/// AOT-compiled from KL `(defun negative? ...)` -pub fn aot_negative_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "negative?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V451 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1614 = v_V451.clone(); - let __t1615 = Value::int(0i64); - rt::lt(&__t1614, &__t1615)? - }); - } -} - -fn install_negative_x3f_(interp: &mut Interp) { - interp.register_native("negative?", 1, aot_negative_x3f_); - interp.register_aot_direct("negative?", aot_negative_x3f_); -} - -/// AOT-compiled from KL `(defun natural? ...)` -pub fn aot_natural_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "natural?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V453 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1622 = { - let __t1620 = Value::int(0i64); - let __t1621 = v_V453.clone(); - rt::eq(&__t1620, &__t1621) - }; - if match rt::is_truthy(interp, &__t1622) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t1619 = Value::bool(true); - if match rt::is_truthy(interp, &__t1619) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1617 = { - let __t1616 = v_V453.clone(); - rt::apply_direct(interp, "integer?", &[__t1616])? - }; - if !match rt::is_truthy(interp, &__t1617) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t1618 = v_V453.clone(); - rt::apply_direct(interp, "positive?", &[__t1618])? - }); - } - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_natural_x3f_(interp: &mut Interp) { - interp.register_native("natural?", 1, aot_natural_x3f_); - interp.register_aot_direct("natural?", aot_natural_x3f_); -} - -/// AOT-compiled from KL `(defun converge ...)` -pub fn aot_converge(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "converge: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V455 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V456 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V457 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1623 = v_V456.clone(); - let __t1625 = { - let __t1624 = v_V455.clone(); - rt::apply_value(interp, v_V456.clone(), &[__t1624])? - }; - let __t1626 = v_V455.clone(); - let __t1627 = v_V457.clone(); - rt::apply_direct( - interp, - "maths.converge-help", - &[__t1623, __t1625, __t1626, __t1627], - )? - }); - } -} - -fn install_converge(interp: &mut Interp) { - interp.register_native("converge", 3, aot_converge); - interp.register_aot_direct("converge", aot_converge); -} - -/// AOT-compiled from KL `(defun maths.converge-help ...)` -pub fn aot_maths_x2e_converge_x2d_help(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "maths.converge-help: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V464 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V465 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V466 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V467 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1637 = { - let __t1635 = { - let __t1634 = v_V466.clone(); - rt::apply_value(interp, v_V467.clone(), &[__t1634])? - }; - let __t1636 = v_V465.clone(); - rt::apply_value(interp, __t1635, &[__t1636])? - }; - if match rt::is_truthy(interp, &__t1637) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V465.clone()); - } else { - { - let __t1633 = Value::bool(true); - if match rt::is_truthy(interp, &__t1633) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1628 = v_V464.clone(); - let __t1630 = { - let __t1629 = v_V465.clone(); - rt::apply_value(interp, v_V464.clone(), &[__t1629])? - }; - let __t1631 = v_V465.clone(); - let __t1632 = v_V467.clone(); - v_V464 = __t1628; - v_V465 = __t1630; - v_V466 = __t1631; - v_V467 = __t1632; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_maths_x2e_converge_x2d_help(interp: &mut Interp) { - interp.register_native("maths.converge-help", 4, aot_maths_x2e_converge_x2d_help); - interp.register_aot_direct("maths.converge-help", aot_maths_x2e_converge_x2d_help); -} - -/// AOT-compiled from KL `(defun nthrt ...)` -pub fn aot_nthrt(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "nthrt: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V476 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V477 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V478 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1651 = { - let __t1642 = v_V476.clone(); - rt::apply_direct(interp, "positive?", &[__t1642])? - }; - if match rt::is_truthy(interp, &__t1651) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1643 = v_V476.clone(); - let __t1648 = { - let v_V476 = v_V476.clone(); - let v_V477 = v_V477.clone(); - let v_V478 = v_V478.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z479 = args[0].clone(); - Ok({ - let __t1644 = v_V476.clone(); - let __t1645 = v_Z479.clone(); - let __t1646 = v_V477.clone(); - let __t1647 = v_V478.clone(); - rt::apply_direct( - interp, - "maths.compute-nthrt", - &[__t1644, __t1645, __t1646, __t1647], - )? - }) - }, - vec![v_V476, v_V477, v_V478], - interp, - ) - }; - let __t1650 = { - let __t1649 = v_V478.clone(); - rt::apply_direct(interp, "approx", &[__t1649])? - }; - rt::apply_direct(interp, "converge", &[__t1643, __t1648, __t1650])? - }); - } else { - { - let __t1641 = Value::bool(true); - if match rt::is_truthy(interp, &__t1641) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1640 = { - let __t1638 = - Value::str("nthrt: negA must be a positive numberneg%"); - let __t1639 = Value::str(""); - rt::apply_direct(interp, "cn", &[__t1638, __t1639])? - }; - rt::apply_direct(interp, "simple-error", &[__t1640])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_nthrt(interp: &mut Interp) { - interp.register_native("nthrt", 3, aot_nthrt); - interp.register_aot_direct("nthrt", aot_nthrt); -} - -/// AOT-compiled from KL `(defun sqrt ...)` -pub fn aot_sqrt(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "sqrt: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V483 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V484 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1652 = v_V483.clone(); - let __t1653 = Value::int(2i64); - let __t1654 = v_V484.clone(); - rt::apply_direct(interp, "nthrt", &[__t1652, __t1653, __t1654])? - }); - } -} - -fn install_sqrt(interp: &mut Interp) { - interp.register_native("sqrt", 2, aot_sqrt); - interp.register_aot_direct("sqrt", aot_sqrt); -} - -/// AOT-compiled from KL `(defun maths.compute-nthrt ...)` -pub fn aot_maths_x2e_compute_x2d_nthrt(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "maths.compute-nthrt: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V487 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V488 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V489 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V490 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W491 = { - let __t1655 = Value::int(1i64); - let __t1656 = v_V489.clone(); - rt::div(&__t1655, &__t1656)? - }; - { - let v_W492 = { - let __t1659 = { - let __t1657 = v_V489.clone(); - let __t1658 = Value::int(1i64); - rt::sub(&__t1657, &__t1658)? - }; - let __t1660 = v_V488.clone(); - rt::mul(&__t1659, &__t1660)? - }; - { - let v_W493 = { - let __t1661 = v_V488.clone(); - let __t1664 = { - let __t1662 = v_V489.clone(); - let __t1663 = Value::int(1i64); - rt::sub(&__t1662, &__t1663)? - }; - let __t1665 = v_V490.clone(); - rt::apply_direct(interp, "expt", &[__t1661, __t1664, __t1665])? - }; - { - let v_W494 = { - let __t1666 = v_V487.clone(); - let __t1667 = v_W493.clone(); - rt::div(&__t1666, &__t1667)? - }; - { - let v_W495 = { - let __t1668 = v_W492.clone(); - let __t1669 = v_W494.clone(); - rt::add(&__t1668, &__t1669)? - }; - break Ok({ - let __t1670 = v_W491.clone(); - let __t1671 = v_W495.clone(); - rt::mul(&__t1670, &__t1671)? - }); - } - } - } - } - } - } -} - -fn install_maths_x2e_compute_x2d_nthrt(interp: &mut Interp) { - interp.register_native("maths.compute-nthrt", 4, aot_maths_x2e_compute_x2d_nthrt); - interp.register_aot_direct("maths.compute-nthrt", aot_maths_x2e_compute_x2d_nthrt); -} - -/// AOT-compiled from KL `(defun approx ...)` -pub fn aot_approx(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "approx: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V500 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let v_V500 = v_V500.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z501 = args[0].clone(); - Ok({ - let v_V500 = v_V500.clone(); - let v_Z501 = v_Z501.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z502 = args[0].clone(); - Ok({ - let v_W503 = { - let __t1672 = v_Z501.clone(); - let __t1673 = v_Z502.clone(); - rt::sub(&__t1672, &__t1673)? - }; - { - let __t1674 = v_V500.clone(); - let __t1676 = { - let __t1675 = v_W503.clone(); - rt::apply_direct(interp, "abs", &[__t1675])? - }; - rt::gte(&__t1674, &__t1676)? - } - }) - }, - vec![v_V500, v_Z501], - interp, - ) - }) - }, - vec![v_V500], - interp, - ) - }); - } -} - -fn install_approx(interp: &mut Interp) { - interp.register_native("approx", 1, aot_approx); - interp.register_aot_direct("approx", aot_approx); -} - -/// AOT-compiled from KL `(defun abs ...)` -pub fn aot_abs(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "abs: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V505 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1679 = { - let __t1677 = v_V505.clone(); - let __t1678 = Value::int(0i64); - rt::gte(&__t1677, &__t1678)? - }; - if match rt::is_truthy(interp, &__t1679) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V505.clone()); - } else { - break Ok({ - let __t1680 = Value::int(0i64); - let __t1681 = v_V505.clone(); - rt::sub(&__t1680, &__t1681)? - }); - } - } - } -} - -fn install_abs(interp: &mut Interp) { - interp.register_native("abs", 1, aot_abs); - interp.register_aot_direct("abs", aot_abs); -} - -/// AOT-compiled from KL `(defun series ...)` -pub fn aot_series(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "series: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V507 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V508 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V509 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V510 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1684 = { - let __t1682 = v_V507.clone(); - let __t1683 = Value::int(1i64); - rt::add(&__t1682, &__t1683)? - }; - let __t1685 = v_V509.clone(); - let __t1686 = v_V508.clone(); - let __t1688 = { - let __t1687 = v_V507.clone(); - rt::apply_value(interp, v_V508.clone(), &[__t1687])? - }; - let __t1689 = v_V510.clone(); - rt::apply_direct( - interp, - "maths.series-h", - &[__t1684, __t1685, __t1686, __t1688, __t1689], - )? - }); - } -} - -fn install_series(interp: &mut Interp) { - interp.register_native("series", 4, aot_series); - interp.register_aot_direct("series", aot_series); -} - -/// AOT-compiled from KL `(defun maths.series-h ...)` -pub fn aot_maths_x2e_series_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 5 { - return Err(ShenError::new(format!( - "maths.series-h: expected 5 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V515 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V516 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V517 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V518 = args[3].clone(); - #[allow(unused_mut)] - let mut v_V519 = args[4].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W520 = { - let __t1692 = { - let __t1691 = { - let __t1690 = v_V515.clone(); - rt::apply_value(interp, v_V517.clone(), &[__t1690])? - }; - rt::apply_value(interp, v_V519.clone(), &[__t1691])? - }; - let __t1693 = v_V518.clone(); - rt::apply_value(interp, __t1692, &[__t1693])? - }; - { - let __t1699 = { - let __t1697 = { - let __t1696 = { - let __t1694 = v_V518.clone(); - let __t1695 = v_W520.clone(); - rt::sub(&__t1694, &__t1695)? - }; - rt::apply_direct(interp, "abs", &[__t1696])? - }; - let __t1698 = v_V516.clone(); - rt::lte(&__t1697, &__t1698)? - }; - if match rt::is_truthy(interp, &__t1699) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_W520.clone()); - } else { - { - let __t1702 = { - let __t1700 = v_V515.clone(); - let __t1701 = Value::int(1i64); - rt::add(&__t1700, &__t1701)? - }; - let __t1703 = v_V516.clone(); - let __t1704 = v_V517.clone(); - let __t1705 = v_W520.clone(); - let __t1706 = v_V519.clone(); - v_V515 = __t1702; - v_V516 = __t1703; - v_V517 = __t1704; - v_V518 = __t1705; - v_V519 = __t1706; - continue; - } - } - } - } - } -} - -fn install_maths_x2e_series_x2d_h(interp: &mut Interp) { - interp.register_native("maths.series-h", 5, aot_maths_x2e_series_x2d_h); - interp.register_aot_direct("maths.series-h", aot_maths_x2e_series_x2d_h); -} - -/// AOT-compiled from KL `(defun product ...)` -pub fn aot_product(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "product: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V528 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V529 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V530 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1707 = v_V528.clone(); - let __t1708 = v_V529.clone(); - let __t1709 = v_V530.clone(); - let __t1712 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z531 = args[0].clone(); - Ok({ - let v_Z531 = v_Z531.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z532 = args[0].clone(); - Ok({ - let __t1710 = v_Z531.clone(); - let __t1711 = v_Z532.clone(); - rt::mul(&__t1710, &__t1711)? - }) - }, - vec![v_Z531], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "series", &[__t1707, __t1708, __t1709, __t1712])? - }); - } -} - -fn install_product(interp: &mut Interp) { - interp.register_native("product", 3, aot_product); - interp.register_aot_direct("product", aot_product); -} - -/// AOT-compiled from KL `(defun summation ...)` -pub fn aot_summation(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "summation: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V538 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V539 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V540 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1713 = v_V538.clone(); - let __t1714 = v_V539.clone(); - let __t1715 = v_V540.clone(); - let __t1718 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z541 = args[0].clone(); - Ok({ - let v_Z541 = v_Z541.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z542 = args[0].clone(); - Ok({ - let __t1716 = v_Z541.clone(); - let __t1717 = v_Z542.clone(); - rt::add(&__t1716, &__t1717)? - }) - }, - vec![v_Z541], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "series", &[__t1713, __t1714, __t1715, __t1718])? - }); - } -} - -fn install_summation(interp: &mut Interp) { - interp.register_native("summation", 3, aot_summation); - interp.register_aot_direct("summation", aot_summation); -} - -/// AOT-compiled from KL `(defun odd? ...)` -pub fn aot_odd_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "odd?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V546 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1720 = { - let __t1719 = v_V546.clone(); - rt::apply_direct(interp, "integer?", &[__t1719])? - }; - if !match rt::is_truthy(interp, &__t1720) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t1724 = { - let __t1723 = { - let __t1721 = v_V546.clone(); - let __t1722 = Value::int(2i64); - rt::div(&__t1721, &__t1722)? - }; - rt::apply_direct(interp, "integer?", &[__t1723])? - }; - rt::apply_direct(interp, "not", &[__t1724])? - }); - } - } - } -} - -fn install_odd_x3f_(interp: &mut Interp) { - interp.register_native("odd?", 1, aot_odd_x3f_); - interp.register_aot_direct("odd?", aot_odd_x3f_); -} - -/// AOT-compiled from KL `(defun even? ...)` -pub fn aot_even_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "even?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V548 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1726 = { - let __t1725 = v_V548.clone(); - rt::apply_direct(interp, "integer?", &[__t1725])? - }; - if !match rt::is_truthy(interp, &__t1726) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t1729 = { - let __t1727 = v_V548.clone(); - let __t1728 = Value::int(2i64); - rt::div(&__t1727, &__t1728)? - }; - rt::apply_direct(interp, "integer?", &[__t1729])? - }); - } - } - } -} - -fn install_even_x3f_(interp: &mut Interp) { - interp.register_native("even?", 1, aot_even_x3f_); - interp.register_aot_direct("even?", aot_even_x3f_); -} - -/// AOT-compiled from KL `(defun maths.compute-sine ...)` -pub fn aot_maths_x2e_compute_x2d_sine(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "maths.compute-sine: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V550 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V551 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W552 = { - let __t1732 = { - let __t1730 = Value::int(2i64); - let __t1731 = v_V551.clone(); - rt::mul(&__t1730, &__t1731)? - }; - let __t1733 = Value::int(1i64); - rt::add(&__t1732, &__t1733)? - }; - { - let v_W553 = { - let __t1736 = { - let __t1734 = Value::int(-1i64); - let __t1735 = v_V551.clone(); - rt::apply_direct(interp, "power", &[__t1734, __t1735])? - }; - let __t1739 = { - let __t1737 = v_V550.clone(); - let __t1738 = v_W552.clone(); - rt::apply_direct(interp, "power", &[__t1737, __t1738])? - }; - rt::mul(&__t1736, &__t1739)? - }; - { - let v_W554 = { - let __t1740 = v_W552.clone(); - rt::apply_direct(interp, "factorial", &[__t1740])? - }; - break Ok({ - let __t1741 = v_W553.clone(); - let __t1742 = v_W554.clone(); - rt::div(&__t1741, &__t1742)? - }); - } - } - } - } -} - -fn install_maths_x2e_compute_x2d_sine(interp: &mut Interp) { - interp.register_native("maths.compute-sine", 2, aot_maths_x2e_compute_x2d_sine); - interp.register_aot_direct("maths.compute-sine", aot_maths_x2e_compute_x2d_sine); -} - -/// AOT-compiled from KL `(defun maths.compute-cos ...)` -pub fn aot_maths_x2e_compute_x2d_cos(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "maths.compute-cos: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V557 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V558 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W559 = { - let __t1743 = Value::int(2i64); - let __t1744 = v_V558.clone(); - rt::mul(&__t1743, &__t1744)? - }; - { - let v_W560 = { - let __t1747 = { - let __t1745 = Value::int(-1i64); - let __t1746 = v_V558.clone(); - rt::apply_direct(interp, "power", &[__t1745, __t1746])? - }; - let __t1750 = { - let __t1748 = v_V557.clone(); - let __t1749 = v_W559.clone(); - rt::apply_direct(interp, "power", &[__t1748, __t1749])? - }; - rt::mul(&__t1747, &__t1750)? - }; - { - let v_W561 = { - let __t1751 = v_W559.clone(); - rt::apply_direct(interp, "factorial", &[__t1751])? - }; - break Ok({ - let __t1752 = v_W560.clone(); - let __t1753 = v_W561.clone(); - rt::div(&__t1752, &__t1753)? - }); - } - } - } - } -} - -fn install_maths_x2e_compute_x2d_cos(interp: &mut Interp) { - interp.register_native("maths.compute-cos", 2, aot_maths_x2e_compute_x2d_cos); - interp.register_aot_direct("maths.compute-cos", aot_maths_x2e_compute_x2d_cos); -} - -/// AOT-compiled from KL `(defun cos ...)` -pub fn aot_cos(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "cos: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V565 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V566 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W567 = { - let __t1754 = v_V565.clone(); - rt::apply_direct(interp, "radians", &[__t1754])? - }; - break Ok({ - let __t1755 = Value::int(0i64); - let __t1758 = { - let v_W567 = v_W567.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z568 = args[0].clone(); - Ok({ - let __t1756 = v_W567.clone(); - let __t1757 = v_Z568.clone(); - rt::apply_direct(interp, "maths.compute-cos", &[__t1756, __t1757])? - }) - }, - vec![v_W567], - interp, - ) - }; - let __t1759 = v_V566.clone(); - rt::apply_direct(interp, "summation", &[__t1755, __t1758, __t1759])? - }); - } - } -} - -fn install_cos(interp: &mut Interp) { - interp.register_native("cos", 2, aot_cos); - interp.register_aot_direct("cos", aot_cos); -} - -/// AOT-compiled from KL `(defun sin ...)` -pub fn aot_sin(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "sin: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V572 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V573 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W574 = { - let __t1760 = v_V572.clone(); - rt::apply_direct(interp, "radians", &[__t1760])? - }; - break Ok({ - let __t1761 = Value::int(0i64); - let __t1764 = { - let v_W574 = v_W574.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z575 = args[0].clone(); - Ok({ - let __t1762 = v_W574.clone(); - let __t1763 = v_Z575.clone(); - rt::apply_direct(interp, "maths.compute-sine", &[__t1762, __t1763])? - }) - }, - vec![v_W574], - interp, - ) - }; - let __t1765 = v_V573.clone(); - rt::apply_direct(interp, "summation", &[__t1761, __t1764, __t1765])? - }); - } - } -} - -fn install_sin(interp: &mut Interp) { - interp.register_native("sin", 2, aot_sin); - interp.register_aot_direct("sin", aot_sin); -} - -/// AOT-compiled from KL `(defun tan ...)` -pub fn aot_tan(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "tan: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V578 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V579 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1768 = { - let __t1766 = v_V578.clone(); - let __t1767 = v_V579.clone(); - rt::apply_direct(interp, "sin", &[__t1766, __t1767])? - }; - let __t1771 = { - let __t1769 = v_V578.clone(); - let __t1770 = v_V579.clone(); - rt::apply_direct(interp, "cos", &[__t1769, __t1770])? - }; - rt::div(&__t1768, &__t1771)? - }); - } -} - -fn install_tan(interp: &mut Interp) { - interp.register_native("tan", 2, aot_tan); - interp.register_aot_direct("tan", aot_tan); -} - -/// AOT-compiled from KL `(defun radians ...)` -pub fn aot_radians(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "radians: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V582 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1774 = { - let __t1772 = v_V582.clone(); - let __t1773 = Value::int(180i64); - rt::div(&__t1772, &__t1773)? - }; - let __t1775 = { rt::apply_direct(interp, "pi", &[])? }; - rt::mul(&__t1774, &__t1775)? - }); - } -} - -fn install_radians(interp: &mut Interp) { - interp.register_native("radians", 1, aot_radians); - interp.register_aot_direct("radians", aot_radians); -} - -/// AOT-compiled from KL `(defun g ...)` -pub fn aot_g(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "g: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(1.6180339887498f64)); - } -} - -fn install_g(interp: &mut Interp) { - interp.register_native("g", 0, aot_g); - interp.register_aot_direct("g", aot_g); -} - -/// AOT-compiled from KL `(defun pi ...)` -pub fn aot_pi(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "pi: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(3.1415926535897f64)); - } -} - -fn install_pi(interp: &mut Interp) { - interp.register_native("pi", 0, aot_pi); - interp.register_aot_direct("pi", aot_pi); -} - -/// AOT-compiled from KL `(defun e ...)` -pub fn aot_e(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "e: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(2.7182818284590002f64)); - } -} - -fn install_e(interp: &mut Interp) { - interp.register_native("e", 0, aot_e); - interp.register_aot_direct("e", aot_e); -} - -/// AOT-compiled from KL `(defun tan30 ...)` -pub fn aot_tan30(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "tan30: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.5773502691896f64)); - } -} - -fn install_tan30(interp: &mut Interp) { - interp.register_native("tan30", 0, aot_tan30); - interp.register_aot_direct("tan30", aot_tan30); -} - -/// AOT-compiled from KL `(defun cos30 ...)` -pub fn aot_cos30(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "cos30: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.8660254037844001f64)); - } -} - -fn install_cos30(interp: &mut Interp) { - interp.register_native("cos30", 0, aot_cos30); - interp.register_aot_direct("cos30", aot_cos30); -} - -/// AOT-compiled from KL `(defun cos45 ...)` -pub fn aot_cos45(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "cos45: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.70710678118651f64)); - } -} - -fn install_cos45(interp: &mut Interp) { - interp.register_native("cos45", 0, aot_cos45); - interp.register_aot_direct("cos45", aot_cos45); -} - -/// AOT-compiled from KL `(defun sin45 ...)` -pub fn aot_sin45(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "sin45: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.7071067811865f64)); - } -} - -fn install_sin45(interp: &mut Interp) { - interp.register_native("sin45", 0, aot_sin45); - interp.register_aot_direct("sin45", aot_sin45); -} - -/// AOT-compiled from KL `(defun sqrt2 ...)` -pub fn aot_sqrt2(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "sqrt2: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(1.4142135623731f64)); - } -} - -fn install_sqrt2(interp: &mut Interp) { - interp.register_native("sqrt2", 0, aot_sqrt2); - interp.register_aot_direct("sqrt2", aot_sqrt2); -} - -/// AOT-compiled from KL `(defun tan60 ...)` -pub fn aot_tan60(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "tan60: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(1.7320508075692f64)); - } -} - -fn install_tan60(interp: &mut Interp) { - interp.register_native("tan60", 0, aot_tan60); - interp.register_aot_direct("tan60", aot_tan60); -} - -/// AOT-compiled from KL `(defun maths.sin60 ...)` -pub fn aot_maths_x2e_sin60(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "maths.sin60: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.8660254037844001f64)); - } -} - -fn install_maths_x2e_sin60(interp: &mut Interp) { - interp.register_native("maths.sin60", 0, aot_maths_x2e_sin60); - interp.register_aot_direct("maths.sin60", aot_maths_x2e_sin60); -} - -/// AOT-compiled from KL `(defun sin120 ...)` -pub fn aot_sin120(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "sin120: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.8660254037844001f64)); - } -} - -fn install_sin120(interp: &mut Interp) { - interp.register_native("sin120", 0, aot_sin120); - interp.register_aot_direct("sin120", aot_sin120); -} - -/// AOT-compiled from KL `(defun tan120 ...)` -pub fn aot_tan120(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "tan120: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-1.7320508075692f64)); - } -} - -fn install_tan120(interp: &mut Interp) { - interp.register_native("tan120", 0, aot_tan120); - interp.register_aot_direct("tan120", aot_tan120); -} - -/// AOT-compiled from KL `(defun sin135 ...)` -pub fn aot_sin135(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "sin135: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.7071067811865f64)); - } -} - -fn install_sin135(interp: &mut Interp) { - interp.register_native("sin135", 0, aot_sin135); - interp.register_aot_direct("sin135", aot_sin135); -} - -/// AOT-compiled from KL `(defun cos135 ...)` -pub fn aot_cos135(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "cos135: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.7071067811865f64)); - } -} - -fn install_cos135(interp: &mut Interp) { - interp.register_native("cos135", 0, aot_cos135); - interp.register_aot_direct("cos135", aot_cos135); -} - -/// AOT-compiled from KL `(defun cos150 ...)` -pub fn aot_cos150(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "cos150: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.8660254037844001f64)); - } -} - -fn install_cos150(interp: &mut Interp) { - interp.register_native("cos150", 0, aot_cos150); - interp.register_aot_direct("cos150", aot_cos150); -} - -/// AOT-compiled from KL `(defun tan150 ...)` -pub fn aot_tan150(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "tan150: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.5773502691905f64)); - } -} - -fn install_tan150(interp: &mut Interp) { - interp.register_native("tan150", 0, aot_tan150); - interp.register_aot_direct("tan150", aot_tan150); -} - -/// AOT-compiled from KL `(defun cos210 ...)` -pub fn aot_cos210(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "cos210: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.8660254037844001f64)); - } -} - -fn install_cos210(interp: &mut Interp) { - interp.register_native("cos210", 0, aot_cos210); - interp.register_aot_direct("cos210", aot_cos210); -} - -/// AOT-compiled from KL `(defun tan210 ...)` -pub fn aot_tan210(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "tan210: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.5773502691905f64)); - } -} - -fn install_tan210(interp: &mut Interp) { - interp.register_native("tan210", 0, aot_tan210); - interp.register_aot_direct("tan210", aot_tan210); -} - -/// AOT-compiled from KL `(defun sin225 ...)` -pub fn aot_sin225(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "sin225: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.7071067811865f64)); - } -} - -fn install_sin225(interp: &mut Interp) { - interp.register_native("sin225", 0, aot_sin225); - interp.register_aot_direct("sin225", aot_sin225); -} - -/// AOT-compiled from KL `(defun cos225 ...)` -pub fn aot_cos225(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "cos225: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.7071067811865f64)); - } -} - -fn install_cos225(interp: &mut Interp) { - interp.register_native("cos225", 0, aot_cos225); - interp.register_aot_direct("cos225", aot_cos225); -} - -/// AOT-compiled from KL `(defun sin240 ...)` -pub fn aot_sin240(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "sin240: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.8660254037844001f64)); - } -} - -fn install_sin240(interp: &mut Interp) { - interp.register_native("sin240", 0, aot_sin240); - interp.register_aot_direct("sin240", aot_sin240); -} - -/// AOT-compiled from KL `(defun tan240 ...)` -pub fn aot_tan240(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "tan240: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(1.7320508075692f64)); - } -} - -fn install_tan240(interp: &mut Interp) { - interp.register_native("tan240", 0, aot_tan240); - interp.register_aot_direct("tan240", aot_tan240); -} - -/// AOT-compiled from KL `(defun sin300 ...)` -pub fn aot_sin300(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "sin300: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.8660254037844001f64)); - } -} - -fn install_sin300(interp: &mut Interp) { - interp.register_native("sin300", 0, aot_sin300); - interp.register_aot_direct("sin300", aot_sin300); -} - -/// AOT-compiled from KL `(defun tan300 ...)` -pub fn aot_tan300(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "tan300: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-1.7320508075692f64)); - } -} - -fn install_tan300(interp: &mut Interp) { - interp.register_native("tan300", 0, aot_tan300); - interp.register_aot_direct("tan300", aot_tan300); -} - -/// AOT-compiled from KL `(defun sin315 ...)` -pub fn aot_sin315(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "sin315: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.7071067811865f64)); - } -} - -fn install_sin315(interp: &mut Interp) { - interp.register_native("sin315", 0, aot_sin315); - interp.register_aot_direct("sin315", aot_sin315); -} - -/// AOT-compiled from KL `(defun cos315 ...)` -pub fn aot_cos315(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "cos315: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.7071067811865f64)); - } -} - -fn install_cos315(interp: &mut Interp) { - interp.register_native("cos315", 0, aot_cos315); - interp.register_aot_direct("cos315", aot_cos315); -} - -/// AOT-compiled from KL `(defun cos330 ...)` -pub fn aot_cos330(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "cos330: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(0.8660254037844001f64)); - } -} - -fn install_cos330(interp: &mut Interp) { - interp.register_native("cos330", 0, aot_cos330); - interp.register_aot_direct("cos330", aot_cos330); -} - -/// AOT-compiled from KL `(defun tan330 ...)` -pub fn aot_tan330(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "tan330: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::float(-0.5773502691905f64)); - } -} - -fn install_tan330(interp: &mut Interp) { - interp.register_native("tan330", 0, aot_tan330); - interp.register_aot_direct("tan330", aot_tan330); -} - -/// AOT-compiled from KL `(defun coth ...)` -pub fn aot_coth(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "coth: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V584 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V585 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W586 = { rt::apply_direct(interp, "e", &[])? }; - { - let v_W587 = { - let __t1776 = v_W586.clone(); - let __t1780 = { - let __t1779 = { - let __t1777 = Value::int(2i64); - let __t1778 = v_V584.clone(); - rt::mul(&__t1777, &__t1778)? - }; - rt::apply_direct(interp, "~", &[__t1779])? - }; - let __t1781 = v_V585.clone(); - rt::apply_direct(interp, "expt", &[__t1776, __t1780, __t1781])? - }; - break Ok({ - let __t1784 = { - let __t1782 = Value::int(1i64); - let __t1783 = v_W587.clone(); - rt::add(&__t1782, &__t1783)? - }; - let __t1787 = { - let __t1785 = Value::int(1i64); - let __t1786 = v_W587.clone(); - rt::sub(&__t1785, &__t1786)? - }; - rt::div(&__t1784, &__t1787)? - }); - } - } - } -} - -fn install_coth(interp: &mut Interp) { - interp.register_native("coth", 2, aot_coth); - interp.register_aot_direct("coth", aot_coth); -} - -/// AOT-compiled from KL `(defun sinh ...)` -pub fn aot_sinh(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "sinh: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V590 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V591 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W592 = { rt::apply_direct(interp, "e", &[])? }; - { - let v_W593 = { - let __t1788 = v_W592.clone(); - let __t1789 = v_V590.clone(); - let __t1790 = v_V591.clone(); - rt::apply_direct(interp, "expt", &[__t1788, __t1789, __t1790])? - }; - { - let v_W594 = { - let __t1791 = v_W592.clone(); - let __t1793 = { - let __t1792 = v_V590.clone(); - rt::apply_direct(interp, "~", &[__t1792])? - }; - let __t1794 = v_V591.clone(); - rt::apply_direct(interp, "expt", &[__t1791, __t1793, __t1794])? - }; - { - let v_W595 = { - let __t1795 = v_W593.clone(); - let __t1796 = v_W594.clone(); - rt::sub(&__t1795, &__t1796)? - }; - break Ok({ - let __t1797 = v_W595.clone(); - let __t1798 = Value::int(2i64); - rt::div(&__t1797, &__t1798)? - }); - } - } - } - } - } -} - -fn install_sinh(interp: &mut Interp) { - interp.register_native("sinh", 2, aot_sinh); - interp.register_aot_direct("sinh", aot_sinh); -} - -/// AOT-compiled from KL `(defun cosh ...)` -pub fn aot_cosh(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "cosh: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V598 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V599 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W600 = { rt::apply_direct(interp, "e", &[])? }; - { - let v_W601 = { - let __t1799 = v_W600.clone(); - let __t1800 = v_V598.clone(); - let __t1801 = v_V599.clone(); - rt::apply_direct(interp, "expt", &[__t1799, __t1800, __t1801])? - }; - { - let v_W602 = { - let __t1802 = v_W600.clone(); - let __t1804 = { - let __t1803 = v_V598.clone(); - rt::apply_direct(interp, "~", &[__t1803])? - }; - let __t1805 = v_V599.clone(); - rt::apply_direct(interp, "expt", &[__t1802, __t1804, __t1805])? - }; - { - let v_W603 = { - let __t1806 = v_W601.clone(); - let __t1807 = v_W602.clone(); - rt::add(&__t1806, &__t1807)? - }; - break Ok({ - let __t1808 = v_W603.clone(); - let __t1809 = Value::int(2i64); - rt::div(&__t1808, &__t1809)? - }); - } - } - } - } - } -} - -fn install_cosh(interp: &mut Interp) { - interp.register_native("cosh", 2, aot_cosh); - interp.register_aot_direct("cosh", aot_cosh); -} - -/// AOT-compiled from KL `(defun tanh ...)` -pub fn aot_tanh(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "tanh: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V606 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V607 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1812 = { - let __t1810 = v_V606.clone(); - let __t1811 = v_V607.clone(); - rt::apply_direct(interp, "sinh", &[__t1810, __t1811])? - }; - let __t1815 = { - let __t1813 = v_V606.clone(); - let __t1814 = v_V607.clone(); - rt::apply_direct(interp, "cosh", &[__t1813, __t1814])? - }; - rt::div(&__t1812, &__t1815)? - }); - } -} - -fn install_tanh(interp: &mut Interp) { - interp.register_native("tanh", 2, aot_tanh); - interp.register_aot_direct("tanh", aot_tanh); -} - -/// AOT-compiled from KL `(defun sech ...)` -pub fn aot_sech(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "sech: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V610 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V611 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1816 = Value::int(1i64); - let __t1819 = { - let __t1817 = v_V610.clone(); - let __t1818 = v_V611.clone(); - rt::apply_direct(interp, "cosh", &[__t1817, __t1818])? - }; - rt::div(&__t1816, &__t1819)? - }); - } -} - -fn install_sech(interp: &mut Interp) { - interp.register_native("sech", 2, aot_sech); - interp.register_aot_direct("sech", aot_sech); -} - -/// AOT-compiled from KL `(defun csch ...)` -pub fn aot_csch(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "csch: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V614 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V615 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1820 = Value::int(1i64); - let __t1823 = { - let __t1821 = v_V614.clone(); - let __t1822 = v_V615.clone(); - rt::apply_direct(interp, "sinh", &[__t1821, __t1822])? - }; - rt::div(&__t1820, &__t1823)? - }); - } -} - -fn install_csch(interp: &mut Interp) { - interp.register_native("csch", 2, aot_csch); - interp.register_aot_direct("csch", aot_csch); -} - -/// AOT-compiled from KL `(defun power ...)` -pub fn aot_power(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "power: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V620 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V621 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1833 = { - let __t1831 = Value::int(0i64); - let __t1832 = v_V621.clone(); - rt::eq(&__t1831, &__t1832) - }; - if match rt::is_truthy(interp, &__t1833) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(1i64)); - } else { - { - let __t1830 = Value::bool(true); - if match rt::is_truthy(interp, &__t1830) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1824 = v_V620.clone(); - let __t1829 = { - let __t1825 = v_V620.clone(); - let __t1828 = { - let __t1826 = v_V621.clone(); - let __t1827 = Value::int(1i64); - rt::sub(&__t1826, &__t1827)? - }; - rt::apply_direct(interp, "power", &[__t1825, __t1828])? - }; - rt::mul(&__t1824, &__t1829)? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_power(interp: &mut Interp) { - interp.register_native("power", 2, aot_power); - interp.register_aot_direct("power", aot_power); -} - -/// AOT-compiled from KL `(defun factorial ...)` -pub fn aot_factorial(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "factorial: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V624 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1842 = { - let __t1840 = Value::int(0i64); - let __t1841 = v_V624.clone(); - rt::eq(&__t1840, &__t1841) - }; - if match rt::is_truthy(interp, &__t1842) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(1i64)); - } else { - { - let __t1839 = Value::bool(true); - if match rt::is_truthy(interp, &__t1839) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1834 = v_V624.clone(); - let __t1838 = { - let __t1837 = { - let __t1835 = v_V624.clone(); - let __t1836 = Value::int(1i64); - rt::sub(&__t1835, &__t1836)? - }; - rt::apply_direct(interp, "factorial", &[__t1837])? - }; - rt::mul(&__t1834, &__t1838)? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_factorial(interp: &mut Interp) { - interp.register_native("factorial", 1, aot_factorial); - interp.register_aot_direct("factorial", aot_factorial); -} - -/// AOT-compiled from KL `(defun prime? ...)` -pub fn aot_prime_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "prime?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V626 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1852 = { - let __t1850 = Value::int(2i64); - let __t1851 = v_V626.clone(); - rt::eq(&__t1850, &__t1851) - }; - if match rt::is_truthy(interp, &__t1852) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t1849 = { - let __t1848 = v_V626.clone(); - rt::apply_direct(interp, "even?", &[__t1848])? - }; - if match rt::is_truthy(interp, &__t1849) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t1847 = Value::bool(true); - if match rt::is_truthy(interp, &__t1847) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1843 = v_V626.clone(); - let __t1845 = { - let __t1844 = v_V626.clone(); - rt::apply_direct(interp, "isqrt", &[__t1844])? - }; - let __t1846 = Value::int(3i64); - rt::apply_direct( - interp, - "maths.prime-h", - &[__t1843, __t1845, __t1846], - )? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_prime_x3f_(interp: &mut Interp) { - interp.register_native("prime?", 1, aot_prime_x3f_); - interp.register_aot_direct("prime?", aot_prime_x3f_); -} - -/// AOT-compiled from KL `(defun maths.prime-h ...)` -pub fn aot_maths_x2e_prime_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "maths.prime-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V629 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V630 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V631 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1865 = { - let __t1863 = v_V631.clone(); - let __t1864 = v_V630.clone(); - rt::gt(&__t1863, &__t1864)? - }; - if match rt::is_truthy(interp, &__t1865) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t1862 = { - let __t1861 = { - let __t1859 = v_V629.clone(); - let __t1860 = v_V631.clone(); - rt::div(&__t1859, &__t1860)? - }; - rt::apply_direct(interp, "integer?", &[__t1861])? - }; - if match rt::is_truthy(interp, &__t1862) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t1858 = Value::bool(true); - if match rt::is_truthy(interp, &__t1858) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t1853 = v_V629.clone(); - let __t1854 = v_V630.clone(); - let __t1857 = { - let __t1855 = v_V631.clone(); - let __t1856 = Value::int(2i64); - rt::add(&__t1855, &__t1856)? - }; - v_V629 = __t1853; - v_V630 = __t1854; - v_V631 = __t1857; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_maths_x2e_prime_x2d_h(interp: &mut Interp) { - interp.register_native("maths.prime-h", 3, aot_maths_x2e_prime_x2d_h); - interp.register_aot_direct("maths.prime-h", aot_maths_x2e_prime_x2d_h); -} - -/// AOT-compiled from KL `(defun maths.sign ...)` -pub fn aot_maths_x2e_sign(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "maths.sign: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V637 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1871 = { - let __t1869 = Value::int(0i64); - let __t1870 = v_V637.clone(); - rt::eq(&__t1869, &__t1870) - }; - if match rt::is_truthy(interp, &__t1871) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(0i64)); - } else { - { - let __t1868 = { - let __t1867 = v_V637.clone(); - rt::apply_direct(interp, "positive?", &[__t1867])? - }; - if match rt::is_truthy(interp, &__t1868) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(1i64)); - } else { - { - let __t1866 = Value::bool(true); - if match rt::is_truthy(interp, &__t1866) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(-1i64)); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_maths_x2e_sign(interp: &mut Interp) { - interp.register_native("maths.sign", 1, aot_maths_x2e_sign); - interp.register_aot_direct("maths.sign", aot_maths_x2e_sign); -} - -/// AOT-compiled from KL `(defun log ...)` -pub fn aot_log(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "log: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V639 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V640 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V641 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1874 = { - let __t1872 = v_V639.clone(); - let __t1873 = v_V641.clone(); - rt::apply_direct(interp, "log10", &[__t1872, __t1873])? - }; - let __t1877 = { - let __t1875 = v_V640.clone(); - let __t1876 = v_V641.clone(); - rt::apply_direct(interp, "log10", &[__t1875, __t1876])? - }; - rt::div(&__t1874, &__t1877)? - }); - } -} - -fn install_log(interp: &mut Interp) { - interp.register_native("log", 3, aot_log); - interp.register_aot_direct("log", aot_log); -} - -/// AOT-compiled from KL `(defun loge ...)` -pub fn aot_loge(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "loge: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V645 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V646 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1878 = v_V645.clone(); - let __t1879 = { rt::apply_direct(interp, "e", &[])? }; - let __t1880 = v_V646.clone(); - rt::apply_direct(interp, "log", &[__t1878, __t1879, __t1880])? - }); - } -} - -fn install_loge(interp: &mut Interp) { - interp.register_native("loge", 2, aot_loge); - interp.register_aot_direct("loge", aot_loge); -} - -/// AOT-compiled from KL `(defun log2 ...)` -pub fn aot_log2(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "log2: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V649 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V650 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1881 = v_V649.clone(); - let __t1882 = Value::int(2i64); - let __t1883 = v_V650.clone(); - rt::apply_direct(interp, "log", &[__t1881, __t1882, __t1883])? - }); - } -} - -fn install_log2(interp: &mut Interp) { - interp.register_native("log2", 2, aot_log2); - interp.register_aot_direct("log2", aot_log2); -} - -/// AOT-compiled from KL `(defun log10 ...)` -pub fn aot_log10(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "log10: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V653 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V654 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1886 = { - let __t1884 = v_V653.clone(); - let __t1885 = Value::int(1i64); - rt::gte(&__t1884, &__t1885)? - }; - if match rt::is_truthy(interp, &__t1886) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1887 = v_V653.clone(); - let __t1888 = v_V654.clone(); - rt::apply_direct(interp, "maths.log10+", &[__t1887, __t1888])? - }); - } else { - break Ok({ - let __t1893 = { - let __t1891 = { - let __t1889 = Value::int(1i64); - let __t1890 = v_V653.clone(); - rt::div(&__t1889, &__t1890)? - }; - let __t1892 = v_V654.clone(); - rt::apply_direct(interp, "maths.log10+", &[__t1891, __t1892])? - }; - rt::apply_direct(interp, "~", &[__t1893])? - }); - } - } - } -} - -fn install_log10(interp: &mut Interp) { - interp.register_native("log10", 2, aot_log10); - interp.register_aot_direct("log10", aot_log10); -} - -/// AOT-compiled from KL `(defun maths.log10+ ...)` -pub fn aot_maths_x2e_log10_x2b_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "maths.log10+: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V657 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V658 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1915 = { - let __t1913 = { - let __t1912 = v_V657.clone(); - rt::apply_direct(interp, "abs", &[__t1912])? - }; - let __t1914 = v_V658.clone(); - rt::lte(&__t1913, &__t1914)? - }; - if match rt::is_truthy(interp, &__t1915) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(0i64)); - } else { - { - let __t1911 = { - let __t1903 = v_V657.clone(); - let __t1904 = Value::int(10i64); - rt::gte(&__t1903, &__t1904)? - }; - if match rt::is_truthy(interp, &__t1911) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1905 = Value::int(1i64); - let __t1910 = { - let __t1908 = { - let __t1906 = v_V657.clone(); - let __t1907 = Value::int(10i64); - rt::div(&__t1906, &__t1907)? - }; - let __t1909 = v_V658.clone(); - rt::apply_direct(interp, "maths.log10+", &[__t1908, __t1909])? - }; - rt::add(&__t1905, &__t1910)? - }); - } else { - { - let __t1902 = Value::bool(true); - if match rt::is_truthy(interp, &__t1902) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1894 = Value::float(0.1f64); - let __t1901 = { - let __t1897 = { - let __t1895 = v_V657.clone(); - let __t1896 = Value::int(10i64); - rt::apply_direct(interp, "power", &[__t1895, __t1896])? - }; - let __t1900 = { - let __t1898 = Value::int(10i64); - let __t1899 = v_V658.clone(); - rt::mul(&__t1898, &__t1899)? - }; - rt::apply_direct( - interp, - "maths.log10+", - &[__t1897, __t1900], - )? - }; - rt::mul(&__t1894, &__t1901)? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_maths_x2e_log10_x2b_(interp: &mut Interp) { - interp.register_native("maths.log10+", 2, aot_maths_x2e_log10_x2b_); - interp.register_aot_direct("maths.log10+", aot_maths_x2e_log10_x2b_); -} - -/// AOT-compiled from KL `(defun r# ...)` -pub fn aot_r_x23_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r#: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V667 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V668 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t1942 = { - let __t1930 = { - let __t1928 = v_V667.clone(); - rt::apply_direct(interp, "integer?", &[__t1928])? - }; - if !rt::is_truthy(interp, &__t1930)? { - Value::bool(false) - } else { - let __t1931 = { - let __t1929 = v_V668.clone(); - rt::apply_direct(interp, "integer?", &[__t1929])? - }; - Value::bool(rt::is_truthy(interp, &__t1931)?) - } - }; - if match rt::is_truthy(interp, &__t1942) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W669 = { - let __t1932 = Value::int(3i64); - rt::apply_direct(interp, "absvector", &[__t1932])? - }; - { - let v_W670 = { - let __t1933 = v_W669.clone(); - let __t1934 = Value::int(0i64); - let __t1935 = Value::sym(interp.intern("rational.print-rational")); - rt::apply_direct(interp, "address->", &[__t1933, __t1934, __t1935])? - }; - { - let v_W671 = { - let __t1936 = v_W669.clone(); - let __t1937 = Value::int(1i64); - let __t1938 = v_V667.clone(); - rt::apply_direct(interp, "address->", &[__t1936, __t1937, __t1938])? - }; - { - let v_W672 = { - let __t1939 = v_W669.clone(); - let __t1940 = Value::int(2i64); - let __t1941 = v_V668.clone(); - rt::apply_direct( - interp, - "address->", - &[__t1939, __t1940, __t1941], - )? - }; - break Ok(v_W669.clone()); - } - } - } - } - } else { - { - let __t1927 = Value::bool(true); - if match rt::is_truthy(interp, &__t1927) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t1926 = { - let __t1916 = Value::str("numerator "); - let __t1925 = { - let __t1917 = v_V667.clone(); - let __t1923 = { - let __t1918 = Value::str(" and divisor "); - let __t1922 = { - let __t1919 = v_V668.clone(); - let __t1920 = Value::str(" must be integers\n"); - let __t1921 = Value::sym(interp.intern("shen.s")); - rt::apply_direct( - interp, - "shen.app", - &[__t1919, __t1920, __t1921], - )? - }; - rt::apply_direct(interp, "cn", &[__t1918, __t1922])? - }; - let __t1924 = Value::sym(interp.intern("shen.s")); - rt::apply_direct( - interp, - "shen.app", - &[__t1917, __t1923, __t1924], - )? - }; - rt::apply_direct(interp, "cn", &[__t1916, __t1925])? - }; - rt::apply_direct(interp, "simple-error", &[__t1926])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_r_x23_(interp: &mut Interp) { - interp.register_native("r#", 2, aot_r_x23_); - interp.register_aot_direct("r#", aot_r_x23_); -} - -/// AOT-compiled from KL `(defun rational.print-rational ...)` -pub fn aot_rational_x2e_print_x2d_rational( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "rational.print-rational: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V675 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1945 = { - let __t1943 = v_V675.clone(); - let __t1944 = Value::int(1i64); - rt::apply_direct(interp, "<-address", &[__t1943, __t1944])? - }; - let __t1953 = { - let __t1946 = Value::str("/"); - let __t1952 = { - let __t1949 = { - let __t1947 = v_V675.clone(); - let __t1948 = Value::int(2i64); - rt::apply_direct(interp, "<-address", &[__t1947, __t1948])? - }; - let __t1950 = Value::str(""); - let __t1951 = Value::sym(interp.intern("shen.s")); - rt::apply_direct(interp, "shen.app", &[__t1949, __t1950, __t1951])? - }; - rt::apply_direct(interp, "cn", &[__t1946, __t1952])? - }; - let __t1954 = Value::sym(interp.intern("shen.s")); - rt::apply_direct(interp, "shen.app", &[__t1945, __t1953, __t1954])? - }); - } -} - -fn install_rational_x2e_print_x2d_rational(interp: &mut Interp) { - interp.register_native( - "rational.print-rational", - 1, - aot_rational_x2e_print_x2d_rational, - ); - interp.register_aot_direct( - "rational.print-rational", - aot_rational_x2e_print_x2d_rational, - ); -} - -/// AOT-compiled from KL `(defun rational? ...)` -pub fn aot_rational_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "rational?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V677 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok( - match (|| -> ShenResult { - Ok({ - let __t1970 = { - let __t1955 = v_V677.clone(); - rt::is_absvector(&__t1955) - }; - if !rt::is_truthy(interp, &__t1970)? { - Value::bool(false) - } else { - let __t1971 = { - let __t1968 = { - let __t1958 = { - let __t1956 = v_V677.clone(); - let __t1957 = Value::int(0i64); - rt::apply_direct(interp, "<-address", &[__t1956, __t1957])? - }; - let __t1959 = Value::sym(interp.intern("rational.print-rational")); - rt::eq(&__t1958, &__t1959) - }; - if !rt::is_truthy(interp, &__t1968)? { - Value::bool(false) - } else { - let __t1969 = { - let __t1966 = { - let __t1962 = { - let __t1960 = v_V677.clone(); - let __t1961 = Value::int(1i64); - rt::apply_direct( - interp, - "<-address", - &[__t1960, __t1961], - )? - }; - rt::apply_direct(interp, "integer?", &[__t1962])? - }; - if !rt::is_truthy(interp, &__t1966)? { - Value::bool(false) - } else { - let __t1967 = { - let __t1965 = { - let __t1963 = v_V677.clone(); - let __t1964 = Value::int(2i64); - rt::apply_direct( - interp, - "<-address", - &[__t1963, __t1964], - )? - }; - rt::apply_direct(interp, "integer?", &[__t1965])? - }; - Value::bool(rt::is_truthy(interp, &__t1967)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1969)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t1971)?) - } - }) - })() { - Ok(v) => v, - Err(e) => { - let __h = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z678 = args[0].clone(); - Ok(Value::bool(false)) - }, - Vec::new(), - interp, - ) - }; - let __err = Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - }, - ); - } -} - -fn install_rational_x3f_(interp: &mut Interp) { - interp.register_native("rational?", 1, aot_rational_x3f_); - interp.register_aot_direct("rational?", aot_rational_x3f_); -} - -/// AOT-compiled from KL `(defun numerator ...)` -pub fn aot_numerator(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "numerator: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V680 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1972 = v_V680.clone(); - let __t1973 = Value::int(1i64); - rt::apply_direct(interp, "<-address", &[__t1972, __t1973])? - }); - } -} - -fn install_numerator(interp: &mut Interp) { - interp.register_native("numerator", 1, aot_numerator); - interp.register_aot_direct("numerator", aot_numerator); -} - -/// AOT-compiled from KL `(defun denominator ...)` -pub fn aot_denominator(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "denominator: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V682 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1974 = v_V682.clone(); - let __t1975 = Value::int(2i64); - rt::apply_direct(interp, "<-address", &[__t1974, __t1975])? - }); - } -} - -fn install_denominator(interp: &mut Interp) { - interp.register_native("denominator", 1, aot_denominator); - interp.register_aot_direct("denominator", aot_denominator); -} - -/// AOT-compiled from KL `(defun r-op1 ...)` -pub fn aot_r_x2d_op1(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r-op1: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V722 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V723 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1978 = { - let __t1977 = { - let __t1976 = v_V723.clone(); - rt::apply_direct(interp, "r->n", &[__t1976])? - }; - rt::apply_value(interp, v_V722.clone(), &[__t1977])? - }; - rt::apply_direct(interp, "n->r", &[__t1978])? - }); - } -} - -fn install_r_x2d_op1(interp: &mut Interp) { - interp.register_native("r-op1", 2, aot_r_x2d_op1); - interp.register_aot_direct("r-op1", aot_r_x2d_op1); -} - -/// AOT-compiled from KL `(defun r-op2 ...)` -pub fn aot_r_x2d_op2(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "r-op2: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V726 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V727 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V728 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1984 = { - let __t1981 = { - let __t1980 = { - let __t1979 = v_V727.clone(); - rt::apply_direct(interp, "r->n", &[__t1979])? - }; - rt::apply_value(interp, v_V726.clone(), &[__t1980])? - }; - let __t1983 = { - let __t1982 = v_V728.clone(); - rt::apply_direct(interp, "r->n", &[__t1982])? - }; - rt::apply_value(interp, __t1981, &[__t1983])? - }; - rt::apply_direct(interp, "n->r", &[__t1984])? - }); - } -} - -fn install_r_x2d_op2(interp: &mut Interp) { - interp.register_native("r-op2", 3, aot_r_x2d_op2); - interp.register_aot_direct("r-op2", aot_r_x2d_op2); -} - -/// AOT-compiled from KL `(defun r->n ...)` -pub fn aot_r_x2d__x3e_n(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "r->n: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V732 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1986 = { - let __t1985 = v_V732.clone(); - rt::apply_direct(interp, "numerator", &[__t1985])? - }; - let __t1988 = { - let __t1987 = v_V732.clone(); - rt::apply_direct(interp, "denominator", &[__t1987])? - }; - rt::div(&__t1986, &__t1988)? - }); - } -} - -fn install_r_x2d__x3e_n(interp: &mut Interp) { - interp.register_native("r->n", 1, aot_r_x2d__x3e_n); - interp.register_aot_direct("r->n", aot_r_x2d__x3e_n); -} - -/// AOT-compiled from KL `(defun r->pair ...)` -pub fn aot_r_x2d__x3e_pair(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "r->pair: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V734 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t1990 = { - let __t1989 = v_V734.clone(); - rt::apply_direct(interp, "numerator", &[__t1989])? - }; - let __t1992 = { - let __t1991 = v_V734.clone(); - rt::apply_direct(interp, "denominator", &[__t1991])? - }; - rt::apply_direct(interp, "@p", &[__t1990, __t1992])? - }); - } -} - -fn install_r_x2d__x3e_pair(interp: &mut Interp) { - interp.register_native("r->pair", 1, aot_r_x2d__x3e_pair); - interp.register_aot_direct("r->pair", aot_r_x2d__x3e_pair); -} - -/// AOT-compiled from KL `(defun n->r ...)` -pub fn aot_n_x2d__x3e_r(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "n->r: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V736 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W737 = { - let __t1993 = v_V736.clone(); - let __t1994 = Value::int(1i64); - rt::apply_direct(interp, "maths.n->r", &[__t1993, __t1994])? - }; - break Ok({ - let __t1996 = { - let __t1995 = v_W737.clone(); - rt::apply_direct(interp, "fst", &[__t1995])? - }; - let __t1998 = { - let __t1997 = v_W737.clone(); - rt::apply_direct(interp, "snd", &[__t1997])? - }; - rt::apply_direct(interp, "r#", &[__t1996, __t1998])? - }); - } - } -} - -fn install_n_x2d__x3e_r(interp: &mut Interp) { - interp.register_native("n->r", 1, aot_n_x2d__x3e_r); - interp.register_aot_direct("n->r", aot_n_x2d__x3e_r); -} - -/// AOT-compiled from KL `(defun r-reduce ...)` -pub fn aot_r_x2d_reduce(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "r-reduce: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V739 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2000 = { - let __t1999 = v_V739.clone(); - rt::apply_direct(interp, "numerator", &[__t1999])? - }; - let __t2002 = { - let __t2001 = v_V739.clone(); - rt::apply_direct(interp, "denominator", &[__t2001])? - }; - rt::apply_direct(interp, "rational.r-reduce-help", &[__t2000, __t2002])? - }); - } -} - -fn install_r_x2d_reduce(interp: &mut Interp) { - interp.register_native("r-reduce", 1, aot_r_x2d_reduce); - interp.register_aot_direct("r-reduce", aot_r_x2d_reduce); -} - -/// AOT-compiled from KL `(defun rational.r-reduce-help ...)` -pub fn aot_rational_x2e_r_x2d_reduce_x2d_help( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "rational.r-reduce-help: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V741 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V742 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W743 = { - let __t2003 = v_V741.clone(); - let __t2004 = v_V742.clone(); - rt::apply_direct(interp, "lcd", &[__t2003, __t2004])? - }; - { - let __t2007 = { - let __t2005 = v_W743.clone(); - let __t2006 = Value::int(1i64); - rt::eq(&__t2005, &__t2006) - }; - if match rt::is_truthy(interp, &__t2007) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2008 = v_V741.clone(); - let __t2009 = v_V742.clone(); - rt::apply_direct(interp, "r#", &[__t2008, __t2009])? - }); - } else { - { - let __t2012 = { - let __t2010 = v_V741.clone(); - let __t2011 = v_W743.clone(); - rt::div(&__t2010, &__t2011)? - }; - let __t2015 = { - let __t2013 = v_V742.clone(); - let __t2014 = v_W743.clone(); - rt::div(&__t2013, &__t2014)? - }; - v_V741 = __t2012; - v_V742 = __t2015; - continue; - } - } - } - } - } -} - -fn install_rational_x2e_r_x2d_reduce_x2d_help(interp: &mut Interp) { - interp.register_native( - "rational.r-reduce-help", - 2, - aot_rational_x2e_r_x2d_reduce_x2d_help, - ); - interp.register_aot_direct( - "rational.r-reduce-help", - aot_rational_x2e_r_x2d_reduce_x2d_help, - ); -} - -/// AOT-compiled from KL `(defun r= ...)` -pub fn aot_r_x3d_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r=: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V746 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V747 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W748 = { - let __t2016 = v_V746.clone(); - rt::apply_direct(interp, "numerator", &[__t2016])? - }; - { - let v_W749 = { - let __t2017 = v_V746.clone(); - rt::apply_direct(interp, "denominator", &[__t2017])? - }; - { - let v_W750 = { - let __t2018 = v_V747.clone(); - rt::apply_direct(interp, "numerator", &[__t2018])? - }; - { - let v_W751 = { - let __t2019 = v_V747.clone(); - rt::apply_direct(interp, "denominator", &[__t2019])? - }; - break Ok({ - let __t2022 = { - let __t2020 = v_W748.clone(); - let __t2021 = v_W751.clone(); - rt::mul(&__t2020, &__t2021)? - }; - let __t2025 = { - let __t2023 = v_W749.clone(); - let __t2024 = v_W750.clone(); - rt::mul(&__t2023, &__t2024)? - }; - rt::eq(&__t2022, &__t2025) - }); - } - } - } - } - } -} - -fn install_r_x3d_(interp: &mut Interp) { - interp.register_native("r=", 2, aot_r_x3d_); - interp.register_aot_direct("r=", aot_r_x3d_); -} - -/// AOT-compiled from KL `(defun r< ...)` -pub fn aot_r_x3c_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r<: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V754 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V755 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W756 = { - let __t2026 = v_V754.clone(); - rt::apply_direct(interp, "numerator", &[__t2026])? - }; - { - let v_W757 = { - let __t2027 = v_V754.clone(); - rt::apply_direct(interp, "denominator", &[__t2027])? - }; - { - let v_W758 = { - let __t2028 = v_V755.clone(); - rt::apply_direct(interp, "numerator", &[__t2028])? - }; - { - let v_W759 = { - let __t2029 = v_V755.clone(); - rt::apply_direct(interp, "denominator", &[__t2029])? - }; - break Ok({ - let __t2032 = { - let __t2030 = v_W756.clone(); - let __t2031 = v_W759.clone(); - rt::mul(&__t2030, &__t2031)? - }; - let __t2035 = { - let __t2033 = v_W757.clone(); - let __t2034 = v_W758.clone(); - rt::mul(&__t2033, &__t2034)? - }; - rt::lt(&__t2032, &__t2035)? - }); - } - } - } - } - } -} - -fn install_r_x3c_(interp: &mut Interp) { - interp.register_native("r<", 2, aot_r_x3c_); - interp.register_aot_direct("r<", aot_r_x3c_); -} - -/// AOT-compiled from KL `(defun r> ...)` -pub fn aot_r_x3e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r>: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V762 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V763 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2042 = { - let __t2040 = { - let __t2036 = v_V762.clone(); - let __t2037 = v_V763.clone(); - rt::apply_direct(interp, "r=", &[__t2036, __t2037])? - }; - if rt::is_truthy(interp, &__t2040)? { - Value::bool(true) - } else { - let __t2041 = { - let __t2038 = v_V762.clone(); - let __t2039 = v_V763.clone(); - rt::apply_direct(interp, "r<", &[__t2038, __t2039])? - }; - Value::bool(rt::is_truthy(interp, &__t2041)?) - } - }; - rt::apply_direct(interp, "not", &[__t2042])? - }); - } -} - -fn install_r_x3e_(interp: &mut Interp) { - interp.register_native("r>", 2, aot_r_x3e_); - interp.register_aot_direct("r>", aot_r_x3e_); -} - -/// AOT-compiled from KL `(defun r>= ...)` -pub fn aot_r_x3e__x3d_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r>=: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V766 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V767 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2045 = { - let __t2043 = v_V766.clone(); - let __t2044 = v_V767.clone(); - rt::apply_direct(interp, "r=", &[__t2043, __t2044])? - }; - if match rt::is_truthy(interp, &__t2045) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - break Ok({ - let __t2046 = v_V766.clone(); - let __t2047 = v_V767.clone(); - rt::apply_direct(interp, "r>", &[__t2046, __t2047])? - }); - } - } - } -} - -fn install_r_x3e__x3d_(interp: &mut Interp) { - interp.register_native("r>=", 2, aot_r_x3e__x3d_); - interp.register_aot_direct("r>=", aot_r_x3e__x3d_); -} - -/// AOT-compiled from KL `(defun r<= ...)` -pub fn aot_r_x3c__x3d_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r<=: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V770 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V771 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2050 = { - let __t2048 = v_V770.clone(); - let __t2049 = v_V771.clone(); - rt::apply_direct(interp, "r=", &[__t2048, __t2049])? - }; - if match rt::is_truthy(interp, &__t2050) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - break Ok({ - let __t2051 = v_V770.clone(); - let __t2052 = v_V771.clone(); - rt::apply_direct(interp, "r<", &[__t2051, __t2052])? - }); - } - } - } -} - -fn install_r_x3c__x3d_(interp: &mut Interp) { - interp.register_native("r<=", 2, aot_r_x3c__x3d_); - interp.register_aot_direct("r<=", aot_r_x3c__x3d_); -} - -/// AOT-compiled from KL `(defun r+ ...)` -pub fn aot_r_x2b_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r+: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V774 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V775 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W776 = { - let __t2053 = v_V774.clone(); - rt::apply_direct(interp, "numerator", &[__t2053])? - }; - { - let v_W777 = { - let __t2054 = v_V774.clone(); - rt::apply_direct(interp, "denominator", &[__t2054])? - }; - { - let v_W778 = { - let __t2055 = v_V775.clone(); - rt::apply_direct(interp, "numerator", &[__t2055])? - }; - { - let v_W779 = { - let __t2056 = v_V775.clone(); - rt::apply_direct(interp, "denominator", &[__t2056])? - }; - break Ok({ - let __t2063 = { - let __t2059 = { - let __t2057 = v_W776.clone(); - let __t2058 = v_W779.clone(); - rt::mul(&__t2057, &__t2058)? - }; - let __t2062 = { - let __t2060 = v_W777.clone(); - let __t2061 = v_W778.clone(); - rt::mul(&__t2060, &__t2061)? - }; - rt::add(&__t2059, &__t2062)? - }; - let __t2066 = { - let __t2064 = v_W777.clone(); - let __t2065 = v_W779.clone(); - rt::mul(&__t2064, &__t2065)? - }; - rt::apply_direct(interp, "r#", &[__t2063, __t2066])? - }); - } - } - } - } - } -} - -fn install_r_x2b_(interp: &mut Interp) { - interp.register_native("r+", 2, aot_r_x2b_); - interp.register_aot_direct("r+", aot_r_x2b_); -} - -/// AOT-compiled from KL `(defun r- ...)` -pub fn aot_r_x2d_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r-: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V782 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V783 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W784 = { - let __t2067 = v_V782.clone(); - rt::apply_direct(interp, "numerator", &[__t2067])? - }; - { - let v_W785 = { - let __t2068 = v_V782.clone(); - rt::apply_direct(interp, "denominator", &[__t2068])? - }; - { - let v_W786 = { - let __t2069 = v_V783.clone(); - rt::apply_direct(interp, "numerator", &[__t2069])? - }; - { - let v_W787 = { - let __t2070 = v_V783.clone(); - rt::apply_direct(interp, "denominator", &[__t2070])? - }; - break Ok({ - let __t2077 = { - let __t2073 = { - let __t2071 = v_W784.clone(); - let __t2072 = v_W787.clone(); - rt::mul(&__t2071, &__t2072)? - }; - let __t2076 = { - let __t2074 = v_W785.clone(); - let __t2075 = v_W786.clone(); - rt::mul(&__t2074, &__t2075)? - }; - rt::sub(&__t2073, &__t2076)? - }; - let __t2080 = { - let __t2078 = v_W785.clone(); - let __t2079 = v_W787.clone(); - rt::mul(&__t2078, &__t2079)? - }; - rt::apply_direct(interp, "r#", &[__t2077, __t2080])? - }); - } - } - } - } - } -} - -fn install_r_x2d_(interp: &mut Interp) { - interp.register_native("r-", 2, aot_r_x2d_); - interp.register_aot_direct("r-", aot_r_x2d_); -} - -/// AOT-compiled from KL `(defun r* ...)` -pub fn aot_r_x2a_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r*: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V790 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V791 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W792 = { - let __t2081 = v_V790.clone(); - rt::apply_direct(interp, "numerator", &[__t2081])? - }; - { - let v_W793 = { - let __t2082 = v_V790.clone(); - rt::apply_direct(interp, "denominator", &[__t2082])? - }; - { - let v_W794 = { - let __t2083 = v_V791.clone(); - rt::apply_direct(interp, "numerator", &[__t2083])? - }; - { - let v_W795 = { - let __t2084 = v_V791.clone(); - rt::apply_direct(interp, "denominator", &[__t2084])? - }; - break Ok({ - let __t2087 = { - let __t2085 = v_W792.clone(); - let __t2086 = v_W794.clone(); - rt::mul(&__t2085, &__t2086)? - }; - let __t2090 = { - let __t2088 = v_W793.clone(); - let __t2089 = v_W795.clone(); - rt::mul(&__t2088, &__t2089)? - }; - rt::apply_direct(interp, "r#", &[__t2087, __t2090])? - }); - } - } - } - } - } -} - -fn install_r_x2a_(interp: &mut Interp) { - interp.register_native("r*", 2, aot_r_x2a_); - interp.register_aot_direct("r*", aot_r_x2a_); -} - -/// AOT-compiled from KL `(defun +-inverse ...)` -pub fn aot__x2b__x2d_inverse(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "+-inverse: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V798 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W799 = { - let __t2091 = v_V798.clone(); - rt::apply_direct(interp, "numerator", &[__t2091])? - }; - { - let v_W800 = { - let __t2092 = v_V798.clone(); - rt::apply_direct(interp, "denominator", &[__t2092])? - }; - break Ok({ - let __t2094 = { - let __t2093 = v_W799.clone(); - rt::apply_direct(interp, "~", &[__t2093])? - }; - let __t2095 = v_W800.clone(); - rt::apply_direct(interp, "r#", &[__t2094, __t2095])? - }); - } - } - } -} - -fn install__x2b__x2d_inverse(interp: &mut Interp) { - interp.register_native("+-inverse", 1, aot__x2b__x2d_inverse); - interp.register_aot_direct("+-inverse", aot__x2b__x2d_inverse); -} - -/// AOT-compiled from KL `(defun *-inverse ...)` -pub fn aot__x2a__x2d_inverse(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "*-inverse: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V802 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W803 = { - let __t2096 = v_V802.clone(); - rt::apply_direct(interp, "numerator", &[__t2096])? - }; - { - let v_W804 = { - let __t2097 = v_V802.clone(); - rt::apply_direct(interp, "denominator", &[__t2097])? - }; - break Ok({ - let __t2098 = v_W804.clone(); - let __t2099 = v_W803.clone(); - rt::apply_direct(interp, "r#", &[__t2098, __t2099])? - }); - } - } - } -} - -fn install__x2a__x2d_inverse(interp: &mut Interp) { - interp.register_native("*-inverse", 1, aot__x2a__x2d_inverse); - interp.register_aot_direct("*-inverse", aot__x2a__x2d_inverse); -} - -/// AOT-compiled from KL `(defun r/ ...)` -pub fn aot_r_x2f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r/: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V806 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V807 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2100 = v_V806.clone(); - let __t2102 = { - let __t2101 = v_V807.clone(); - rt::apply_direct(interp, "*-inverse", &[__t2101])? - }; - rt::apply_direct(interp, "r*", &[__t2100, __t2102])? - }); - } -} - -fn install_r_x2f_(interp: &mut Interp) { - interp.register_native("r/", 2, aot_r_x2f_); - interp.register_aot_direct("r/", aot_r_x2f_); -} - -/// AOT-compiled from KL `(defun r-expt ...)` -pub fn aot_r_x2d_expt(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r-expt: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V812 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V813 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2134 = { - let __t2125 = v_V813.clone(); - rt::apply_direct(interp, "natural?", &[__t2125])? - }; - if match rt::is_truthy(interp, &__t2134) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W814 = { - let __t2126 = v_V812.clone(); - rt::apply_direct(interp, "numerator", &[__t2126])? - }; - { - let v_W815 = { - let __t2127 = v_V812.clone(); - rt::apply_direct(interp, "denominator", &[__t2127])? - }; - break Ok({ - let __t2130 = { - let __t2128 = v_W814.clone(); - let __t2129 = v_V813.clone(); - rt::apply_direct(interp, "power", &[__t2128, __t2129])? - }; - let __t2133 = { - let __t2131 = v_W815.clone(); - let __t2132 = v_V813.clone(); - rt::apply_direct(interp, "power", &[__t2131, __t2132])? - }; - rt::apply_direct(interp, "r#", &[__t2130, __t2133])? - }); - } - } - } else { - { - let __t2124 = { - let __t2112 = { - let __t2110 = v_V813.clone(); - rt::apply_direct(interp, "integer?", &[__t2110])? - }; - if !rt::is_truthy(interp, &__t2112)? { - Value::bool(false) - } else { - let __t2113 = { - let __t2111 = v_V813.clone(); - rt::apply_direct(interp, "negative?", &[__t2111])? - }; - Value::bool(rt::is_truthy(interp, &__t2113)?) - } - }; - if match rt::is_truthy(interp, &__t2124) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W816 = { - let __t2114 = v_V812.clone(); - rt::apply_direct(interp, "numerator", &[__t2114])? - }; - { - let v_W817 = { - let __t2115 = v_V812.clone(); - rt::apply_direct(interp, "denominator", &[__t2115])? - }; - break Ok({ - let __t2119 = { - let __t2116 = v_W817.clone(); - let __t2118 = { - let __t2117 = v_V813.clone(); - rt::apply_direct(interp, "~", &[__t2117])? - }; - rt::apply_direct(interp, "power", &[__t2116, __t2118])? - }; - let __t2123 = { - let __t2120 = v_W816.clone(); - let __t2122 = { - let __t2121 = v_V813.clone(); - rt::apply_direct(interp, "~", &[__t2121])? - }; - rt::apply_direct(interp, "power", &[__t2120, __t2122])? - }; - rt::apply_direct(interp, "r#", &[__t2119, __t2123])? - }); - } - } - } else { - { - let __t2109 = Value::bool(true); - if match rt::is_truthy(interp, &__t2109) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2108 = { - let __t2103 = Value::str( - "cannot exponentiate a rational by a non-integer ", - ); - let __t2107 = { - let __t2104 = v_V813.clone(); - let __t2105 = Value::str("\n"); - let __t2106 = Value::sym(interp.intern("shen.a")); - rt::apply_direct( - interp, - "shen.app", - &[__t2104, __t2105, __t2106], - )? - }; - rt::apply_direct(interp, "cn", &[__t2103, __t2107])? - }; - rt::apply_direct(interp, "simple-error", &[__t2108])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_r_x2d_expt(interp: &mut Interp) { - interp.register_native("r-expt", 2, aot_r_x2d_expt); - interp.register_aot_direct("r-expt", aot_r_x2d_expt); -} - -/// AOT-compiled from KL `(defun r-approx ...)` -pub fn aot_r_x2d_approx(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "r-approx: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V820 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V821 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2136 = { - let __t2135 = v_V820.clone(); - rt::apply_direct(interp, "r->n", &[__t2135])? - }; - let __t2137 = v_V821.clone(); - let __t2138 = Value::int(0i64); - rt::apply_direct(interp, "rational.approx-r-h", &[__t2136, __t2137, __t2138])? - }); - } -} - -fn install_r_x2d_approx(interp: &mut Interp) { - interp.register_native("r-approx", 2, aot_r_x2d_approx); - interp.register_aot_direct("r-approx", aot_r_x2d_approx); -} - -/// AOT-compiled from KL `(defun rational.approx-r-h ...)` -pub fn aot_rational_x2e_approx_x2d_r_x2d_h( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "rational.approx-r-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V824 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V825 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V826 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2151 = { - let __t2147 = { - let __t2145 = v_V826.clone(); - let __t2146 = v_V825.clone(); - rt::div(&__t2145, &__t2146)? - }; - let __t2148 = v_V824.clone(); - rt::gt(&__t2147, &__t2148)? - }; - if match rt::is_truthy(interp, &__t2151) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2149 = v_V826.clone(); - let __t2150 = v_V825.clone(); - rt::apply_direct(interp, "r#", &[__t2149, __t2150])? - }); - } else { - { - let __t2144 = Value::bool(true); - if match rt::is_truthy(interp, &__t2144) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2139 = v_V824.clone(); - let __t2140 = v_V825.clone(); - let __t2143 = { - let __t2141 = v_V826.clone(); - let __t2142 = Value::int(1i64); - rt::add(&__t2141, &__t2142)? - }; - v_V824 = __t2139; - v_V825 = __t2140; - v_V826 = __t2143; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_rational_x2e_approx_x2d_r_x2d_h(interp: &mut Interp) { - interp.register_native( - "rational.approx-r-h", - 3, - aot_rational_x2e_approx_x2d_r_x2d_h, - ); - interp.register_aot_direct("rational.approx-r-h", aot_rational_x2e_approx_x2d_r_x2d_h); -} - -/// AOT-compiled from KL `(defun c# ...)` -pub fn aot_c_x23_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "c#: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V836 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V837 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2178 = { - let __t2166 = { - let __t2164 = v_V836.clone(); - rt::is_number(&__t2164) - }; - if !rt::is_truthy(interp, &__t2166)? { - Value::bool(false) - } else { - let __t2167 = { - let __t2165 = v_V837.clone(); - rt::is_number(&__t2165) - }; - Value::bool(rt::is_truthy(interp, &__t2167)?) - } - }; - if match rt::is_truthy(interp, &__t2178) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W838 = { - let __t2168 = Value::int(3i64); - rt::apply_direct(interp, "absvector", &[__t2168])? - }; - { - let v_W839 = { - let __t2169 = v_W838.clone(); - let __t2170 = Value::int(0i64); - let __t2171 = Value::sym(interp.intern("complex.print-complex")); - rt::apply_direct(interp, "address->", &[__t2169, __t2170, __t2171])? - }; - { - let v_W840 = { - let __t2172 = v_W838.clone(); - let __t2173 = Value::int(1i64); - let __t2174 = v_V836.clone(); - rt::apply_direct(interp, "address->", &[__t2172, __t2173, __t2174])? - }; - { - let v_W841 = { - let __t2175 = v_W838.clone(); - let __t2176 = Value::int(2i64); - let __t2177 = v_V837.clone(); - rt::apply_direct( - interp, - "address->", - &[__t2175, __t2176, __t2177], - )? - }; - break Ok(v_W838.clone()); - } - } - } - } - } else { - { - let __t2163 = Value::bool(true); - if match rt::is_truthy(interp, &__t2163) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2162 = { - let __t2152 = Value::str("real "); - let __t2161 = { - let __t2153 = v_V836.clone(); - let __t2159 = { - let __t2154 = Value::str(" and imaginary "); - let __t2158 = { - let __t2155 = v_V837.clone(); - let __t2156 = Value::str(" must be numbers\n"); - let __t2157 = Value::sym(interp.intern("shen.a")); - rt::apply_direct( - interp, - "shen.app", - &[__t2155, __t2156, __t2157], - )? - }; - rt::apply_direct(interp, "cn", &[__t2154, __t2158])? - }; - let __t2160 = Value::sym(interp.intern("shen.a")); - rt::apply_direct( - interp, - "shen.app", - &[__t2153, __t2159, __t2160], - )? - }; - rt::apply_direct(interp, "cn", &[__t2152, __t2161])? - }; - rt::apply_direct(interp, "simple-error", &[__t2162])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_c_x23_(interp: &mut Interp) { - interp.register_native("c#", 2, aot_c_x23_); - interp.register_aot_direct("c#", aot_c_x23_); -} - -/// AOT-compiled from KL `(defun complex.print-complex ...)` -pub fn aot_complex_x2e_print_x2d_complex(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "complex.print-complex: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V844 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2181 = { - let __t2179 = v_V844.clone(); - let __t2180 = Value::int(2i64); - rt::apply_direct(interp, "<-address", &[__t2179, __t2180])? - }; - let __t2189 = { - let __t2184 = { - let __t2182 = v_V844.clone(); - let __t2183 = Value::int(1i64); - rt::apply_direct(interp, "<-address", &[__t2182, __t2183])? - }; - let __t2188 = { - let __t2187 = { - let __t2185 = Value::str("(c"); - let __t2186 = Value::str("# ~A ~A)"); - rt::apply_direct(interp, "cn", &[__t2185, __t2186])? - }; - rt::apply_direct(interp, "shen.proc-nl", &[__t2187])? - }; - rt::apply_direct(interp, "shen.insert", &[__t2184, __t2188])? - }; - rt::apply_direct(interp, "shen.insert", &[__t2181, __t2189])? - }); - } -} - -fn install_complex_x2e_print_x2d_complex(interp: &mut Interp) { - interp.register_native( - "complex.print-complex", - 1, - aot_complex_x2e_print_x2d_complex, - ); - interp.register_aot_direct("complex.print-complex", aot_complex_x2e_print_x2d_complex); -} - -/// AOT-compiled from KL `(defun complex? ...)` -pub fn aot_complex_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "complex?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V846 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok( - match (|| -> ShenResult { - Ok({ - let __t2205 = { - let __t2190 = v_V846.clone(); - rt::is_absvector(&__t2190) - }; - if !rt::is_truthy(interp, &__t2205)? { - Value::bool(false) - } else { - let __t2206 = { - let __t2203 = { - let __t2193 = { - let __t2191 = v_V846.clone(); - let __t2192 = Value::int(0i64); - rt::apply_direct(interp, "<-address", &[__t2191, __t2192])? - }; - let __t2194 = Value::sym(interp.intern("complex.print-complex")); - rt::eq(&__t2193, &__t2194) - }; - if !rt::is_truthy(interp, &__t2203)? { - Value::bool(false) - } else { - let __t2204 = { - let __t2201 = { - let __t2197 = { - let __t2195 = v_V846.clone(); - let __t2196 = Value::int(1i64); - rt::apply_direct( - interp, - "<-address", - &[__t2195, __t2196], - )? - }; - rt::is_number(&__t2197) - }; - if !rt::is_truthy(interp, &__t2201)? { - Value::bool(false) - } else { - let __t2202 = { - let __t2200 = { - let __t2198 = v_V846.clone(); - let __t2199 = Value::int(2i64); - rt::apply_direct( - interp, - "<-address", - &[__t2198, __t2199], - )? - }; - rt::is_number(&__t2200) - }; - Value::bool(rt::is_truthy(interp, &__t2202)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2204)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2206)?) - } - }) - })() { - Ok(v) => v, - Err(e) => { - let __h = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z847 = args[0].clone(); - Ok(Value::bool(false)) - }, - Vec::new(), - interp, - ) - }; - let __err = Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - }, - ); - } -} - -fn install_complex_x3f_(interp: &mut Interp) { - interp.register_native("complex?", 1, aot_complex_x3f_); - interp.register_aot_direct("complex?", aot_complex_x3f_); -} - -/// AOT-compiled from KL `(defun real ...)` -pub fn aot_real(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "real: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V849 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2207 = v_V849.clone(); - let __t2208 = Value::int(1i64); - rt::apply_direct(interp, "<-address", &[__t2207, __t2208])? - }); - } -} - -fn install_real(interp: &mut Interp) { - interp.register_native("real", 1, aot_real); - interp.register_aot_direct("real", aot_real); -} - -/// AOT-compiled from KL `(defun imaginary ...)` -pub fn aot_imaginary(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "imaginary: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V851 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2209 = v_V851.clone(); - let __t2210 = Value::int(2i64); - rt::apply_direct(interp, "<-address", &[__t2209, __t2210])? - }); - } -} - -fn install_imaginary(interp: &mut Interp) { - interp.register_native("imaginary", 1, aot_imaginary); - interp.register_aot_direct("imaginary", aot_imaginary); -} - -/// AOT-compiled from KL `(defun c+ ...)` -pub fn aot_c_x2b_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "c+: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V861 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V862 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W863 = { - let __t2211 = v_V861.clone(); - rt::apply_direct(interp, "real", &[__t2211])? - }; - { - let v_W864 = { - let __t2212 = v_V861.clone(); - rt::apply_direct(interp, "imaginary", &[__t2212])? - }; - { - let v_W865 = { - let __t2213 = v_V862.clone(); - rt::apply_direct(interp, "real", &[__t2213])? - }; - { - let v_W866 = { - let __t2214 = v_V862.clone(); - rt::apply_direct(interp, "imaginary", &[__t2214])? - }; - break Ok({ - let __t2217 = { - let __t2215 = v_W863.clone(); - let __t2216 = v_W865.clone(); - rt::add(&__t2215, &__t2216)? - }; - let __t2220 = { - let __t2218 = v_W864.clone(); - let __t2219 = v_W866.clone(); - rt::add(&__t2218, &__t2219)? - }; - rt::apply_direct(interp, "c#", &[__t2217, __t2220])? - }); - } - } - } - } - } -} - -fn install_c_x2b_(interp: &mut Interp) { - interp.register_native("c+", 2, aot_c_x2b_); - interp.register_aot_direct("c+", aot_c_x2b_); -} - -/// AOT-compiled from KL `(defun c- ...)` -pub fn aot_c_x2d_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "c-: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V869 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V870 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W871 = { - let __t2221 = v_V869.clone(); - rt::apply_direct(interp, "real", &[__t2221])? - }; - { - let v_W872 = { - let __t2222 = v_V869.clone(); - rt::apply_direct(interp, "imaginary", &[__t2222])? - }; - { - let v_W873 = { - let __t2223 = v_V870.clone(); - rt::apply_direct(interp, "real", &[__t2223])? - }; - { - let v_W874 = { - let __t2224 = v_V870.clone(); - rt::apply_direct(interp, "imaginary", &[__t2224])? - }; - break Ok({ - let __t2227 = { - let __t2225 = v_W871.clone(); - let __t2226 = v_W873.clone(); - rt::sub(&__t2225, &__t2226)? - }; - let __t2230 = { - let __t2228 = v_W872.clone(); - let __t2229 = v_W874.clone(); - rt::sub(&__t2228, &__t2229)? - }; - rt::apply_direct(interp, "c#", &[__t2227, __t2230])? - }); - } - } - } - } - } -} - -fn install_c_x2d_(interp: &mut Interp) { - interp.register_native("c-", 2, aot_c_x2d_); - interp.register_aot_direct("c-", aot_c_x2d_); -} - -/// AOT-compiled from KL `(defun c* ...)` -pub fn aot_c_x2a_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "c*: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V877 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V878 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W879 = { - let __t2231 = v_V877.clone(); - rt::apply_direct(interp, "real", &[__t2231])? - }; - { - let v_W880 = { - let __t2232 = v_V877.clone(); - rt::apply_direct(interp, "imaginary", &[__t2232])? - }; - { - let v_W881 = { - let __t2233 = v_V878.clone(); - rt::apply_direct(interp, "real", &[__t2233])? - }; - { - let v_W882 = { - let __t2234 = v_V878.clone(); - rt::apply_direct(interp, "imaginary", &[__t2234])? - }; - break Ok({ - let __t2241 = { - let __t2237 = { - let __t2235 = v_W879.clone(); - let __t2236 = v_W881.clone(); - rt::mul(&__t2235, &__t2236)? - }; - let __t2240 = { - let __t2238 = v_W880.clone(); - let __t2239 = v_W882.clone(); - rt::mul(&__t2238, &__t2239)? - }; - rt::sub(&__t2237, &__t2240)? - }; - let __t2248 = { - let __t2244 = { - let __t2242 = v_W880.clone(); - let __t2243 = v_W881.clone(); - rt::mul(&__t2242, &__t2243)? - }; - let __t2247 = { - let __t2245 = v_W879.clone(); - let __t2246 = v_W882.clone(); - rt::mul(&__t2245, &__t2246)? - }; - rt::add(&__t2244, &__t2247)? - }; - rt::apply_direct(interp, "c#", &[__t2241, __t2248])? - }); - } - } - } - } - } -} - -fn install_c_x2a_(interp: &mut Interp) { - interp.register_native("c*", 2, aot_c_x2a_); - interp.register_aot_direct("c*", aot_c_x2a_); -} - -/// AOT-compiled from KL `(defun c/ ...)` -pub fn aot_c_x2f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "c/: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V885 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V886 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W887 = { - let __t2249 = v_V885.clone(); - rt::apply_direct(interp, "real", &[__t2249])? - }; - { - let v_W888 = { - let __t2250 = v_V885.clone(); - rt::apply_direct(interp, "imaginary", &[__t2250])? - }; - { - let v_W889 = { - let __t2251 = v_V886.clone(); - rt::apply_direct(interp, "real", &[__t2251])? - }; - { - let v_W890 = { - let __t2252 = v_V886.clone(); - rt::apply_direct(interp, "imaginary", &[__t2252])? - }; - break Ok({ - let __t2267 = { - let __t2259 = { - let __t2255 = { - let __t2253 = v_W887.clone(); - let __t2254 = v_W889.clone(); - rt::mul(&__t2253, &__t2254)? - }; - let __t2258 = { - let __t2256 = v_W888.clone(); - let __t2257 = v_W890.clone(); - rt::mul(&__t2256, &__t2257)? - }; - rt::add(&__t2255, &__t2258)? - }; - let __t2266 = { - let __t2262 = { - let __t2260 = v_W889.clone(); - let __t2261 = v_W889.clone(); - rt::mul(&__t2260, &__t2261)? - }; - let __t2265 = { - let __t2263 = v_W890.clone(); - let __t2264 = v_W890.clone(); - rt::mul(&__t2263, &__t2264)? - }; - rt::add(&__t2262, &__t2265)? - }; - rt::div(&__t2259, &__t2266)? - }; - let __t2282 = { - let __t2274 = { - let __t2270 = { - let __t2268 = v_W888.clone(); - let __t2269 = v_W889.clone(); - rt::mul(&__t2268, &__t2269)? - }; - let __t2273 = { - let __t2271 = v_W887.clone(); - let __t2272 = v_W890.clone(); - rt::mul(&__t2271, &__t2272)? - }; - rt::sub(&__t2270, &__t2273)? - }; - let __t2281 = { - let __t2277 = { - let __t2275 = v_W889.clone(); - let __t2276 = v_W889.clone(); - rt::mul(&__t2275, &__t2276)? - }; - let __t2280 = { - let __t2278 = v_W890.clone(); - let __t2279 = v_W890.clone(); - rt::mul(&__t2278, &__t2279)? - }; - rt::add(&__t2277, &__t2280)? - }; - rt::div(&__t2274, &__t2281)? - }; - rt::apply_direct(interp, "c#", &[__t2267, __t2282])? - }); - } - } - } - } - } -} - -fn install_c_x2f_(interp: &mut Interp) { - interp.register_native("c/", 2, aot_c_x2f_); - interp.register_aot_direct("c/", aot_c_x2f_); -} - -/// AOT-compiled from KL `(defun n# ...)` -pub fn aot_n_x23_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "n#: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V903 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V904 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2321 = { - let __t2301 = { - let __t2295 = v_V903.clone(); - rt::apply_direct(interp, "natural?", &[__t2295])? - }; - if !rt::is_truthy(interp, &__t2301)? { - Value::bool(false) - } else { - let __t2302 = { - let __t2299 = { - let __t2296 = v_V904.clone(); - rt::apply_direct(interp, "natural?", &[__t2296])? - }; - if !rt::is_truthy(interp, &__t2299)? { - Value::bool(false) - } else { - let __t2300 = { - let __t2297 = v_V904.clone(); - let __t2298 = Value::int(0i64); - rt::gt(&__t2297, &__t2298)? - }; - Value::bool(rt::is_truthy(interp, &__t2300)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2302)?) - } - }; - if match rt::is_truthy(interp, &__t2321) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W905 = { - let __t2303 = Value::int(4i64); - rt::apply_direct(interp, "absvector", &[__t2303])? - }; - { - let v_W906 = { - let __t2304 = v_W905.clone(); - let __t2305 = Value::int(0i64); - let __t2306 = Value::sym(interp.intern("numerals.print-numeral")); - rt::apply_direct(interp, "address->", &[__t2304, __t2305, __t2306])? - }; - { - let v_W907 = { - let __t2307 = v_W905.clone(); - let __t2308 = Value::int(1i64); - let __t2314 = { - let __t2312 = { - let __t2310 = { - let __t2309 = - Value::sym(interp.intern("numerals.n->numeral")); - rt::apply_direct(interp, "fn", &[__t2309])? - }; - let __t2311 = v_V903.clone(); - rt::apply_value(interp, __t2310, &[__t2311])? - }; - let __t2313 = v_V904.clone(); - rt::apply_value(interp, __t2312, &[__t2313])? - }; - rt::apply_direct(interp, "address->", &[__t2307, __t2308, __t2314])? - }; - { - let v_W908 = { - let __t2315 = v_W905.clone(); - let __t2316 = Value::int(2i64); - let __t2317 = v_V904.clone(); - rt::apply_direct( - interp, - "address->", - &[__t2315, __t2316, __t2317], - )? - }; - { - let v_W909 = { - let __t2318 = v_W905.clone(); - let __t2319 = Value::int(3i64); - let __t2320 = v_V903.clone(); - rt::apply_direct( - interp, - "address->", - &[__t2318, __t2319, __t2320], - )? - }; - break Ok(v_W905.clone()); - } - } - } - } - } - } else { - { - let __t2294 = Value::bool(true); - if match rt::is_truthy(interp, &__t2294) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2293 = { - let __t2283 = Value::str("N = "); - let __t2292 = { - let __t2284 = v_V903.clone(); - let __t2290 = { - let __t2285 = Value::str(", Radix = "); - let __t2289 = { - let __t2286 = v_V904.clone(); - let __t2287 = Value::str("; N and Radix must be natural numbers where Radix > 0\n"); - let __t2288 = Value::sym(interp.intern("shen.a")); - rt::apply_direct( - interp, - "shen.app", - &[__t2286, __t2287, __t2288], - )? - }; - rt::apply_direct(interp, "cn", &[__t2285, __t2289])? - }; - let __t2291 = Value::sym(interp.intern("shen.a")); - rt::apply_direct( - interp, - "shen.app", - &[__t2284, __t2290, __t2291], - )? - }; - rt::apply_direct(interp, "cn", &[__t2283, __t2292])? - }; - rt::apply_direct(interp, "simple-error", &[__t2293])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_n_x23_(interp: &mut Interp) { - interp.register_native("n#", 2, aot_n_x23_); - interp.register_aot_direct("n#", aot_n_x23_); -} - -/// AOT-compiled from KL `(defun radix ...)` -pub fn aot_radix(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "radix: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V912 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2322 = v_V912.clone(); - let __t2323 = Value::int(2i64); - rt::apply_direct(interp, "<-address", &[__t2322, __t2323])? - }); - } -} - -fn install_radix(interp: &mut Interp) { - interp.register_native("radix", 1, aot_radix); - interp.register_aot_direct("radix", aot_radix); -} - -/// AOT-compiled from KL `(defun numerals.numerals ...)` -pub fn aot_numerals_x2e_numerals(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "numerals.numerals: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V914 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2324 = v_V914.clone(); - let __t2325 = Value::int(1i64); - rt::apply_direct(interp, "<-address", &[__t2324, __t2325])? - }); - } -} - -fn install_numerals_x2e_numerals(interp: &mut Interp) { - interp.register_native("numerals.numerals", 1, aot_numerals_x2e_numerals); - interp.register_aot_direct("numerals.numerals", aot_numerals_x2e_numerals); -} - -/// AOT-compiled from KL `(defun n#->n ...)` -pub fn aot_n_x23__x2d__x3e_n(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "n#->n: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V916 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2326 = v_V916.clone(); - let __t2327 = Value::int(3i64); - rt::apply_direct(interp, "<-address", &[__t2326, __t2327])? - }); - } -} - -fn install_n_x23__x2d__x3e_n(interp: &mut Interp) { - interp.register_native("n#->n", 1, aot_n_x23__x2d__x3e_n); - interp.register_aot_direct("n#->n", aot_n_x23__x2d__x3e_n); -} - -/// AOT-compiled from KL `(defun n#->ns ...)` -pub fn aot_n_x23__x2d__x3e_ns(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "n#->ns: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V918 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2328 = v_V918.clone(); - let __t2329 = Value::int(1i64); - rt::apply_direct(interp, "<-address", &[__t2328, __t2329])? - }); - } -} - -fn install_n_x23__x2d__x3e_ns(interp: &mut Interp) { - interp.register_native("n#->ns", 1, aot_n_x23__x2d__x3e_ns); - interp.register_aot_direct("n#->ns", aot_n_x23__x2d__x3e_ns); -} - -/// AOT-compiled from KL `(defun numerals.print-numeral ...)` -pub fn aot_numerals_x2e_print_x2d_numeral( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "numerals.print-numeral: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V920 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W921 = { - let __t2330 = v_V920.clone(); - rt::apply_direct(interp, "radix", &[__t2330])? - }; - { - let v_W922 = { - let __t2331 = v_V920.clone(); - rt::apply_direct(interp, "numerals.numerals", &[__t2331])? - }; - break Ok({ - let __t2334 = { - let __t2332 = v_W922.clone(); - let __t2333 = v_W921.clone(); - rt::apply_direct(interp, "numerals.numeric->string", &[__t2332, __t2333])? - }; - let __t2338 = { - let __t2335 = Value::str("#"); - let __t2337 = { - let __t2336 = v_W921.clone(); - rt::apply_direct(interp, "str", &[__t2336])? - }; - rt::apply_direct(interp, "@s", &[__t2335, __t2337])? - }; - rt::apply_direct(interp, "@s", &[__t2334, __t2338])? - }); - } - } - } -} - -fn install_numerals_x2e_print_x2d_numeral(interp: &mut Interp) { - interp.register_native( - "numerals.print-numeral", - 1, - aot_numerals_x2e_print_x2d_numeral, - ); - interp.register_aot_direct("numerals.print-numeral", aot_numerals_x2e_print_x2d_numeral); -} - -/// AOT-compiled from KL `(defun numerals.numeric->string ...)` -pub fn aot_numerals_x2e_numeric_x2d__x3e_string( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "numerals.numeric->string: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V926 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V927 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2367 = { - let __t2365 = Value::nil(); - let __t2366 = v_V926.clone(); - rt::eq(&__t2365, &__t2366) - }; - if match rt::is_truthy(interp, &__t2367) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t2364 = { - let __t2341 = v_V926.clone(); - rt::is_cons(&__t2341) - }; - if match rt::is_truthy(interp, &__t2364) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W928 = { - let __t2358 = { - let __t2343 = { - let __t2342 = v_V926.clone(); - rt::hd(&__t2342)? - }; - let __t2344 = Value::int(10i64); - rt::lt(&__t2343, &__t2344)? - }; - if rt::is_truthy(interp, &__t2358)? { - { - let __t2346 = { - let __t2345 = v_V926.clone(); - rt::hd(&__t2345)? - }; - rt::apply_direct(interp, "str", &[__t2346])? - } - } else { - { - let __t2357 = { - let __t2347 = v_V927.clone(); - let __t2348 = Value::int(36i64); - rt::gt(&__t2347, &__t2348)? - }; - if rt::is_truthy(interp, &__t2357)? { - { - let __t2351 = { - let __t2350 = { - let __t2349 = v_V926.clone(); - rt::hd(&__t2349)? - }; - rt::apply_direct(interp, "str", &[__t2350])? - }; - let __t2352 = Value::str(" "); - rt::apply_direct(interp, "cn", &[__t2351, __t2352])? - } - } else { - { - let __t2356 = { - let __t2354 = { - let __t2353 = v_V926.clone(); - rt::hd(&__t2353)? - }; - let __t2355 = Value::int(55i64); - rt::add(&__t2354, &__t2355)? - }; - rt::apply_direct(interp, "n->string", &[__t2356])? - } - } - } - } - }; - break Ok({ - let __t2359 = v_W928.clone(); - let __t2363 = { - let __t2361 = { - let __t2360 = v_V926.clone(); - rt::tl(&__t2360)? - }; - let __t2362 = v_V927.clone(); - rt::apply_direct( - interp, - "numerals.numeric->string", - &[__t2361, __t2362], - )? - }; - rt::apply_direct(interp, "cn", &[__t2359, __t2363])? - }); - } - } else { - { - let __t2340 = Value::bool(true); - if match rt::is_truthy(interp, &__t2340) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2339 = - Value::sym(interp.intern("numerals.numeric->string")); - rt::apply_direct(interp, "shen.f-error", &[__t2339])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_numerals_x2e_numeric_x2d__x3e_string(interp: &mut Interp) { - interp.register_native( - "numerals.numeric->string", - 2, - aot_numerals_x2e_numeric_x2d__x3e_string, - ); - interp.register_aot_direct( - "numerals.numeric->string", - aot_numerals_x2e_numeric_x2d__x3e_string, - ); -} - -/// AOT-compiled from KL `(defun numeral? ...)` -pub fn aot_numeral_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "numeral?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V931 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2369 = { - let __t2368 = v_V931.clone(); - rt::is_absvector(&__t2368) - }; - if !match rt::is_truthy(interp, &__t2369) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t2370 = Value::sym(interp.intern("numerals.print-numeral")); - let __t2373 = { - let __t2371 = v_V931.clone(); - let __t2372 = Value::int(0i64); - rt::apply_direct(interp, "<-address", &[__t2371, __t2372])? - }; - rt::eq(&__t2370, &__t2373) - }); - } - } - } -} - -fn install_numeral_x3f_(interp: &mut Interp) { - interp.register_native("numeral?", 1, aot_numeral_x3f_); - interp.register_aot_direct("numeral?", aot_numeral_x3f_); -} - -/// AOT-compiled from KL `(defun numerals.numeral-macro ...)` -pub fn aot_numerals_x2e_numeral_x2d_macro( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "numerals.numeral-macro: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V969 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2638 = { - let __t2610 = { - let __t2583 = v_V969.clone(); - rt::is_cons(&__t2583) - }; - if !rt::is_truthy(interp, &__t2610)? { - Value::bool(false) - } else { - let __t2611 = { - let __t2608 = { - let __t2584 = Value::sym(interp.intern("n-op2")); - let __t2586 = { - let __t2585 = v_V969.clone(); - rt::hd(&__t2585)? - }; - rt::eq(&__t2584, &__t2586) - }; - if !rt::is_truthy(interp, &__t2608)? { - Value::bool(false) - } else { - let __t2609 = { - let __t2606 = { - let __t2588 = { - let __t2587 = v_V969.clone(); - rt::tl(&__t2587)? - }; - rt::is_cons(&__t2588) - }; - if !rt::is_truthy(interp, &__t2606)? { - Value::bool(false) - } else { - let __t2607 = { - let __t2604 = { - let __t2591 = { - let __t2590 = { - let __t2589 = v_V969.clone(); - rt::tl(&__t2589)? - }; - rt::tl(&__t2590)? - }; - rt::is_cons(&__t2591) - }; - if !rt::is_truthy(interp, &__t2604)? { - Value::bool(false) - } else { - let __t2605 = { - let __t2602 = { - let __t2595 = { - let __t2594 = { - let __t2593 = { - let __t2592 = v_V969.clone(); - rt::tl(&__t2592)? - }; - rt::tl(&__t2593)? - }; - rt::tl(&__t2594)? - }; - rt::is_cons(&__t2595) - }; - if !rt::is_truthy(interp, &__t2602)? { - Value::bool(false) - } else { - let __t2603 = { - let __t2596 = Value::nil(); - let __t2601 = { - let __t2600 = { - let __t2599 = { - let __t2598 = { - let __t2597 = - v_V969.clone(); - rt::tl(&__t2597)? - }; - rt::tl(&__t2598)? - }; - rt::tl(&__t2599)? - }; - rt::tl(&__t2600)? - }; - rt::eq(&__t2596, &__t2601) - }; - Value::bool(rt::is_truthy(interp, &__t2603)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2605)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2607)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2609)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2611)?) - } - }; - if match rt::is_truthy(interp, &__t2638) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2612 = Value::sym(interp.intern("n-op2")); - let __t2637 = { - let __t2615 = { - let __t2614 = { - let __t2613 = v_V969.clone(); - rt::tl(&__t2613)? - }; - rt::hd(&__t2614)? - }; - let __t2636 = { - let __t2619 = { - let __t2618 = { - let __t2617 = { - let __t2616 = v_V969.clone(); - rt::tl(&__t2616)? - }; - rt::tl(&__t2617)? - }; - rt::hd(&__t2618)? - }; - let __t2635 = { - let __t2624 = { - let __t2623 = { - let __t2622 = { - let __t2621 = { - let __t2620 = v_V969.clone(); - rt::tl(&__t2620)? - }; - rt::tl(&__t2621)? - }; - rt::tl(&__t2622)? - }; - rt::hd(&__t2623)? - }; - let __t2634 = { - let __t2632 = { - let __t2625 = Value::sym(interp.intern("radix")); - let __t2631 = { - let __t2629 = { - let __t2628 = { - let __t2627 = { - let __t2626 = v_V969.clone(); - rt::tl(&__t2626)? - }; - rt::tl(&__t2627)? - }; - rt::hd(&__t2628)? - }; - let __t2630 = Value::nil(); - rt::cons(&__t2629, &__t2630) - }; - rt::cons(&__t2625, &__t2631) - }; - let __t2633 = Value::nil(); - rt::cons(&__t2632, &__t2633) - }; - rt::cons(&__t2624, &__t2634) - }; - rt::cons(&__t2619, &__t2635) - }; - rt::cons(&__t2615, &__t2636) - }; - rt::cons(&__t2612, &__t2637) - }); - } else { - { - let __t2582 = { - let __t2563 = { - let __t2543 = v_V969.clone(); - rt::is_cons(&__t2543) - }; - if !rt::is_truthy(interp, &__t2563)? { - Value::bool(false) - } else { - let __t2564 = { - let __t2561 = { - let __t2544 = Value::sym(interp.intern("n-op1")); - let __t2546 = { - let __t2545 = v_V969.clone(); - rt::hd(&__t2545)? - }; - rt::eq(&__t2544, &__t2546) - }; - if !rt::is_truthy(interp, &__t2561)? { - Value::bool(false) - } else { - let __t2562 = { - let __t2559 = { - let __t2548 = { - let __t2547 = v_V969.clone(); - rt::tl(&__t2547)? - }; - rt::is_cons(&__t2548) - }; - if !rt::is_truthy(interp, &__t2559)? { - Value::bool(false) - } else { - let __t2560 = { - let __t2557 = { - let __t2551 = { - let __t2550 = { - let __t2549 = v_V969.clone(); - rt::tl(&__t2549)? - }; - rt::tl(&__t2550)? - }; - rt::is_cons(&__t2551) - }; - if !rt::is_truthy(interp, &__t2557)? { - Value::bool(false) - } else { - let __t2558 = { - let __t2552 = Value::nil(); - let __t2556 = { - let __t2555 = { - let __t2554 = { - let __t2553 = v_V969.clone(); - rt::tl(&__t2553)? - }; - rt::tl(&__t2554)? - }; - rt::tl(&__t2555)? - }; - rt::eq(&__t2552, &__t2556) - }; - Value::bool(rt::is_truthy(interp, &__t2558)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2560)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2562)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2564)?) - } - }; - if match rt::is_truthy(interp, &__t2582) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2565 = Value::sym(interp.intern("n-op1")); - let __t2581 = { - let __t2568 = { - let __t2567 = { - let __t2566 = v_V969.clone(); - rt::tl(&__t2566)? - }; - rt::hd(&__t2567)? - }; - let __t2580 = { - let __t2572 = { - let __t2571 = { - let __t2570 = { - let __t2569 = v_V969.clone(); - rt::tl(&__t2569)? - }; - rt::tl(&__t2570)? - }; - rt::hd(&__t2571)? - }; - let __t2579 = { - let __t2577 = { - let __t2573 = Value::sym(interp.intern("radix")); - let __t2576 = { - let __t2575 = { - let __t2574 = v_V969.clone(); - rt::tl(&__t2574)? - }; - rt::tl(&__t2575)? - }; - rt::cons(&__t2573, &__t2576) - }; - let __t2578 = Value::nil(); - rt::cons(&__t2577, &__t2578) - }; - rt::cons(&__t2572, &__t2579) - }; - rt::cons(&__t2568, &__t2580) - }; - rt::cons(&__t2565, &__t2581) - }); - } else { - { - let __t2542 = { - let __t2521 = { - let __t2501 = v_V969.clone(); - rt::is_cons(&__t2501) - }; - if !rt::is_truthy(interp, &__t2521)? { - Value::bool(false) - } else { - let __t2522 = { - let __t2519 = { - let __t2502 = Value::sym(interp.intern("n+")); - let __t2504 = { - let __t2503 = v_V969.clone(); - rt::hd(&__t2503)? - }; - rt::eq(&__t2502, &__t2504) - }; - if !rt::is_truthy(interp, &__t2519)? { - Value::bool(false) - } else { - let __t2520 = { - let __t2517 = { - let __t2506 = { - let __t2505 = v_V969.clone(); - rt::tl(&__t2505)? - }; - rt::is_cons(&__t2506) - }; - if !rt::is_truthy(interp, &__t2517)? { - Value::bool(false) - } else { - let __t2518 = { - let __t2515 = { - let __t2509 = { - let __t2508 = { - let __t2507 = v_V969.clone(); - rt::tl(&__t2507)? - }; - rt::tl(&__t2508)? - }; - rt::is_cons(&__t2509) - }; - if !rt::is_truthy(interp, &__t2515)? { - Value::bool(false) - } else { - let __t2516 = { - let __t2510 = Value::nil(); - let __t2514 = { - let __t2513 = { - let __t2512 = { - let __t2511 = - v_V969.clone(); - rt::tl(&__t2511)? - }; - rt::tl(&__t2512)? - }; - rt::tl(&__t2513)? - }; - rt::eq(&__t2510, &__t2514) - }; - Value::bool(rt::is_truthy( - interp, &__t2516, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2518)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2520)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2522)?) - } - }; - if match rt::is_truthy(interp, &__t2542) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2523 = Value::sym(interp.intern("n+")); - let __t2541 = { - let __t2526 = { - let __t2525 = { - let __t2524 = v_V969.clone(); - rt::tl(&__t2524)? - }; - rt::hd(&__t2525)? - }; - let __t2540 = { - let __t2530 = { - let __t2529 = { - let __t2528 = { - let __t2527 = v_V969.clone(); - rt::tl(&__t2527)? - }; - rt::tl(&__t2528)? - }; - rt::hd(&__t2529)? - }; - let __t2539 = { - let __t2537 = { - let __t2531 = - Value::sym(interp.intern("radix")); - let __t2536 = { - let __t2534 = { - let __t2533 = { - let __t2532 = v_V969.clone(); - rt::tl(&__t2532)? - }; - rt::hd(&__t2533)? - }; - let __t2535 = Value::nil(); - rt::cons(&__t2534, &__t2535) - }; - rt::cons(&__t2531, &__t2536) - }; - let __t2538 = Value::nil(); - rt::cons(&__t2537, &__t2538) - }; - rt::cons(&__t2530, &__t2539) - }; - rt::cons(&__t2526, &__t2540) - }; - rt::cons(&__t2523, &__t2541) - }); - } else { - { - let __t2500 = { - let __t2479 = { - let __t2459 = v_V969.clone(); - rt::is_cons(&__t2459) - }; - if !rt::is_truthy(interp, &__t2479)? { - Value::bool(false) - } else { - let __t2480 = { - let __t2477 = { - let __t2460 = Value::sym(interp.intern("n-")); - let __t2462 = { - let __t2461 = v_V969.clone(); - rt::hd(&__t2461)? - }; - rt::eq(&__t2460, &__t2462) - }; - if !rt::is_truthy(interp, &__t2477)? { - Value::bool(false) - } else { - let __t2478 = { - let __t2475 = { - let __t2464 = { - let __t2463 = v_V969.clone(); - rt::tl(&__t2463)? - }; - rt::is_cons(&__t2464) - }; - if !rt::is_truthy(interp, &__t2475)? { - Value::bool(false) - } else { - let __t2476 = { - let __t2473 = { - let __t2467 = { - let __t2466 = { - let __t2465 = - v_V969.clone(); - rt::tl(&__t2465)? - }; - rt::tl(&__t2466)? - }; - rt::is_cons(&__t2467) - }; - if !rt::is_truthy(interp, &__t2473)? - { - Value::bool(false) - } else { - let __t2474 = { - let __t2468 = Value::nil(); - let __t2472 = { - let __t2471 = { - let __t2470 = { - let __t2469 = - v_V969 - .clone( - ); - rt::tl( - &__t2469, - )? - }; - rt::tl(&__t2470)? - }; - rt::tl(&__t2471)? - }; - rt::eq(&__t2468, &__t2472) - }; - Value::bool(rt::is_truthy( - interp, &__t2474, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t2476, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2478)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2480)?) - } - }; - if match rt::is_truthy(interp, &__t2500) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2481 = Value::sym(interp.intern("n-")); - let __t2499 = { - let __t2484 = { - let __t2483 = { - let __t2482 = v_V969.clone(); - rt::tl(&__t2482)? - }; - rt::hd(&__t2483)? - }; - let __t2498 = { - let __t2488 = { - let __t2487 = { - let __t2486 = { - let __t2485 = v_V969.clone(); - rt::tl(&__t2485)? - }; - rt::tl(&__t2486)? - }; - rt::hd(&__t2487)? - }; - let __t2497 = { - let __t2495 = { - let __t2489 = - Value::sym(interp.intern("radix")); - let __t2494 = { - let __t2492 = { - let __t2491 = { - let __t2490 = - v_V969.clone(); - rt::tl(&__t2490)? - }; - rt::hd(&__t2491)? - }; - let __t2493 = Value::nil(); - rt::cons(&__t2492, &__t2493) - }; - rt::cons(&__t2489, &__t2494) - }; - let __t2496 = Value::nil(); - rt::cons(&__t2495, &__t2496) - }; - rt::cons(&__t2488, &__t2497) - }; - rt::cons(&__t2484, &__t2498) - }; - rt::cons(&__t2481, &__t2499) - }); - } else { - { - let __t2458 = { - let __t2437 = { - let __t2417 = v_V969.clone(); - rt::is_cons(&__t2417) - }; - if !rt::is_truthy(interp, &__t2437)? { - Value::bool(false) - } else { - let __t2438 = { - let __t2435 = { - let __t2418 = - Value::sym(interp.intern("n*")); - let __t2420 = { - let __t2419 = v_V969.clone(); - rt::hd(&__t2419)? - }; - rt::eq(&__t2418, &__t2420) - }; - if !rt::is_truthy(interp, &__t2435)? { - Value::bool(false) - } else { - let __t2436 = { - let __t2433 = { - let __t2422 = { - let __t2421 = - v_V969.clone(); - rt::tl(&__t2421)? - }; - rt::is_cons(&__t2422) - }; - if !rt::is_truthy(interp, &__t2433)? - { - Value::bool(false) - } else { - let __t2434 = { - let __t2431 = { - let __t2425 = { - let __t2424 = { - let __t2423 = - v_V969 - .clone( - ); - rt::tl( - &__t2423, - )? - }; - rt::tl(&__t2424)? - }; - rt::is_cons(&__t2425) - }; - if !rt::is_truthy( - interp, &__t2431, - )? { - Value::bool(false) - } else { - let __t2432 = { - let __t2426 = - Value::nil(); - let __t2430 = { - let __t2429 = { - let __t2428 = { - let __t2427 = v_V969.clone(); - rt::tl(&__t2427)? - }; - rt::tl(&__t2428)? - }; - rt::tl( - &__t2429, - )? - }; - rt::eq( - &__t2426, - &__t2430, - ) - }; - Value::bool( - rt::is_truthy( - interp, - &__t2432, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t2434, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t2436, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2438)?) - } - }; - if match rt::is_truthy(interp, &__t2458) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2439 = Value::sym(interp.intern("n*")); - let __t2457 = { - let __t2442 = { - let __t2441 = { - let __t2440 = v_V969.clone(); - rt::tl(&__t2440)? - }; - rt::hd(&__t2441)? - }; - let __t2456 = { - let __t2446 = { - let __t2445 = { - let __t2444 = { - let __t2443 = - v_V969.clone(); - rt::tl(&__t2443)? - }; - rt::tl(&__t2444)? - }; - rt::hd(&__t2445)? - }; - let __t2455 = { - let __t2453 = { - let __t2447 = Value::sym( - interp.intern("radix"), - ); - let __t2452 = { - let __t2450 = { - let __t2449 = { - let __t2448 = - v_V969.clone(); - rt::tl(&__t2448)? - }; - rt::hd(&__t2449)? - }; - let __t2451 = Value::nil(); - rt::cons(&__t2450, &__t2451) - }; - rt::cons(&__t2447, &__t2452) - }; - let __t2454 = Value::nil(); - rt::cons(&__t2453, &__t2454) - }; - rt::cons(&__t2446, &__t2455) - }; - rt::cons(&__t2442, &__t2456) - }; - rt::cons(&__t2439, &__t2457) - }); - } else { - { - let __t2416 = { - let __t2395 = { - let __t2375 = v_V969.clone(); - rt::is_cons(&__t2375) - }; - if !rt::is_truthy(interp, &__t2395)? { - Value::bool(false) - } else { - let __t2396 = { - let __t2393 = { - let __t2376 = Value::sym( - interp.intern("n/"), - ); - let __t2378 = { - let __t2377 = - v_V969.clone(); - rt::hd(&__t2377)? - }; - rt::eq(&__t2376, &__t2378) - }; - if !rt::is_truthy(interp, &__t2393)? - { - Value::bool(false) - } else { - let __t2394 = { - let __t2391 = { - let __t2380 = { - let __t2379 = - v_V969.clone(); - rt::tl(&__t2379)? - }; - rt::is_cons(&__t2380) - }; - if !rt::is_truthy( - interp, &__t2391, - )? { - Value::bool(false) - } else { - let __t2392 = { - let __t2389 = { - let __t2383 = { - let __t2382 = { - let __t2381 = v_V969.clone(); - rt::tl(&__t2381)? - }; - rt::tl(&__t2382)? - }; - rt::is_cons( - &__t2383, - ) - }; - if !rt::is_truthy( - interp, - &__t2389, - )? { - Value::bool( - false, - ) - } else { - let __t2390 = { - let __t2384 = Value::nil(); - let __t2388 = { - let __t2387 = { - let __t2386 = { let __t2385 = v_V969.clone(); rt::tl(&__t2385)? }; - rt::tl(&__t2386)? - }; - rt::tl(&__t2387)? - }; - rt::eq(&__t2384, &__t2388) - }; - Value::bool(rt::is_truthy(interp, &__t2390)?) - } - }; - Value::bool( - rt::is_truthy( - interp, - &__t2392, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t2394, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t2396, - )?) - } - }; - if match rt::is_truthy(interp, &__t2416) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2397 = - Value::sym(interp.intern("n/")); - let __t2415 = { - let __t2400 = { - let __t2399 = { - let __t2398 = - v_V969.clone(); - rt::tl(&__t2398)? - }; - rt::hd(&__t2399)? - }; - let __t2414 = { - let __t2404 = { - let __t2403 = { - let __t2402 = { - let __t2401 = - v_V969.clone(); - rt::tl(&__t2401)? - }; - rt::tl(&__t2402)? - }; - rt::hd(&__t2403)? - }; - let __t2413 = { - let __t2411 = { - let __t2405 = - Value::sym( - interp.intern( - "radix", - ), - ); - let __t2410 = { - let __t2408 = { - let __t2407 = { - let __t2406 = v_V969.clone(); - rt::tl(&__t2406)? - }; - rt::hd( - &__t2407, - )? - }; - let __t2409 = - Value::nil(); - rt::cons( - &__t2408, - &__t2409, - ) - }; - rt::cons( - &__t2405, &__t2410, - ) - }; - let __t2412 = Value::nil(); - rt::cons(&__t2411, &__t2412) - }; - rt::cons(&__t2404, &__t2413) - }; - rt::cons(&__t2400, &__t2414) - }; - rt::cons(&__t2397, &__t2415) - }); - } else { - { - let __t2374 = Value::bool(true); - if match rt::is_truthy(interp, &__t2374) - { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V969.clone()); - } else { - break Err(ShenError::new( - "cond: no clause matched", - )); - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_numerals_x2e_numeral_x2d_macro(interp: &mut Interp) { - interp.register_native( - "numerals.numeral-macro", - 1, - aot_numerals_x2e_numeral_x2d_macro, - ); - interp.register_aot_direct("numerals.numeral-macro", aot_numerals_x2e_numeral_x2d_macro); -} - -/// AOT-compiled from KL `(defun n-op2 ...)` -pub fn aot_n_x2d_op2(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "n-op2: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V971 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V972 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V973 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V974 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2644 = { - let __t2641 = { - let __t2640 = { - let __t2639 = v_V972.clone(); - rt::apply_direct(interp, "n#->n", &[__t2639])? - }; - rt::apply_value(interp, v_V971.clone(), &[__t2640])? - }; - let __t2643 = { - let __t2642 = v_V973.clone(); - rt::apply_direct(interp, "n#->n", &[__t2642])? - }; - rt::apply_value(interp, __t2641, &[__t2643])? - }; - let __t2645 = v_V974.clone(); - rt::apply_direct(interp, "n#", &[__t2644, __t2645])? - }); - } -} - -fn install_n_x2d_op2(interp: &mut Interp) { - interp.register_native("n-op2", 4, aot_n_x2d_op2); - interp.register_aot_direct("n-op2", aot_n_x2d_op2); -} - -/// AOT-compiled from KL `(defun n-op1 ...)` -pub fn aot_n_x2d_op1(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "n-op1: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V979 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V980 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V981 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2648 = { - let __t2647 = { - let __t2646 = v_V980.clone(); - rt::apply_direct(interp, "n#->n", &[__t2646])? - }; - rt::apply_value(interp, v_V979.clone(), &[__t2647])? - }; - let __t2649 = v_V981.clone(); - rt::apply_direct(interp, "n#", &[__t2648, __t2649])? - }); - } -} - -fn install_n_x2d_op1(interp: &mut Interp) { - interp.register_native("n-op1", 3, aot_n_x2d_op1); - interp.register_aot_direct("n-op1", aot_n_x2d_op1); -} - -/// AOT-compiled from KL `(defun n+ ...)` -pub fn aot_n_x2b_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "n+: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V987 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V988 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V989 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2652 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z990 = args[0].clone(); - Ok({ - let v_Z990 = v_Z990.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z991 = args[0].clone(); - Ok({ - let __t2650 = v_Z990.clone(); - let __t2651 = v_Z991.clone(); - rt::add(&__t2650, &__t2651)? - }) - }, - vec![v_Z990], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t2653 = v_V987.clone(); - let __t2654 = v_V988.clone(); - let __t2655 = v_V989.clone(); - rt::apply_direct(interp, "n-op2", &[__t2652, __t2653, __t2654, __t2655])? - }); - } -} - -fn install_n_x2b_(interp: &mut Interp) { - interp.register_native("n+", 3, aot_n_x2b_); - interp.register_aot_direct("n+", aot_n_x2b_); -} - -/// AOT-compiled from KL `(defun n* ...)` -pub fn aot_n_x2a_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "n*: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V997 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V998 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V999 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2658 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1000 = args[0].clone(); - Ok({ - let v_Z1000 = v_Z1000.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1001 = args[0].clone(); - Ok({ - let __t2656 = v_Z1000.clone(); - let __t2657 = v_Z1001.clone(); - rt::mul(&__t2656, &__t2657)? - }) - }, - vec![v_Z1000], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t2659 = v_V997.clone(); - let __t2660 = v_V998.clone(); - let __t2661 = v_V999.clone(); - rt::apply_direct(interp, "n-op2", &[__t2658, __t2659, __t2660, __t2661])? - }); - } -} - -fn install_n_x2a_(interp: &mut Interp) { - interp.register_native("n*", 3, aot_n_x2a_); - interp.register_aot_direct("n*", aot_n_x2a_); -} - -/// AOT-compiled from KL `(defun n- ...)` -pub fn aot_n_x2d_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "n-: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1007 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1008 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1009 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2664 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1010 = args[0].clone(); - Ok({ - let v_Z1010 = v_Z1010.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1011 = args[0].clone(); - Ok({ - let __t2662 = v_Z1010.clone(); - let __t2663 = v_Z1011.clone(); - rt::sub(&__t2662, &__t2663)? - }) - }, - vec![v_Z1010], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t2665 = v_V1007.clone(); - let __t2666 = v_V1008.clone(); - let __t2667 = v_V1009.clone(); - rt::apply_direct(interp, "n-op2", &[__t2664, __t2665, __t2666, __t2667])? - }); - } -} - -fn install_n_x2d_(interp: &mut Interp) { - interp.register_native("n-", 3, aot_n_x2d_); - interp.register_aot_direct("n-", aot_n_x2d_); -} - -/// AOT-compiled from KL `(defun n/ ...)` -pub fn aot_n_x2f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "n/: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1017 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1018 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1019 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2670 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1020 = args[0].clone(); - Ok({ - let v_Z1020 = v_Z1020.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1021 = args[0].clone(); - Ok({ - let __t2668 = v_Z1020.clone(); - let __t2669 = v_Z1021.clone(); - rt::div(&__t2668, &__t2669)? - }) - }, - vec![v_Z1020], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t2671 = v_V1017.clone(); - let __t2672 = v_V1018.clone(); - let __t2673 = v_V1019.clone(); - rt::apply_direct(interp, "n-op2", &[__t2670, __t2671, __t2672, __t2673])? - }); - } -} - -fn install_n_x2f_(interp: &mut Interp) { - interp.register_native("n/", 3, aot_n_x2f_); - interp.register_aot_direct("n/", aot_n_x2f_); -} - -/// AOT-compiled from KL `(defun binary ...)` -pub fn aot_binary(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "binary: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1025 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2674 = v_V1025.clone(); - let __t2675 = Value::int(2i64); - rt::apply_direct(interp, "n#", &[__t2674, __t2675])? - }); - } -} - -fn install_binary(interp: &mut Interp) { - interp.register_native("binary", 1, aot_binary); - interp.register_aot_direct("binary", aot_binary); -} - -/// AOT-compiled from KL `(defun hex ...)` -pub fn aot_hex(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "hex: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1027 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2676 = v_V1027.clone(); - let __t2677 = Value::int(16i64); - rt::apply_direct(interp, "n#", &[__t2676, __t2677])? - }); - } -} - -fn install_hex(interp: &mut Interp) { - interp.register_native("hex", 1, aot_hex); - interp.register_aot_direct("hex", aot_hex); -} - -/// AOT-compiled from KL `(defun octal ...)` -pub fn aot_octal(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "octal: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1029 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2678 = v_V1029.clone(); - let __t2679 = Value::int(8i64); - rt::apply_direct(interp, "n#", &[__t2678, __t2679])? - }); - } -} - -fn install_octal(interp: &mut Interp) { - interp.register_native("octal", 1, aot_octal); - interp.register_aot_direct("octal", aot_octal); -} - -/// AOT-compiled from KL `(defun duodecimal ...)` -pub fn aot_duodecimal(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "duodecimal: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1031 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2680 = v_V1031.clone(); - let __t2681 = Value::int(12i64); - rt::apply_direct(interp, "n#", &[__t2680, __t2681])? - }); - } -} - -fn install_duodecimal(interp: &mut Interp) { - interp.register_native("duodecimal", 1, aot_duodecimal); - interp.register_aot_direct("duodecimal", aot_duodecimal); -} - -/// AOT-compiled from KL `(defun numerals.n->numeral ...)` -pub fn aot_numerals_x2e_n_x2d__x3e_numeral( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "numerals.n->numeral: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1033 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1034 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2706 = { - let __t2702 = v_V1034.clone(); - let __t2703 = v_V1033.clone(); - rt::gt(&__t2702, &__t2703)? - }; - if match rt::is_truthy(interp, &__t2706) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2704 = v_V1033.clone(); - let __t2705 = Value::nil(); - rt::cons(&__t2704, &__t2705) - }); - } else { - { - let __t2701 = Value::bool(true); - if match rt::is_truthy(interp, &__t2701) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1035 = { - let __t2682 = v_V1033.clone(); - let __t2683 = v_V1034.clone(); - let __t2684 = Value::int(0i64); - rt::apply_direct( - interp, - "numerals.largest-expt", - &[__t2682, __t2683, __t2684], - )? - }; - { - let v_W1036 = { - let __t2685 = v_V1034.clone(); - let __t2686 = v_W1035.clone(); - rt::apply_direct(interp, "power", &[__t2685, __t2686])? - }; - { - let v_W1037 = { - let __t2687 = v_V1033.clone(); - let __t2688 = v_W1036.clone(); - rt::apply_direct(interp, "div", &[__t2687, __t2688])? - }; - { - let v_W1038 = { - let __t2689 = v_W1037.clone(); - let __t2691 = { - let __t2690 = v_W1035.clone(); - rt::apply_direct( - interp, - "numerals.n-zeros", - &[__t2690], - )? - }; - rt::cons(&__t2689, &__t2691) - }; - { - let v_W1039 = { - let __t2692 = v_V1033.clone(); - let __t2695 = { - let __t2693 = v_W1037.clone(); - let __t2694 = v_W1036.clone(); - rt::mul(&__t2693, &__t2694)? - }; - rt::sub(&__t2692, &__t2695)? - }; - break Ok({ - let __t2696 = v_W1038.clone(); - let __t2699 = { - let __t2697 = v_W1039.clone(); - let __t2698 = v_V1034.clone(); - rt::apply_direct( - interp, - "numerals.n->numeral", - &[__t2697, __t2698], - )? - }; - let __t2700 = v_V1034.clone(); - rt::apply_direct( - interp, - "numerals.add", - &[__t2696, __t2699, __t2700], - )? - }); - } - } - } - } - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_numerals_x2e_n_x2d__x3e_numeral(interp: &mut Interp) { - interp.register_native( - "numerals.n->numeral", - 2, - aot_numerals_x2e_n_x2d__x3e_numeral, - ); - interp.register_aot_direct("numerals.n->numeral", aot_numerals_x2e_n_x2d__x3e_numeral); -} - -/// AOT-compiled from KL `(defun numerals.largest-expt ...)` -pub fn aot_numerals_x2e_largest_x2d_expt(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "numerals.largest-expt: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1042 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1043 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1044 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2719 = { - let __t2715 = { - let __t2713 = v_V1043.clone(); - let __t2714 = v_V1044.clone(); - rt::apply_direct(interp, "power", &[__t2713, __t2714])? - }; - let __t2716 = v_V1042.clone(); - rt::gt(&__t2715, &__t2716)? - }; - if match rt::is_truthy(interp, &__t2719) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2717 = v_V1044.clone(); - let __t2718 = Value::int(1i64); - rt::sub(&__t2717, &__t2718)? - }); - } else { - { - let __t2712 = Value::bool(true); - if match rt::is_truthy(interp, &__t2712) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2707 = v_V1042.clone(); - let __t2708 = v_V1043.clone(); - let __t2711 = { - let __t2709 = v_V1044.clone(); - let __t2710 = Value::int(1i64); - rt::add(&__t2709, &__t2710)? - }; - v_V1042 = __t2707; - v_V1043 = __t2708; - v_V1044 = __t2711; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_numerals_x2e_largest_x2d_expt(interp: &mut Interp) { - interp.register_native( - "numerals.largest-expt", - 3, - aot_numerals_x2e_largest_x2d_expt, - ); - interp.register_aot_direct("numerals.largest-expt", aot_numerals_x2e_largest_x2d_expt); -} - -/// AOT-compiled from KL `(defun numerals.n-zeros ...)` -pub fn aot_numerals_x2e_n_x2d_zeros(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "numerals.n-zeros: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1048 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2728 = { - let __t2726 = Value::int(0i64); - let __t2727 = v_V1048.clone(); - rt::eq(&__t2726, &__t2727) - }; - if match rt::is_truthy(interp, &__t2728) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t2725 = Value::bool(true); - if match rt::is_truthy(interp, &__t2725) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2720 = Value::int(0i64); - let __t2724 = { - let __t2723 = { - let __t2721 = v_V1048.clone(); - let __t2722 = Value::int(1i64); - rt::sub(&__t2721, &__t2722)? - }; - rt::apply_direct(interp, "numerals.n-zeros", &[__t2723])? - }; - rt::cons(&__t2720, &__t2724) - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_numerals_x2e_n_x2d_zeros(interp: &mut Interp) { - interp.register_native("numerals.n-zeros", 1, aot_numerals_x2e_n_x2d_zeros); - interp.register_aot_direct("numerals.n-zeros", aot_numerals_x2e_n_x2d_zeros); -} - -/// AOT-compiled from KL `(defun numerals.add ...)` -pub fn aot_numerals_x2e_add(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "numerals.add: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1050 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1051 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1052 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2735 = { - let __t2730 = { - let __t2729 = v_V1050.clone(); - rt::apply_direct(interp, "reverse", &[__t2729])? - }; - let __t2732 = { - let __t2731 = v_V1051.clone(); - rt::apply_direct(interp, "reverse", &[__t2731])? - }; - let __t2733 = v_V1052.clone(); - let __t2734 = Value::int(0i64); - rt::apply_direct( - interp, - "numerals.add-h", - &[__t2730, __t2732, __t2733, __t2734], - )? - }; - rt::apply_direct(interp, "reverse", &[__t2735])? - }); - } -} - -fn install_numerals_x2e_add(interp: &mut Interp) { - interp.register_native("numerals.add", 3, aot_numerals_x2e_add); - interp.register_aot_direct("numerals.add", aot_numerals_x2e_add); -} - -/// AOT-compiled from KL `(defun numerals.add-h ...)` -pub fn aot_numerals_x2e_add_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "numerals.add-h: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1060 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1061 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1062 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V1063 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2807 = { - let __t2805 = { - let __t2797 = Value::nil(); - let __t2798 = v_V1060.clone(); - rt::eq(&__t2797, &__t2798) - }; - if !rt::is_truthy(interp, &__t2805)? { - Value::bool(false) - } else { - let __t2806 = { - let __t2803 = { - let __t2799 = Value::nil(); - let __t2800 = v_V1061.clone(); - rt::eq(&__t2799, &__t2800) - }; - if !rt::is_truthy(interp, &__t2803)? { - Value::bool(false) - } else { - let __t2804 = { - let __t2801 = Value::int(0i64); - let __t2802 = v_V1063.clone(); - rt::eq(&__t2801, &__t2802) - }; - Value::bool(rt::is_truthy(interp, &__t2804)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2806)?) - } - }; - if match rt::is_truthy(interp, &__t2807) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t2796 = { - let __t2792 = { - let __t2788 = Value::nil(); - let __t2789 = v_V1060.clone(); - rt::eq(&__t2788, &__t2789) - }; - if !rt::is_truthy(interp, &__t2792)? { - Value::bool(false) - } else { - let __t2793 = { - let __t2790 = Value::nil(); - let __t2791 = v_V1061.clone(); - rt::eq(&__t2790, &__t2791) - }; - Value::bool(rt::is_truthy(interp, &__t2793)?) - } - }; - if match rt::is_truthy(interp, &__t2796) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2794 = v_V1063.clone(); - let __t2795 = Value::nil(); - rt::cons(&__t2794, &__t2795) - }); - } else { - { - let __t2787 = { - let __t2779 = Value::nil(); - let __t2780 = v_V1060.clone(); - rt::eq(&__t2779, &__t2780) - }; - if match rt::is_truthy(interp, &__t2787) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2783 = { - let __t2781 = Value::int(0i64); - let __t2782 = Value::nil(); - rt::cons(&__t2781, &__t2782) - }; - let __t2784 = v_V1061.clone(); - let __t2785 = v_V1062.clone(); - let __t2786 = v_V1063.clone(); - v_V1060 = __t2783; - v_V1061 = __t2784; - v_V1062 = __t2785; - v_V1063 = __t2786; - continue; - } - } else { - { - let __t2778 = { - let __t2770 = Value::nil(); - let __t2771 = v_V1061.clone(); - rt::eq(&__t2770, &__t2771) - }; - if match rt::is_truthy(interp, &__t2778) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2772 = v_V1060.clone(); - let __t2775 = { - let __t2773 = Value::int(0i64); - let __t2774 = Value::nil(); - rt::cons(&__t2773, &__t2774) - }; - let __t2776 = v_V1062.clone(); - let __t2777 = v_V1063.clone(); - v_V1060 = __t2772; - v_V1061 = __t2775; - v_V1062 = __t2776; - v_V1063 = __t2777; - continue; - } - } else { - { - let __t2769 = { - let __t2740 = { - let __t2738 = v_V1060.clone(); - rt::is_cons(&__t2738) - }; - if !rt::is_truthy(interp, &__t2740)? { - Value::bool(false) - } else { - let __t2741 = { - let __t2739 = v_V1061.clone(); - rt::is_cons(&__t2739) - }; - Value::bool(rt::is_truthy(interp, &__t2741)?) - } - }; - if match rt::is_truthy(interp, &__t2769) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1064 = { - let __t2743 = { - let __t2742 = v_V1060.clone(); - rt::hd(&__t2742)? - }; - let __t2747 = { - let __t2745 = { - let __t2744 = v_V1061.clone(); - rt::hd(&__t2744)? - }; - let __t2746 = v_V1063.clone(); - rt::add(&__t2745, &__t2746)? - }; - rt::add(&__t2743, &__t2747)? - }; - { - let __t2750 = { - let __t2748 = v_W1064.clone(); - let __t2749 = v_V1062.clone(); - rt::lt(&__t2748, &__t2749)? - }; - if match rt::is_truthy(interp, &__t2750) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2751 = v_W1064.clone(); - let __t2758 = { - let __t2753 = { - let __t2752 = - v_V1060.clone(); - rt::tl(&__t2752)? - }; - let __t2755 = { - let __t2754 = - v_V1061.clone(); - rt::tl(&__t2754)? - }; - let __t2756 = v_V1062.clone(); - let __t2757 = Value::int(0i64); - rt::apply_direct( - interp, - "numerals.add-h", - &[ - __t2753, __t2755, - __t2756, __t2757, - ], - )? - }; - rt::cons(&__t2751, &__t2758) - }); - } else { - break Ok({ - let __t2761 = { - let __t2759 = v_V1062.clone(); - let __t2760 = v_W1064.clone(); - rt::sub(&__t2759, &__t2760)? - }; - let __t2768 = { - let __t2763 = { - let __t2762 = - v_V1060.clone(); - rt::tl(&__t2762)? - }; - let __t2765 = { - let __t2764 = - v_V1061.clone(); - rt::tl(&__t2764)? - }; - let __t2766 = v_V1062.clone(); - let __t2767 = Value::int(1i64); - rt::apply_direct( - interp, - "numerals.add-h", - &[ - __t2763, __t2765, - __t2766, __t2767, - ], - )? - }; - rt::cons(&__t2761, &__t2768) - }); - } - } - } - } else { - { - let __t2737 = Value::bool(true); - if match rt::is_truthy(interp, &__t2737) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2736 = Value::sym( - interp.intern("numerals.add-h"), - ); - rt::apply_direct( - interp, - "shen.f-error", - &[__t2736], - )? - }); - } else { - break Err(ShenError::new( - "cond: no clause matched", - )); - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_numerals_x2e_add_x2d_h(interp: &mut Interp) { - interp.register_native("numerals.add-h", 4, aot_numerals_x2e_add_x2d_h); - interp.register_aot_direct("numerals.add-h", aot_numerals_x2e_add_x2d_h); -} - -/// AOT-compiled from KL `(defun assoc-if ...)` -pub fn aot_assoc_x2d_if(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "assoc-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1175 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1176 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2829 = { - let __t2827 = Value::nil(); - let __t2828 = v_V1176.clone(); - rt::eq(&__t2827, &__t2828) - }; - if match rt::is_truthy(interp, &__t2829) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t2826 = { - let __t2823 = { - let __t2815 = v_V1176.clone(); - rt::is_cons(&__t2815) - }; - if !rt::is_truthy(interp, &__t2823)? { - Value::bool(false) - } else { - let __t2824 = { - let __t2821 = { - let __t2817 = { - let __t2816 = v_V1176.clone(); - rt::hd(&__t2816)? - }; - rt::is_cons(&__t2817) - }; - if !rt::is_truthy(interp, &__t2821)? { - Value::bool(false) - } else { - let __t2822 = { - let __t2820 = { - let __t2819 = { - let __t2818 = v_V1176.clone(); - rt::hd(&__t2818)? - }; - rt::hd(&__t2819)? - }; - rt::apply_value(interp, v_V1175.clone(), &[__t2820])? - }; - Value::bool(rt::is_truthy(interp, &__t2822)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2824)?) - } - }; - if match rt::is_truthy(interp, &__t2826) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2825 = v_V1176.clone(); - rt::hd(&__t2825)? - }); - } else { - { - let __t2814 = { - let __t2810 = v_V1176.clone(); - rt::is_cons(&__t2810) - }; - if match rt::is_truthy(interp, &__t2814) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2811 = v_V1175.clone(); - let __t2813 = { - let __t2812 = v_V1176.clone(); - rt::tl(&__t2812)? - }; - v_V1175 = __t2811; - v_V1176 = __t2813; - continue; - } - } else { - { - let __t2809 = Value::bool(true); - if match rt::is_truthy(interp, &__t2809) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2808 = Value::sym(interp.intern("assoc-if")); - rt::apply_direct(interp, "shen.f-error", &[__t2808])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_assoc_x2d_if(interp: &mut Interp) { - interp.register_native("assoc-if", 2, aot_assoc_x2d_if); - interp.register_aot_direct("assoc-if", aot_assoc_x2d_if); -} - -/// AOT-compiled from KL `(defun assoc-if-not ...)` -pub fn aot_assoc_x2d_if_x2d_not(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "assoc-if-not: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1184 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1185 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2852 = { - let __t2850 = Value::nil(); - let __t2851 = v_V1185.clone(); - rt::eq(&__t2850, &__t2851) - }; - if match rt::is_truthy(interp, &__t2852) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t2849 = { - let __t2846 = { - let __t2837 = v_V1185.clone(); - rt::is_cons(&__t2837) - }; - if !rt::is_truthy(interp, &__t2846)? { - Value::bool(false) - } else { - let __t2847 = { - let __t2844 = { - let __t2839 = { - let __t2838 = v_V1185.clone(); - rt::hd(&__t2838)? - }; - rt::is_cons(&__t2839) - }; - if !rt::is_truthy(interp, &__t2844)? { - Value::bool(false) - } else { - let __t2845 = { - let __t2843 = { - let __t2842 = { - let __t2841 = { - let __t2840 = v_V1185.clone(); - rt::hd(&__t2840)? - }; - rt::hd(&__t2841)? - }; - rt::apply_value(interp, v_V1184.clone(), &[__t2842])? - }; - rt::apply_direct(interp, "not", &[__t2843])? - }; - Value::bool(rt::is_truthy(interp, &__t2845)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t2847)?) - } - }; - if match rt::is_truthy(interp, &__t2849) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2848 = v_V1185.clone(); - rt::hd(&__t2848)? - }); - } else { - { - let __t2836 = { - let __t2832 = v_V1185.clone(); - rt::is_cons(&__t2832) - }; - if match rt::is_truthy(interp, &__t2836) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2833 = v_V1184.clone(); - let __t2835 = { - let __t2834 = v_V1185.clone(); - rt::tl(&__t2834)? - }; - rt::apply_direct(interp, "assoc-if", &[__t2833, __t2835])? - }); - } else { - { - let __t2831 = Value::bool(true); - if match rt::is_truthy(interp, &__t2831) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2830 = Value::sym(interp.intern("assoc-if-not")); - rt::apply_direct(interp, "shen.f-error", &[__t2830])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_assoc_x2d_if_x2d_not(interp: &mut Interp) { - interp.register_native("assoc-if-not", 2, aot_assoc_x2d_if_x2d_not); - interp.register_aot_direct("assoc-if-not", aot_assoc_x2d_if_x2d_not); -} - -/// AOT-compiled from KL `(defun drop ...)` -pub fn aot_drop(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "drop: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1190 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1191 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2864 = { - let __t2862 = Value::int(0i64); - let __t2863 = v_V1190.clone(); - rt::eq(&__t2862, &__t2863) - }; - if match rt::is_truthy(interp, &__t2864) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1191.clone()); - } else { - { - let __t2861 = { - let __t2855 = v_V1191.clone(); - rt::is_cons(&__t2855) - }; - if match rt::is_truthy(interp, &__t2861) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2858 = { - let __t2856 = v_V1190.clone(); - let __t2857 = Value::int(1i64); - rt::sub(&__t2856, &__t2857)? - }; - let __t2860 = { - let __t2859 = v_V1191.clone(); - rt::tl(&__t2859)? - }; - v_V1190 = __t2858; - v_V1191 = __t2860; - continue; - } - } else { - { - let __t2854 = Value::bool(true); - if match rt::is_truthy(interp, &__t2854) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2853 = Value::sym(interp.intern("drop")); - rt::apply_direct(interp, "shen.f-error", &[__t2853])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_drop(interp: &mut Interp) { - interp.register_native("drop", 2, aot_drop); - interp.register_aot_direct("drop", aot_drop); -} - -/// AOT-compiled from KL `(defun drop-last ...)` -pub fn aot_drop_x2d_last(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "drop-last: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1194 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1195 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2868 = { - let __t2865 = v_V1194.clone(); - let __t2867 = { - let __t2866 = v_V1195.clone(); - rt::apply_direct(interp, "reverse", &[__t2866])? - }; - rt::apply_direct(interp, "drop", &[__t2865, __t2867])? - }; - rt::apply_direct(interp, "reverse", &[__t2868])? - }); - } -} - -fn install_drop_x2d_last(interp: &mut Interp) { - interp.register_native("drop-last", 2, aot_drop_x2d_last); - interp.register_aot_direct("drop-last", aot_drop_x2d_last); -} - -/// AOT-compiled from KL `(defun index ...)` -pub fn aot_index(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "index: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1198 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1199 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2869 = v_V1198.clone(); - let __t2870 = v_V1199.clone(); - let __t2871 = Value::int(1i64); - rt::apply_direct(interp, "list.index-h", &[__t2869, __t2870, __t2871])? - }); - } -} - -fn install_index(interp: &mut Interp) { - interp.register_native("index", 2, aot_index); - interp.register_aot_direct("index", aot_index); -} - -/// AOT-compiled from KL `(defun list.index-h ...)` -pub fn aot_list_x2e_index_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "list.index-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1211 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1212 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1213 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2891 = { - let __t2889 = Value::nil(); - let __t2890 = v_V1212.clone(); - rt::eq(&__t2889, &__t2890) - }; - if match rt::is_truthy(interp, &__t2891) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(-1i64)); - } else { - { - let __t2888 = { - let __t2886 = { - let __t2882 = v_V1212.clone(); - rt::is_cons(&__t2882) - }; - if !rt::is_truthy(interp, &__t2886)? { - Value::bool(false) - } else { - let __t2887 = { - let __t2883 = v_V1211.clone(); - let __t2885 = { - let __t2884 = v_V1212.clone(); - rt::hd(&__t2884)? - }; - rt::eq(&__t2883, &__t2885) - }; - Value::bool(rt::is_truthy(interp, &__t2887)?) - } - }; - if match rt::is_truthy(interp, &__t2888) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1213.clone()); - } else { - { - let __t2881 = { - let __t2874 = v_V1212.clone(); - rt::is_cons(&__t2874) - }; - if match rt::is_truthy(interp, &__t2881) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2875 = v_V1211.clone(); - let __t2877 = { - let __t2876 = v_V1212.clone(); - rt::tl(&__t2876)? - }; - let __t2880 = { - let __t2878 = v_V1213.clone(); - let __t2879 = Value::int(1i64); - rt::add(&__t2878, &__t2879)? - }; - v_V1211 = __t2875; - v_V1212 = __t2877; - v_V1213 = __t2880; - continue; - } - } else { - { - let __t2873 = Value::bool(true); - if match rt::is_truthy(interp, &__t2873) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2872 = Value::sym(interp.intern("list.index-h")); - rt::apply_direct(interp, "shen.f-error", &[__t2872])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_list_x2e_index_x2d_h(interp: &mut Interp) { - interp.register_native("list.index-h", 3, aot_list_x2e_index_x2d_h); - interp.register_aot_direct("list.index-h", aot_list_x2e_index_x2d_h); -} - -/// AOT-compiled from KL `(defun index-last ...)` -pub fn aot_index_x2d_last(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "index-last: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1217 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1218 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W1219 = { - let __t2892 = v_V1218.clone(); - rt::apply_direct(interp, "length", &[__t2892])? - }; - { - let v_W1220 = { - let __t2893 = v_V1217.clone(); - let __t2895 = { - let __t2894 = v_V1218.clone(); - rt::apply_direct(interp, "reverse", &[__t2894])? - }; - rt::apply_direct(interp, "index", &[__t2893, __t2895])? - }; - { - let __t2898 = { - let __t2896 = v_W1220.clone(); - let __t2897 = Value::int(-1i64); - rt::eq(&__t2896, &__t2897) - }; - if match rt::is_truthy(interp, &__t2898) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_W1220.clone()); - } else { - break Ok({ - let __t2901 = { - let __t2899 = v_W1219.clone(); - let __t2900 = v_W1220.clone(); - rt::sub(&__t2899, &__t2900)? - }; - let __t2902 = Value::int(1i64); - rt::add(&__t2901, &__t2902)? - }); - } - } - } - } - } -} - -fn install_index_x2d_last(interp: &mut Interp) { - interp.register_native("index-last", 2, aot_index_x2d_last); - interp.register_aot_direct("index-last", aot_index_x2d_last); -} - -/// AOT-compiled from KL `(defun insert ...)` -pub fn aot_insert(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "insert: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1225 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1226 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1227 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2929 = { - let __t2921 = Value::nil(); - let __t2922 = v_V1227.clone(); - rt::eq(&__t2921, &__t2922) - }; - if match rt::is_truthy(interp, &__t2929) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2928 = { - let __t2923 = Value::str("cannot insert "); - let __t2927 = { - let __t2924 = v_V1226.clone(); - let __t2925 = Value::str(" into list: index out of range\n"); - let __t2926 = Value::sym(interp.intern("shen.s")); - rt::apply_direct(interp, "shen.app", &[__t2924, __t2925, __t2926])? - }; - rt::apply_direct(interp, "cn", &[__t2923, __t2927])? - }; - rt::apply_direct(interp, "simple-error", &[__t2928])? - }); - } else { - { - let __t2920 = { - let __t2916 = Value::int(1i64); - let __t2917 = v_V1225.clone(); - rt::eq(&__t2916, &__t2917) - }; - if match rt::is_truthy(interp, &__t2920) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2918 = v_V1226.clone(); - let __t2919 = v_V1227.clone(); - rt::cons(&__t2918, &__t2919) - }); - } else { - { - let __t2915 = { - let __t2905 = v_V1227.clone(); - rt::is_cons(&__t2905) - }; - if match rt::is_truthy(interp, &__t2915) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2907 = { - let __t2906 = v_V1227.clone(); - rt::hd(&__t2906)? - }; - let __t2914 = { - let __t2910 = { - let __t2908 = v_V1225.clone(); - let __t2909 = Value::int(1i64); - rt::sub(&__t2908, &__t2909)? - }; - let __t2911 = v_V1226.clone(); - let __t2913 = { - let __t2912 = v_V1227.clone(); - rt::tl(&__t2912)? - }; - rt::apply_direct( - interp, - "insert", - &[__t2910, __t2911, __t2913], - )? - }; - rt::cons(&__t2907, &__t2914) - }); - } else { - { - let __t2904 = Value::bool(true); - if match rt::is_truthy(interp, &__t2904) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2903 = Value::sym(interp.intern("insert")); - rt::apply_direct(interp, "shen.f-error", &[__t2903])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_insert(interp: &mut Interp) { - interp.register_native("insert", 3, aot_insert); - interp.register_aot_direct("insert", aot_insert); -} - -/// AOT-compiled from KL `(defun remove-duplicates ...)` -pub fn aot_remove_x2d_duplicates(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "remove-duplicates: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1231 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2951 = { - let __t2949 = Value::nil(); - let __t2950 = v_V1231.clone(); - rt::eq(&__t2949, &__t2950) - }; - if match rt::is_truthy(interp, &__t2951) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t2948 = { - let __t2944 = { - let __t2939 = v_V1231.clone(); - rt::is_cons(&__t2939) - }; - if !rt::is_truthy(interp, &__t2944)? { - Value::bool(false) - } else { - let __t2945 = { - let __t2941 = { - let __t2940 = v_V1231.clone(); - rt::hd(&__t2940)? - }; - let __t2943 = { - let __t2942 = v_V1231.clone(); - rt::tl(&__t2942)? - }; - rt::apply_direct(interp, "element?", &[__t2941, __t2943])? - }; - Value::bool(rt::is_truthy(interp, &__t2945)?) - } - }; - if match rt::is_truthy(interp, &__t2948) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2947 = { - let __t2946 = v_V1231.clone(); - rt::tl(&__t2946)? - }; - v_V1231 = __t2947; - continue; - } - } else { - { - let __t2938 = { - let __t2932 = v_V1231.clone(); - rt::is_cons(&__t2932) - }; - if match rt::is_truthy(interp, &__t2938) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2934 = { - let __t2933 = v_V1231.clone(); - rt::hd(&__t2933)? - }; - let __t2937 = { - let __t2936 = { - let __t2935 = v_V1231.clone(); - rt::tl(&__t2935)? - }; - rt::apply_direct(interp, "remove-duplicates", &[__t2936])? - }; - rt::cons(&__t2934, &__t2937) - }); - } else { - { - let __t2931 = Value::bool(true); - if match rt::is_truthy(interp, &__t2931) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t2930 = - Value::sym(interp.intern("remove-duplicates")); - rt::apply_direct(interp, "shen.f-error", &[__t2930])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_remove_x2d_duplicates(interp: &mut Interp) { - interp.register_native("remove-duplicates", 1, aot_remove_x2d_duplicates); - interp.register_aot_direct("remove-duplicates", aot_remove_x2d_duplicates); -} - -/// AOT-compiled from KL `(defun trim-left-if ...)` -pub fn aot_trim_x2d_left_x2d_if(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "trim-left-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1237 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1238 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2964 = { - let __t2962 = Value::nil(); - let __t2963 = v_V1238.clone(); - rt::eq(&__t2962, &__t2963) - }; - if match rt::is_truthy(interp, &__t2964) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t2961 = { - let __t2956 = { - let __t2953 = v_V1238.clone(); - rt::is_cons(&__t2953) - }; - if !rt::is_truthy(interp, &__t2956)? { - Value::bool(false) - } else { - let __t2957 = { - let __t2955 = { - let __t2954 = v_V1238.clone(); - rt::hd(&__t2954)? - }; - rt::apply_value(interp, v_V1237.clone(), &[__t2955])? - }; - Value::bool(rt::is_truthy(interp, &__t2957)?) - } - }; - if match rt::is_truthy(interp, &__t2961) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2958 = v_V1237.clone(); - let __t2960 = { - let __t2959 = v_V1238.clone(); - rt::tl(&__t2959)? - }; - v_V1237 = __t2958; - v_V1238 = __t2960; - continue; - } - } else { - { - let __t2952 = Value::bool(true); - if match rt::is_truthy(interp, &__t2952) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1238.clone()); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_trim_x2d_left_x2d_if(interp: &mut Interp) { - interp.register_native("trim-left-if", 2, aot_trim_x2d_left_x2d_if); - interp.register_aot_direct("trim-left-if", aot_trim_x2d_left_x2d_if); -} - -/// AOT-compiled from KL `(defun trim-right-if ...)` -pub fn aot_trim_x2d_right_x2d_if(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "trim-right-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1241 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1242 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2968 = { - let __t2965 = v_V1241.clone(); - let __t2967 = { - let __t2966 = v_V1242.clone(); - rt::apply_direct(interp, "reverse", &[__t2966])? - }; - rt::apply_direct(interp, "trim-left-if", &[__t2965, __t2967])? - }; - rt::apply_direct(interp, "reverse", &[__t2968])? - }); - } -} - -fn install_trim_x2d_right_x2d_if(interp: &mut Interp) { - interp.register_native("trim-right-if", 2, aot_trim_x2d_right_x2d_if); - interp.register_aot_direct("trim-right-if", aot_trim_x2d_right_x2d_if); -} - -/// AOT-compiled from KL `(defun trim-if ...)` -pub fn aot_trim_x2d_if(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "trim-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1245 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1246 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2969 = v_V1245.clone(); - let __t2972 = { - let __t2970 = v_V1245.clone(); - let __t2971 = v_V1246.clone(); - rt::apply_direct(interp, "trim-left-if", &[__t2970, __t2971])? - }; - rt::apply_direct(interp, "trim-right-if", &[__t2969, __t2972])? - }); - } -} - -fn install_trim_x2d_if(interp: &mut Interp) { - interp.register_native("trim-if", 2, aot_trim_x2d_if); - interp.register_aot_direct("trim-if", aot_trim_x2d_if); -} - -/// AOT-compiled from KL `(defun trim-left ...)` -pub fn aot_trim_x2d_left(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "trim-left: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1253 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1254 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t2986 = { - let __t2984 = Value::nil(); - let __t2985 = v_V1254.clone(); - rt::eq(&__t2984, &__t2985) - }; - if match rt::is_truthy(interp, &__t2986) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t2983 = { - let __t2978 = { - let __t2974 = v_V1254.clone(); - rt::is_cons(&__t2974) - }; - if !rt::is_truthy(interp, &__t2978)? { - Value::bool(false) - } else { - let __t2979 = { - let __t2976 = { - let __t2975 = v_V1254.clone(); - rt::hd(&__t2975)? - }; - let __t2977 = v_V1253.clone(); - rt::apply_direct(interp, "element?", &[__t2976, __t2977])? - }; - Value::bool(rt::is_truthy(interp, &__t2979)?) - } - }; - if match rt::is_truthy(interp, &__t2983) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t2980 = v_V1253.clone(); - let __t2982 = { - let __t2981 = v_V1254.clone(); - rt::tl(&__t2981)? - }; - v_V1253 = __t2980; - v_V1254 = __t2982; - continue; - } - } else { - { - let __t2973 = Value::bool(true); - if match rt::is_truthy(interp, &__t2973) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1254.clone()); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_trim_x2d_left(interp: &mut Interp) { - interp.register_native("trim-left", 2, aot_trim_x2d_left); - interp.register_aot_direct("trim-left", aot_trim_x2d_left); -} - -/// AOT-compiled from KL `(defun trim-right ...)` -pub fn aot_trim_x2d_right(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "trim-right: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1257 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1258 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2990 = { - let __t2987 = v_V1257.clone(); - let __t2989 = { - let __t2988 = v_V1258.clone(); - rt::apply_direct(interp, "reverse", &[__t2988])? - }; - rt::apply_direct(interp, "trim-left", &[__t2987, __t2989])? - }; - rt::apply_direct(interp, "reverse", &[__t2990])? - }); - } -} - -fn install_trim_x2d_right(interp: &mut Interp) { - interp.register_native("trim-right", 2, aot_trim_x2d_right); - interp.register_aot_direct("trim-right", aot_trim_x2d_right); -} - -/// AOT-compiled from KL `(defun trim ...)` -pub fn aot_trim(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "trim: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1261 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1262 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t2991 = v_V1261.clone(); - let __t2994 = { - let __t2992 = v_V1261.clone(); - let __t2993 = v_V1262.clone(); - rt::apply_direct(interp, "trim-left", &[__t2992, __t2993])? - }; - rt::apply_direct(interp, "trim-right", &[__t2991, __t2994])? - }); - } -} - -fn install_trim(interp: &mut Interp) { - interp.register_native("trim", 2, aot_trim); - interp.register_aot_direct("trim", aot_trim); -} - -/// AOT-compiled from KL `(defun prefix? ...)` -pub fn aot_prefix_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "prefix?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1272 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1273 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3013 = { - let __t3011 = Value::nil(); - let __t3012 = v_V1272.clone(); - rt::eq(&__t3011, &__t3012) - }; - if match rt::is_truthy(interp, &__t3013) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3010 = { - let __t3004 = { - let __t2996 = v_V1272.clone(); - rt::is_cons(&__t2996) - }; - if !rt::is_truthy(interp, &__t3004)? { - Value::bool(false) - } else { - let __t3005 = { - let __t3002 = { - let __t2997 = v_V1273.clone(); - rt::is_cons(&__t2997) - }; - if !rt::is_truthy(interp, &__t3002)? { - Value::bool(false) - } else { - let __t3003 = { - let __t2999 = { - let __t2998 = v_V1272.clone(); - rt::hd(&__t2998)? - }; - let __t3001 = { - let __t3000 = v_V1273.clone(); - rt::hd(&__t3000)? - }; - rt::eq(&__t2999, &__t3001) - }; - Value::bool(rt::is_truthy(interp, &__t3003)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t3005)?) - } - }; - if match rt::is_truthy(interp, &__t3010) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3007 = { - let __t3006 = v_V1272.clone(); - rt::tl(&__t3006)? - }; - let __t3009 = { - let __t3008 = v_V1273.clone(); - rt::tl(&__t3008)? - }; - v_V1272 = __t3007; - v_V1273 = __t3009; - continue; - } - } else { - { - let __t2995 = Value::bool(true); - if match rt::is_truthy(interp, &__t2995) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_prefix_x3f_(interp: &mut Interp) { - interp.register_native("prefix?", 2, aot_prefix_x3f_); - interp.register_aot_direct("prefix?", aot_prefix_x3f_); -} - -/// AOT-compiled from KL `(defun infix? ...)` -pub fn aot_infix_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "infix?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1280 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1281 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3026 = { - let __t3024 = v_V1280.clone(); - let __t3025 = v_V1281.clone(); - rt::apply_direct(interp, "prefix?", &[__t3024, __t3025])? - }; - if match rt::is_truthy(interp, &__t3026) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3023 = { - let __t3021 = Value::nil(); - let __t3022 = v_V1281.clone(); - rt::eq(&__t3021, &__t3022) - }; - if match rt::is_truthy(interp, &__t3023) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t3020 = { - let __t3016 = v_V1281.clone(); - rt::is_cons(&__t3016) - }; - if match rt::is_truthy(interp, &__t3020) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3017 = v_V1280.clone(); - let __t3019 = { - let __t3018 = v_V1281.clone(); - rt::tl(&__t3018)? - }; - v_V1280 = __t3017; - v_V1281 = __t3019; - continue; - } - } else { - { - let __t3015 = Value::bool(true); - if match rt::is_truthy(interp, &__t3015) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3014 = Value::sym(interp.intern("infix?")); - rt::apply_direct(interp, "shen.f-error", &[__t3014])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_infix_x3f_(interp: &mut Interp) { - interp.register_native("infix?", 2, aot_infix_x3f_); - interp.register_aot_direct("infix?", aot_infix_x3f_); -} - -/// AOT-compiled from KL `(defun suffix? ...)` -pub fn aot_suffix_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "suffix?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1284 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1285 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3028 = { - let __t3027 = v_V1284.clone(); - rt::apply_direct(interp, "reverse", &[__t3027])? - }; - let __t3030 = { - let __t3029 = v_V1285.clone(); - rt::apply_direct(interp, "reverse", &[__t3029])? - }; - rt::apply_direct(interp, "prefix?", &[__t3028, __t3030])? - }); - } -} - -fn install_suffix_x3f_(interp: &mut Interp) { - interp.register_native("suffix?", 2, aot_suffix_x3f_); - interp.register_aot_direct("suffix?", aot_suffix_x3f_); -} - -/// AOT-compiled from KL `(defun subset? ...)` -pub fn aot_subset_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "subset?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1294 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1295 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3044 = { - let __t3042 = Value::nil(); - let __t3043 = v_V1294.clone(); - rt::eq(&__t3042, &__t3043) - }; - if match rt::is_truthy(interp, &__t3044) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3041 = { - let __t3036 = { - let __t3032 = v_V1294.clone(); - rt::is_cons(&__t3032) - }; - if !rt::is_truthy(interp, &__t3036)? { - Value::bool(false) - } else { - let __t3037 = { - let __t3034 = { - let __t3033 = v_V1294.clone(); - rt::hd(&__t3033)? - }; - let __t3035 = v_V1295.clone(); - rt::apply_direct(interp, "element?", &[__t3034, __t3035])? - }; - Value::bool(rt::is_truthy(interp, &__t3037)?) - } - }; - if match rt::is_truthy(interp, &__t3041) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3039 = { - let __t3038 = v_V1294.clone(); - rt::tl(&__t3038)? - }; - let __t3040 = v_V1295.clone(); - v_V1294 = __t3039; - v_V1295 = __t3040; - continue; - } - } else { - { - let __t3031 = Value::bool(true); - if match rt::is_truthy(interp, &__t3031) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_subset_x3f_(interp: &mut Interp) { - interp.register_native("subset?", 2, aot_subset_x3f_); - interp.register_aot_direct("subset?", aot_subset_x3f_); -} - -/// AOT-compiled from KL `(defun set=? ...)` -pub fn aot_set_x3d__x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "set=?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1298 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1299 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3047 = { - let __t3045 = v_V1298.clone(); - let __t3046 = v_V1299.clone(); - rt::apply_direct(interp, "subset?", &[__t3045, __t3046])? - }; - if !match rt::is_truthy(interp, &__t3047) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t3048 = v_V1299.clone(); - let __t3049 = v_V1298.clone(); - rt::apply_direct(interp, "subset?", &[__t3048, __t3049])? - }); - } - } - } -} - -fn install_set_x3d__x3f_(interp: &mut Interp) { - interp.register_native("set=?", 2, aot_set_x3d__x3f_); - interp.register_aot_direct("set=?", aot_set_x3d__x3f_); -} - -/// AOT-compiled from KL `(defun set? ...)` -pub fn aot_set_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "set?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1304 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3066 = { - let __t3064 = Value::nil(); - let __t3065 = v_V1304.clone(); - rt::eq(&__t3064, &__t3065) - }; - if match rt::is_truthy(interp, &__t3066) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3063 = { - let __t3061 = { - let __t3056 = v_V1304.clone(); - rt::is_cons(&__t3056) - }; - if !rt::is_truthy(interp, &__t3061)? { - Value::bool(false) - } else { - let __t3062 = { - let __t3058 = { - let __t3057 = v_V1304.clone(); - rt::hd(&__t3057)? - }; - let __t3060 = { - let __t3059 = v_V1304.clone(); - rt::tl(&__t3059)? - }; - rt::apply_direct(interp, "element?", &[__t3058, __t3060])? - }; - Value::bool(rt::is_truthy(interp, &__t3062)?) - } - }; - if match rt::is_truthy(interp, &__t3063) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t3055 = { - let __t3052 = v_V1304.clone(); - rt::is_cons(&__t3052) - }; - if match rt::is_truthy(interp, &__t3055) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3054 = { - let __t3053 = v_V1304.clone(); - rt::tl(&__t3053)? - }; - v_V1304 = __t3054; - continue; - } - } else { - { - let __t3051 = Value::bool(true); - if match rt::is_truthy(interp, &__t3051) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3050 = Value::sym(interp.intern("set?")); - rt::apply_direct(interp, "shen.f-error", &[__t3050])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_set_x3f_(interp: &mut Interp) { - interp.register_native("set?", 1, aot_set_x3f_); - interp.register_aot_direct("set?", aot_set_x3f_); -} - -/// AOT-compiled from KL `(defun n-times ...)` -pub fn aot_n_x2d_times(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "n-times: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1306 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1307 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3067 = v_V1307.clone(); - let __t3068 = v_V1306.clone(); - let __t3069 = Value::nil(); - rt::apply_direct(interp, "list.n-times-h", &[__t3067, __t3068, __t3069])? - }); - } -} - -fn install_n_x2d_times(interp: &mut Interp) { - interp.register_native("n-times", 2, aot_n_x2d_times); - interp.register_aot_direct("n-times", aot_n_x2d_times); -} - -/// AOT-compiled from KL `(defun list.n-times-h ...)` -pub fn aot_list_x2e_n_x2d_times_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "list.n-times-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1310 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1311 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1312 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3080 = { - let __t3078 = Value::int(0i64); - let __t3079 = v_V1310.clone(); - rt::eq(&__t3078, &__t3079) - }; - if match rt::is_truthy(interp, &__t3080) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1312.clone()); - } else { - { - let __t3077 = Value::bool(true); - if match rt::is_truthy(interp, &__t3077) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3072 = { - let __t3070 = v_V1310.clone(); - let __t3071 = Value::int(1i64); - rt::sub(&__t3070, &__t3071)? - }; - let __t3073 = v_V1311.clone(); - let __t3076 = { - let __t3074 = v_V1311.clone(); - let __t3075 = v_V1312.clone(); - rt::cons(&__t3074, &__t3075) - }; - v_V1310 = __t3072; - v_V1311 = __t3073; - v_V1312 = __t3076; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_list_x2e_n_x2d_times_x2d_h(interp: &mut Interp) { - interp.register_native("list.n-times-h", 3, aot_list_x2e_n_x2d_times_x2d_h); - interp.register_aot_direct("list.n-times-h", aot_list_x2e_n_x2d_times_x2d_h); -} - -/// AOT-compiled from KL `(defun subbag? ...)` -pub fn aot_subbag_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "subbag?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1316 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1317 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3087 = { - let v_V1316 = v_V1316.clone(); - let v_V1317 = v_V1317.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1318 = args[0].clone(); - Ok({ - let __t3083 = { - let __t3081 = v_Z1318.clone(); - let __t3082 = v_V1316.clone(); - rt::apply_direct(interp, "count", &[__t3081, __t3082])? - }; - let __t3086 = { - let __t3084 = v_Z1318.clone(); - let __t3085 = v_V1317.clone(); - rt::apply_direct(interp, "count", &[__t3084, __t3085])? - }; - rt::eq(&__t3083, &__t3086) - }) - }, - vec![v_V1316, v_V1317], - interp, - ) - }; - let __t3088 = v_V1316.clone(); - rt::apply_direct(interp, "every?", &[__t3087, __t3088])? - }); - } -} - -fn install_subbag_x3f_(interp: &mut Interp) { - interp.register_native("subbag?", 2, aot_subbag_x3f_); - interp.register_aot_direct("subbag?", aot_subbag_x3f_); -} - -/// AOT-compiled from KL `(defun bag=? ...)` -pub fn aot_bag_x3d__x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "bag=?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1321 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1322 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3091 = { - let __t3089 = v_V1321.clone(); - let __t3090 = v_V1322.clone(); - rt::apply_direct(interp, "subbag?", &[__t3089, __t3090])? - }; - if !match rt::is_truthy(interp, &__t3091) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t3092 = v_V1322.clone(); - let __t3093 = v_V1321.clone(); - rt::apply_direct(interp, "subbag?", &[__t3092, __t3093])? - }); - } - } - } -} - -fn install_bag_x3d__x3f_(interp: &mut Interp) { - interp.register_native("bag=?", 2, aot_bag_x3d__x3f_); - interp.register_aot_direct("bag=?", aot_bag_x3d__x3f_); -} - -/// AOT-compiled from KL `(defun mapc ...)` -pub fn aot_mapc(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "mapc: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1327 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1328 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3105 = { - let __t3103 = Value::nil(); - let __t3104 = v_V1328.clone(); - rt::eq(&__t3103, &__t3104) - }; - if match rt::is_truthy(interp, &__t3105) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3102 = { - let __t3096 = v_V1328.clone(); - rt::is_cons(&__t3096) - }; - if match rt::is_truthy(interp, &__t3102) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3099 = { - let _ = { - let __t3098 = { - let __t3097 = v_V1328.clone(); - rt::hd(&__t3097)? - }; - rt::apply_value(interp, v_V1327.clone(), &[__t3098])? - }; - v_V1327.clone() - }; - let __t3101 = { - let __t3100 = v_V1328.clone(); - rt::tl(&__t3100)? - }; - v_V1327 = __t3099; - v_V1328 = __t3101; - continue; - } - } else { - { - let __t3095 = Value::bool(true); - if match rt::is_truthy(interp, &__t3095) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3094 = Value::sym(interp.intern("mapc")); - rt::apply_direct(interp, "shen.f-error", &[__t3094])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_mapc(interp: &mut Interp) { - interp.register_native("mapc", 2, aot_mapc); - interp.register_aot_direct("mapc", aot_mapc); -} - -/// AOT-compiled from KL `(defun permute ...)` -pub fn aot_permute(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "permute: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1331 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3120 = { - let __t3116 = Value::nil(); - let __t3117 = v_V1331.clone(); - rt::eq(&__t3116, &__t3117) - }; - if match rt::is_truthy(interp, &__t3120) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3118 = Value::nil(); - let __t3119 = Value::nil(); - rt::cons(&__t3118, &__t3119) - }); - } else { - { - let __t3115 = Value::bool(true); - if match rt::is_truthy(interp, &__t3115) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3113 = { - let v_V1331 = v_V1331.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1332 = args[0].clone(); - Ok({ - let __t3108 = { - let v_Z1332 = v_Z1332.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1333 = args[0].clone(); - Ok({ - let __t3106 = v_Z1332.clone(); - let __t3107 = v_Z1333.clone(); - rt::cons(&__t3106, &__t3107) - }) - }, - vec![v_Z1332], - interp, - ) - }; - let __t3112 = { - let __t3111 = { - let __t3109 = v_Z1332.clone(); - let __t3110 = v_V1331.clone(); - rt::apply_direct( - interp, - "remove", - &[__t3109, __t3110], - )? - }; - rt::apply_direct(interp, "permute", &[__t3111])? - }; - rt::apply_direct(interp, "map", &[__t3108, __t3112])? - }) - }, - vec![v_V1331], - interp, - ) - }; - let __t3114 = v_V1331.clone(); - rt::apply_direct(interp, "mapcan", &[__t3113, __t3114])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_permute(interp: &mut Interp) { - interp.register_native("permute", 1, aot_permute); - interp.register_aot_direct("permute", aot_permute); -} - -/// AOT-compiled from KL `(defun count-if ...)` -pub fn aot_count_x2d_if(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "count-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1335 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1336 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3127 = { - let __t3125 = { - let v_V1335 = v_V1335.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1337 = args[0].clone(); - Ok({ - let __t3124 = { - let __t3121 = v_Z1337.clone(); - rt::apply_value(interp, v_V1335.clone(), &[__t3121])? - }; - if rt::is_truthy(interp, &__t3124)? { - { - let __t3122 = v_Z1337.clone(); - let __t3123 = Value::nil(); - rt::cons(&__t3122, &__t3123) - } - } else { - Value::nil() - } - }) - }, - vec![v_V1335], - interp, - ) - }; - let __t3126 = v_V1336.clone(); - rt::apply_direct(interp, "mapcan", &[__t3125, __t3126])? - }; - rt::apply_direct(interp, "length", &[__t3127])? - }); - } -} - -fn install_count_x2d_if(interp: &mut Interp) { - interp.register_native("count-if", 2, aot_count_x2d_if); - interp.register_aot_direct("count-if", aot_count_x2d_if); -} - -/// AOT-compiled from KL `(defun count ...)` -pub fn aot_count(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "count: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1341 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1342 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3130 = { - let v_V1341 = v_V1341.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1343 = args[0].clone(); - Ok({ - let __t3128 = v_V1341.clone(); - let __t3129 = v_Z1343.clone(); - rt::eq(&__t3128, &__t3129) - }) - }, - vec![v_V1341], - interp, - ) - }; - let __t3131 = v_V1342.clone(); - rt::apply_direct(interp, "count-if", &[__t3130, __t3131])? - }); - } -} - -fn install_count(interp: &mut Interp) { - interp.register_native("count", 2, aot_count); - interp.register_aot_direct("count", aot_count); -} - -/// AOT-compiled from KL `(defun some? ...)` -pub fn aot_some_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "some?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1351 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1352 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3147 = { - let __t3145 = Value::nil(); - let __t3146 = v_V1352.clone(); - rt::eq(&__t3145, &__t3146) - }; - if match rt::is_truthy(interp, &__t3147) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t3144 = { - let __t3142 = { - let __t3139 = v_V1352.clone(); - rt::is_cons(&__t3139) - }; - if !rt::is_truthy(interp, &__t3142)? { - Value::bool(false) - } else { - let __t3143 = { - let __t3141 = { - let __t3140 = v_V1352.clone(); - rt::hd(&__t3140)? - }; - rt::apply_value(interp, v_V1351.clone(), &[__t3141])? - }; - Value::bool(rt::is_truthy(interp, &__t3143)?) - } - }; - if match rt::is_truthy(interp, &__t3144) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3138 = { - let __t3134 = v_V1352.clone(); - rt::is_cons(&__t3134) - }; - if match rt::is_truthy(interp, &__t3138) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3135 = v_V1351.clone(); - let __t3137 = { - let __t3136 = v_V1352.clone(); - rt::tl(&__t3136)? - }; - v_V1351 = __t3135; - v_V1352 = __t3137; - continue; - } - } else { - { - let __t3133 = Value::bool(true); - if match rt::is_truthy(interp, &__t3133) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3132 = Value::sym(interp.intern("some?")); - rt::apply_direct(interp, "shen.f-error", &[__t3132])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_some_x3f_(interp: &mut Interp) { - interp.register_native("some?", 2, aot_some_x3f_); - interp.register_aot_direct("some?", aot_some_x3f_); -} - -/// AOT-compiled from KL `(defun every? ...)` -pub fn aot_every_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "every?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1361 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1362 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3160 = { - let __t3158 = Value::nil(); - let __t3159 = v_V1362.clone(); - rt::eq(&__t3158, &__t3159) - }; - if match rt::is_truthy(interp, &__t3160) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3157 = { - let __t3152 = { - let __t3149 = v_V1362.clone(); - rt::is_cons(&__t3149) - }; - if !rt::is_truthy(interp, &__t3152)? { - Value::bool(false) - } else { - let __t3153 = { - let __t3151 = { - let __t3150 = v_V1362.clone(); - rt::hd(&__t3150)? - }; - rt::apply_value(interp, v_V1361.clone(), &[__t3151])? - }; - Value::bool(rt::is_truthy(interp, &__t3153)?) - } - }; - if match rt::is_truthy(interp, &__t3157) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3154 = v_V1361.clone(); - let __t3156 = { - let __t3155 = v_V1362.clone(); - rt::tl(&__t3155)? - }; - v_V1361 = __t3154; - v_V1362 = __t3156; - continue; - } - } else { - { - let __t3148 = Value::bool(true); - if match rt::is_truthy(interp, &__t3148) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_every_x3f_(interp: &mut Interp) { - interp.register_native("every?", 2, aot_every_x3f_); - interp.register_aot_direct("every?", aot_every_x3f_); -} - -/// AOT-compiled from KL `(defun sort ...)` -pub fn aot_sort(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "sort: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1369 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1370 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3206 = { - let __t3204 = Value::nil(); - let __t3205 = v_V1370.clone(); - rt::eq(&__t3204, &__t3205) - }; - if match rt::is_truthy(interp, &__t3206) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3203 = { - let __t3201 = { - let __t3197 = v_V1370.clone(); - rt::is_cons(&__t3197) - }; - if !rt::is_truthy(interp, &__t3201)? { - Value::bool(false) - } else { - let __t3202 = { - let __t3198 = Value::nil(); - let __t3200 = { - let __t3199 = v_V1370.clone(); - rt::tl(&__t3199)? - }; - rt::eq(&__t3198, &__t3200) - }; - Value::bool(rt::is_truthy(interp, &__t3202)?) - } - }; - if match rt::is_truthy(interp, &__t3203) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1370.clone()); - } else { - { - let __t3196 = { - let __t3163 = v_V1370.clone(); - rt::is_cons(&__t3163) - }; - if match rt::is_truthy(interp, &__t3196) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1371 = { - let __t3171 = { - let v_V1369 = v_V1369.clone(); - let v_V1370 = v_V1370.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1372 = args[0].clone(); - Ok({ - let __t3170 = { - let __t3165 = { - let __t3164 = v_Z1372.clone(); - rt::apply_value( - interp, - v_V1369.clone(), - &[__t3164], - )? - }; - let __t3167 = { - let __t3166 = v_V1370.clone(); - rt::hd(&__t3166)? - }; - rt::apply_value( - interp, - __t3165, - &[__t3167], - )? - }; - if rt::is_truthy(interp, &__t3170)? { - { - let __t3168 = v_Z1372.clone(); - let __t3169 = Value::nil(); - rt::cons(&__t3168, &__t3169) - } - } else { - Value::nil() - } - }) - }, - vec![v_V1369, v_V1370], - interp, - ) - }; - let __t3173 = { - let __t3172 = v_V1370.clone(); - rt::tl(&__t3172)? - }; - rt::apply_direct(interp, "mapcan", &[__t3171, __t3173])? - }; - { - let v_W1373 = { - let __t3182 = { - let v_V1369 = v_V1369.clone(); - let v_V1370 = v_V1370.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1374 = args[0].clone(); - Ok({ - let __t3181 = { - let __t3178 = { - let __t3175 = { - let __t3174 = - v_Z1374.clone(); - rt::apply_value( - interp, - v_V1369.clone(), - &[__t3174], - )? - }; - let __t3177 = { - let __t3176 = - v_V1370.clone(); - rt::hd(&__t3176)? - }; - rt::apply_value( - interp, - __t3175, - &[__t3177], - )? - }; - rt::apply_direct( - interp, - "not", - &[__t3178], - )? - }; - if rt::is_truthy(interp, &__t3181)? { - { - let __t3179 = v_Z1374.clone(); - let __t3180 = Value::nil(); - rt::cons(&__t3179, &__t3180) - } - } else { - Value::nil() - } - }) - }, - vec![v_V1369, v_V1370], - interp, - ) - }; - let __t3184 = { - let __t3183 = v_V1370.clone(); - rt::tl(&__t3183)? - }; - rt::apply_direct(interp, "mapcan", &[__t3182, __t3184])? - }; - break Ok({ - let __t3187 = { - let __t3185 = v_V1369.clone(); - let __t3186 = v_W1371.clone(); - rt::apply_direct( - interp, - "sort", - &[__t3185, __t3186], - )? - }; - let __t3195 = { - let __t3191 = { - let __t3189 = { - let __t3188 = v_V1370.clone(); - rt::hd(&__t3188)? - }; - let __t3190 = Value::nil(); - rt::cons(&__t3189, &__t3190) - }; - let __t3194 = { - let __t3192 = v_V1369.clone(); - let __t3193 = v_W1373.clone(); - rt::apply_direct( - interp, - "sort", - &[__t3192, __t3193], - )? - }; - rt::apply_direct( - interp, - "append", - &[__t3191, __t3194], - )? - }; - rt::apply_direct(interp, "append", &[__t3187, __t3195])? - }); - } - } - } else { - { - let __t3162 = Value::bool(true); - if match rt::is_truthy(interp, &__t3162) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3161 = Value::sym(interp.intern("sort")); - rt::apply_direct(interp, "shen.f-error", &[__t3161])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_sort(interp: &mut Interp) { - interp.register_native("sort", 2, aot_sort); - interp.register_aot_direct("sort", aot_sort); -} - -/// AOT-compiled from KL `(defun find ...)` -pub fn aot_find(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "find: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1382 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1383 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3224 = { - let __t3221 = Value::nil(); - let __t3222 = v_V1383.clone(); - rt::eq(&__t3221, &__t3222) - }; - if match rt::is_truthy(interp, &__t3224) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3223 = Value::str("find has found no element\n"); - rt::apply_direct(interp, "simple-error", &[__t3223])? - }); - } else { - { - let __t3220 = { - let __t3217 = { - let __t3214 = v_V1383.clone(); - rt::is_cons(&__t3214) - }; - if !rt::is_truthy(interp, &__t3217)? { - Value::bool(false) - } else { - let __t3218 = { - let __t3216 = { - let __t3215 = v_V1383.clone(); - rt::hd(&__t3215)? - }; - rt::apply_value(interp, v_V1382.clone(), &[__t3216])? - }; - Value::bool(rt::is_truthy(interp, &__t3218)?) - } - }; - if match rt::is_truthy(interp, &__t3220) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3219 = v_V1383.clone(); - rt::hd(&__t3219)? - }); - } else { - { - let __t3213 = { - let __t3209 = v_V1383.clone(); - rt::is_cons(&__t3209) - }; - if match rt::is_truthy(interp, &__t3213) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3210 = v_V1382.clone(); - let __t3212 = { - let __t3211 = v_V1383.clone(); - rt::tl(&__t3211)? - }; - v_V1382 = __t3210; - v_V1383 = __t3212; - continue; - } - } else { - { - let __t3208 = Value::bool(true); - if match rt::is_truthy(interp, &__t3208) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3207 = Value::sym(interp.intern("find")); - rt::apply_direct(interp, "shen.f-error", &[__t3207])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_find(interp: &mut Interp) { - interp.register_native("find", 2, aot_find); - interp.register_aot_direct("find", aot_find); -} - -/// AOT-compiled from KL `(defun foldr ...)` -pub fn aot_foldr(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "foldr: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1388 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1389 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1390 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3239 = { - let __t3237 = Value::nil(); - let __t3238 = v_V1390.clone(); - rt::eq(&__t3237, &__t3238) - }; - if match rt::is_truthy(interp, &__t3239) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1389.clone()); - } else { - { - let __t3236 = { - let __t3227 = v_V1390.clone(); - rt::is_cons(&__t3227) - }; - if match rt::is_truthy(interp, &__t3236) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3228 = v_V1388.clone(); - let __t3233 = { - let __t3231 = { - let __t3230 = { - let __t3229 = v_V1390.clone(); - rt::hd(&__t3229)? - }; - rt::apply_value(interp, v_V1388.clone(), &[__t3230])? - }; - let __t3232 = v_V1389.clone(); - rt::apply_value(interp, __t3231, &[__t3232])? - }; - let __t3235 = { - let __t3234 = v_V1390.clone(); - rt::tl(&__t3234)? - }; - v_V1388 = __t3228; - v_V1389 = __t3233; - v_V1390 = __t3235; - continue; - } - } else { - { - let __t3226 = Value::bool(true); - if match rt::is_truthy(interp, &__t3226) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3225 = Value::sym(interp.intern("foldr")); - rt::apply_direct(interp, "shen.f-error", &[__t3225])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_foldr(interp: &mut Interp) { - interp.register_native("foldr", 3, aot_foldr); - interp.register_aot_direct("foldr", aot_foldr); -} - -/// AOT-compiled from KL `(defun foldl ...)` -pub fn aot_foldl(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "foldl: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1396 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1397 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1398 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3254 = { - let __t3252 = Value::nil(); - let __t3253 = v_V1398.clone(); - rt::eq(&__t3252, &__t3253) - }; - if match rt::is_truthy(interp, &__t3254) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1397.clone()); - } else { - { - let __t3251 = { - let __t3242 = v_V1398.clone(); - rt::is_cons(&__t3242) - }; - if match rt::is_truthy(interp, &__t3251) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3243 = v_V1396.clone(); - let __t3248 = { - let __t3245 = { - let __t3244 = v_V1397.clone(); - rt::apply_value(interp, v_V1396.clone(), &[__t3244])? - }; - let __t3247 = { - let __t3246 = v_V1398.clone(); - rt::hd(&__t3246)? - }; - rt::apply_value(interp, __t3245, &[__t3247])? - }; - let __t3250 = { - let __t3249 = v_V1398.clone(); - rt::tl(&__t3249)? - }; - v_V1396 = __t3243; - v_V1397 = __t3248; - v_V1398 = __t3250; - continue; - } - } else { - { - let __t3241 = Value::bool(true); - if match rt::is_truthy(interp, &__t3241) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3240 = Value::sym(interp.intern("foldl")); - rt::apply_direct(interp, "shen.f-error", &[__t3240])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_foldl(interp: &mut Interp) { - interp.register_native("foldl", 3, aot_foldl); - interp.register_aot_direct("foldl", aot_foldl); -} - -/// AOT-compiled from KL `(defun mapf ...)` -pub fn aot_mapf(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "mapf: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1406 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1407 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1408 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3270 = { - let __t3268 = Value::nil(); - let __t3269 = v_V1407.clone(); - rt::eq(&__t3268, &__t3269) - }; - if match rt::is_truthy(interp, &__t3270) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3267 = { - let __t3257 = v_V1407.clone(); - rt::is_cons(&__t3257) - }; - if match rt::is_truthy(interp, &__t3267) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3261 = { - let __t3260 = { - let __t3259 = { - let __t3258 = v_V1407.clone(); - rt::hd(&__t3258)? - }; - rt::apply_value(interp, v_V1406.clone(), &[__t3259])? - }; - rt::apply_value(interp, v_V1408.clone(), &[__t3260])? - }; - let __t3266 = { - let __t3262 = v_V1406.clone(); - let __t3264 = { - let __t3263 = v_V1407.clone(); - rt::tl(&__t3263)? - }; - let __t3265 = v_V1408.clone(); - rt::apply_direct(interp, "mapf", &[__t3262, __t3264, __t3265])? - }; - rt::apply_value(interp, __t3261, &[__t3266])? - }); - } else { - { - let __t3256 = Value::bool(true); - if match rt::is_truthy(interp, &__t3256) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3255 = Value::sym(interp.intern("mapf")); - rt::apply_direct(interp, "shen.f-error", &[__t3255])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_mapf(interp: &mut Interp) { - interp.register_native("mapf", 3, aot_mapf); - interp.register_aot_direct("mapf", aot_mapf); -} - -/// AOT-compiled from KL `(defun filter ...)` -pub fn aot_filter(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "filter: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1414 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1415 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3289 = { - let __t3287 = Value::nil(); - let __t3288 = v_V1415.clone(); - rt::eq(&__t3287, &__t3288) - }; - if match rt::is_truthy(interp, &__t3289) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3286 = { - let __t3273 = v_V1415.clone(); - rt::is_cons(&__t3273) - }; - if match rt::is_truthy(interp, &__t3286) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3276 = { - let __t3275 = { - let __t3274 = v_V1415.clone(); - rt::hd(&__t3274)? - }; - rt::apply_value(interp, v_V1414.clone(), &[__t3275])? - }; - if match rt::is_truthy(interp, &__t3276) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3278 = { - let __t3277 = v_V1415.clone(); - rt::hd(&__t3277)? - }; - let __t3282 = { - let __t3279 = v_V1414.clone(); - let __t3281 = { - let __t3280 = v_V1415.clone(); - rt::tl(&__t3280)? - }; - rt::apply_direct(interp, "filter", &[__t3279, __t3281])? - }; - rt::cons(&__t3278, &__t3282) - }); - } else { - { - let __t3283 = v_V1414.clone(); - let __t3285 = { - let __t3284 = v_V1415.clone(); - rt::tl(&__t3284)? - }; - v_V1414 = __t3283; - v_V1415 = __t3285; - continue; - } - } - } - } else { - { - let __t3272 = Value::bool(true); - if match rt::is_truthy(interp, &__t3272) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3271 = Value::sym(interp.intern("filter")); - rt::apply_direct(interp, "shen.f-error", &[__t3271])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_filter(interp: &mut Interp) { - interp.register_native("filter", 2, aot_filter); - interp.register_aot_direct("filter", aot_filter); -} - -/// AOT-compiled from KL `(defun remove-if ...)` -pub fn aot_remove_x2d_if(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "remove-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1420 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1421 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3308 = { - let __t3306 = Value::nil(); - let __t3307 = v_V1421.clone(); - rt::eq(&__t3306, &__t3307) - }; - if match rt::is_truthy(interp, &__t3308) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3305 = { - let __t3292 = v_V1421.clone(); - rt::is_cons(&__t3292) - }; - if match rt::is_truthy(interp, &__t3305) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3295 = { - let __t3294 = { - let __t3293 = v_V1421.clone(); - rt::hd(&__t3293)? - }; - rt::apply_value(interp, v_V1420.clone(), &[__t3294])? - }; - if match rt::is_truthy(interp, &__t3295) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3296 = v_V1420.clone(); - let __t3298 = { - let __t3297 = v_V1421.clone(); - rt::tl(&__t3297)? - }; - v_V1420 = __t3296; - v_V1421 = __t3298; - continue; - } - } else { - break Ok({ - let __t3300 = { - let __t3299 = v_V1421.clone(); - rt::hd(&__t3299)? - }; - let __t3304 = { - let __t3301 = v_V1420.clone(); - let __t3303 = { - let __t3302 = v_V1421.clone(); - rt::tl(&__t3302)? - }; - rt::apply_direct(interp, "remove-if", &[__t3301, __t3303])? - }; - rt::cons(&__t3300, &__t3304) - }); - } - } - } else { - { - let __t3291 = Value::bool(true); - if match rt::is_truthy(interp, &__t3291) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3290 = Value::sym(interp.intern("remove-if")); - rt::apply_direct(interp, "shen.f-error", &[__t3290])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_remove_x2d_if(interp: &mut Interp) { - interp.register_native("remove-if", 2, aot_remove_x2d_if); - interp.register_aot_direct("remove-if", aot_remove_x2d_if); -} - -/// AOT-compiled from KL `(defun list.reduce ...)` -pub fn aot_list_x2e_reduce(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "list.reduce: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1424 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1425 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1426 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3323 = { - let __t3321 = Value::nil(); - let __t3322 = v_V1426.clone(); - rt::eq(&__t3321, &__t3322) - }; - if match rt::is_truthy(interp, &__t3323) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1425.clone()); - } else { - { - let __t3320 = { - let __t3311 = v_V1426.clone(); - rt::is_cons(&__t3311) - }; - if match rt::is_truthy(interp, &__t3320) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3312 = v_V1424.clone(); - let __t3317 = { - let __t3314 = { - let __t3313 = v_V1425.clone(); - rt::apply_value(interp, v_V1424.clone(), &[__t3313])? - }; - let __t3316 = { - let __t3315 = v_V1426.clone(); - rt::hd(&__t3315)? - }; - rt::apply_value(interp, __t3314, &[__t3316])? - }; - let __t3319 = { - let __t3318 = v_V1426.clone(); - rt::tl(&__t3318)? - }; - v_V1424 = __t3312; - v_V1425 = __t3317; - v_V1426 = __t3319; - continue; - } - } else { - { - let __t3310 = Value::bool(true); - if match rt::is_truthy(interp, &__t3310) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3309 = Value::sym(interp.intern("list.reduce")); - rt::apply_direct(interp, "shen.f-error", &[__t3309])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_list_x2e_reduce(interp: &mut Interp) { - interp.register_native("list.reduce", 3, aot_list_x2e_reduce); - interp.register_aot_direct("list.reduce", aot_list_x2e_reduce); -} - -/// AOT-compiled from KL `(defun take ...)` -pub fn aot_take(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "take: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1434 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1435 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3341 = { - let __t3339 = Value::int(0i64); - let __t3340 = v_V1434.clone(); - rt::eq(&__t3339, &__t3340) - }; - if match rt::is_truthy(interp, &__t3341) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3338 = { - let __t3336 = Value::nil(); - let __t3337 = v_V1435.clone(); - rt::eq(&__t3336, &__t3337) - }; - if match rt::is_truthy(interp, &__t3338) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3335 = { - let __t3326 = v_V1435.clone(); - rt::is_cons(&__t3326) - }; - if match rt::is_truthy(interp, &__t3335) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3328 = { - let __t3327 = v_V1435.clone(); - rt::hd(&__t3327)? - }; - let __t3334 = { - let __t3331 = { - let __t3329 = v_V1434.clone(); - let __t3330 = Value::int(1i64); - rt::sub(&__t3329, &__t3330)? - }; - let __t3333 = { - let __t3332 = v_V1435.clone(); - rt::tl(&__t3332)? - }; - rt::apply_direct(interp, "take", &[__t3331, __t3333])? - }; - rt::cons(&__t3328, &__t3334) - }); - } else { - { - let __t3325 = Value::bool(true); - if match rt::is_truthy(interp, &__t3325) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3324 = Value::sym(interp.intern("take")); - rt::apply_direct(interp, "shen.f-error", &[__t3324])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_take(interp: &mut Interp) { - interp.register_native("take", 2, aot_take); - interp.register_aot_direct("take", aot_take); -} - -/// AOT-compiled from KL `(defun take-last ...)` -pub fn aot_take_x2d_last(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "take-last: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1438 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1439 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3345 = { - let __t3342 = v_V1438.clone(); - let __t3344 = { - let __t3343 = v_V1439.clone(); - rt::apply_direct(interp, "reverse", &[__t3343])? - }; - rt::apply_direct(interp, "take", &[__t3342, __t3344])? - }; - rt::apply_direct(interp, "reverse", &[__t3345])? - }); - } -} - -fn install_take_x2d_last(interp: &mut Interp) { - interp.register_native("take-last", 2, aot_take_x2d_last); - interp.register_aot_direct("take-last", aot_take_x2d_last); -} - -/// AOT-compiled from KL `(defun cartprod ...)` -pub fn aot_cartprod(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "cartprod: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1444 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1445 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3364 = { - let __t3362 = Value::nil(); - let __t3363 = v_V1444.clone(); - rt::eq(&__t3362, &__t3363) - }; - if match rt::is_truthy(interp, &__t3364) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3361 = { - let __t3348 = v_V1444.clone(); - rt::is_cons(&__t3348) - }; - if match rt::is_truthy(interp, &__t3361) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3356 = { - let __t3354 = { - let v_V1444 = v_V1444.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1446 = args[0].clone(); - Ok({ - let __t3350 = { - let __t3349 = v_V1444.clone(); - rt::hd(&__t3349)? - }; - let __t3353 = { - let __t3351 = v_Z1446.clone(); - let __t3352 = Value::nil(); - rt::cons(&__t3351, &__t3352) - }; - rt::cons(&__t3350, &__t3353) - }) - }, - vec![v_V1444], - interp, - ) - }; - let __t3355 = v_V1445.clone(); - rt::apply_direct(interp, "map", &[__t3354, __t3355])? - }; - let __t3360 = { - let __t3358 = { - let __t3357 = v_V1444.clone(); - rt::tl(&__t3357)? - }; - let __t3359 = v_V1445.clone(); - rt::apply_direct(interp, "cartprod", &[__t3358, __t3359])? - }; - rt::apply_direct(interp, "append", &[__t3356, __t3360])? - }); - } else { - { - let __t3347 = Value::bool(true); - if match rt::is_truthy(interp, &__t3347) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3346 = Value::sym(interp.intern("cartprod")); - rt::apply_direct(interp, "shen.f-error", &[__t3346])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_cartprod(interp: &mut Interp) { - interp.register_native("cartprod", 2, aot_cartprod); - interp.register_aot_direct("cartprod", aot_cartprod); -} - -/// AOT-compiled from KL `(defun powerset ...)` -pub fn aot_powerset(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "powerset: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1449 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3382 = { - let __t3378 = Value::nil(); - let __t3379 = v_V1449.clone(); - rt::eq(&__t3378, &__t3379) - }; - if match rt::is_truthy(interp, &__t3382) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3380 = Value::nil(); - let __t3381 = Value::nil(); - rt::cons(&__t3380, &__t3381) - }); - } else { - { - let __t3377 = { - let __t3367 = v_V1449.clone(); - rt::is_cons(&__t3367) - }; - if match rt::is_truthy(interp, &__t3377) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1450 = { - let __t3369 = { - let __t3368 = v_V1449.clone(); - rt::tl(&__t3368)? - }; - rt::apply_direct(interp, "powerset", &[__t3369])? - }; - break Ok({ - let __t3370 = v_W1450.clone(); - let __t3376 = { - let __t3374 = { - let v_V1449 = v_V1449.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1451 = args[0].clone(); - Ok({ - let __t3372 = { - let __t3371 = v_V1449.clone(); - rt::hd(&__t3371)? - }; - let __t3373 = v_Z1451.clone(); - rt::cons(&__t3372, &__t3373) - }) - }, - vec![v_V1449], - interp, - ) - }; - let __t3375 = v_W1450.clone(); - rt::apply_direct(interp, "map", &[__t3374, __t3375])? - }; - rt::apply_direct(interp, "append", &[__t3370, __t3376])? - }); - } - } else { - { - let __t3366 = Value::bool(true); - if match rt::is_truthy(interp, &__t3366) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3365 = Value::sym(interp.intern("powerset")); - rt::apply_direct(interp, "shen.f-error", &[__t3365])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_powerset(interp: &mut Interp) { - interp.register_native("powerset", 1, aot_powerset); - interp.register_aot_direct("powerset", aot_powerset); -} - -/// AOT-compiled from KL `(defun partition ...)` -pub fn aot_partition(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "partition: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1459 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1460 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3404 = { - let __t3402 = Value::nil(); - let __t3403 = v_V1460.clone(); - rt::eq(&__t3402, &__t3403) - }; - if match rt::is_truthy(interp, &__t3404) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3401 = { - let __t3385 = v_V1460.clone(); - rt::is_cons(&__t3385) - }; - if match rt::is_truthy(interp, &__t3401) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1461 = { - let __t3393 = { - let v_V1459 = v_V1459.clone(); - let v_V1460 = v_V1460.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1462 = args[0].clone(); - Ok({ - let __t3392 = { - let __t3388 = { - let __t3387 = { - let __t3386 = v_V1460.clone(); - rt::hd(&__t3386)? - }; - rt::apply_value( - interp, - v_V1459.clone(), - &[__t3387], - )? - }; - let __t3389 = v_Z1462.clone(); - rt::apply_value(interp, __t3388, &[__t3389])? - }; - if rt::is_truthy(interp, &__t3392)? { - { - let __t3390 = v_Z1462.clone(); - let __t3391 = Value::nil(); - rt::cons(&__t3390, &__t3391) - } - } else { - Value::nil() - } - }) - }, - vec![v_V1459, v_V1460], - interp, - ) - }; - let __t3394 = v_V1460.clone(); - rt::apply_direct(interp, "mapcan", &[__t3393, __t3394])? - }; - { - let v_W1463 = { - let __t3395 = v_V1460.clone(); - let __t3396 = v_W1461.clone(); - rt::apply_direct(interp, "difference", &[__t3395, __t3396])? - }; - break Ok({ - let __t3397 = v_W1461.clone(); - let __t3400 = { - let __t3398 = v_V1459.clone(); - let __t3399 = v_W1463.clone(); - rt::apply_direct(interp, "partition", &[__t3398, __t3399])? - }; - rt::cons(&__t3397, &__t3400) - }); - } - } - } else { - { - let __t3384 = Value::bool(true); - if match rt::is_truthy(interp, &__t3384) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3383 = Value::str("partition equires a list"); - rt::apply_direct(interp, "simple-error", &[__t3383])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_partition(interp: &mut Interp) { - interp.register_native("partition", 2, aot_partition); - interp.register_aot_direct("partition", aot_partition); -} - -/// AOT-compiled from KL `(defun transitive-closure ...)` -pub fn aot_transitive_x2d_closure(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "transitive-closure: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1466 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W1467 = { - let __t3405 = v_V1466.clone(); - let __t3406 = v_V1466.clone(); - rt::apply_direct(interp, "list.transitive-pass", &[__t3405, __t3406])? - }; - { - let __t3409 = { - let __t3407 = v_W1467.clone(); - let __t3408 = v_V1466.clone(); - rt::eq(&__t3407, &__t3408) - }; - if match rt::is_truthy(interp, &__t3409) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_W1467.clone()); - } else { - break Ok({ - let __t3410 = v_W1467.clone(); - let __t3411 = v_W1467.clone(); - rt::apply_direct(interp, "list.transitive-pass", &[__t3410, __t3411])? - }); - } - } - } - } -} - -fn install_transitive_x2d_closure(interp: &mut Interp) { - interp.register_native("transitive-closure", 1, aot_transitive_x2d_closure); - interp.register_aot_direct("transitive-closure", aot_transitive_x2d_closure); -} - -/// AOT-compiled from KL `(defun list.transitive-pass ...)` -pub fn aot_list_x2e_transitive_x2d_pass(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "list.transitive-pass: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1469 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1470 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3434 = { - let __t3432 = Value::nil(); - let __t3433 = v_V1469.clone(); - rt::eq(&__t3432, &__t3433) - }; - if match rt::is_truthy(interp, &__t3434) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1470.clone()); - } else { - { - let __t3431 = { - let __t3417 = { - let __t3414 = v_V1469.clone(); - rt::is_cons(&__t3414) - }; - if !rt::is_truthy(interp, &__t3417)? { - Value::bool(false) - } else { - let __t3418 = { - let __t3416 = { - let __t3415 = v_V1469.clone(); - rt::hd(&__t3415)? - }; - rt::apply_direct(interp, "tuple?", &[__t3416])? - }; - Value::bool(rt::is_truthy(interp, &__t3418)?) - } - }; - if match rt::is_truthy(interp, &__t3431) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1471 = { - let __t3421 = { - let __t3420 = { - let __t3419 = v_V1469.clone(); - rt::hd(&__t3419)? - }; - rt::apply_direct(interp, "fst", &[__t3420])? - }; - let __t3424 = { - let __t3423 = { - let __t3422 = v_V1469.clone(); - rt::hd(&__t3422)? - }; - rt::apply_direct(interp, "snd", &[__t3423])? - }; - let __t3425 = v_V1470.clone(); - rt::apply_direct( - interp, - "list.find-trans", - &[__t3421, __t3424, __t3425], - )? - }; - break Ok({ - let __t3426 = v_W1471.clone(); - let __t3430 = { - let __t3428 = { - let __t3427 = v_V1469.clone(); - rt::tl(&__t3427)? - }; - let __t3429 = v_V1470.clone(); - rt::apply_direct( - interp, - "list.transitive-pass", - &[__t3428, __t3429], - )? - }; - rt::apply_direct(interp, "union", &[__t3426, __t3430])? - }); - } - } else { - { - let __t3413 = Value::bool(true); - if match rt::is_truthy(interp, &__t3413) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3412 = Value::sym(interp.intern("list.transitive-pass")); - rt::apply_direct(interp, "shen.f-error", &[__t3412])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_list_x2e_transitive_x2d_pass(interp: &mut Interp) { - interp.register_native("list.transitive-pass", 2, aot_list_x2e_transitive_x2d_pass); - interp.register_aot_direct("list.transitive-pass", aot_list_x2e_transitive_x2d_pass); -} - -/// AOT-compiled from KL `(defun list.find-trans ...)` -pub fn aot_list_x2e_find_x2d_trans(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "list.find-trans: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1481 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1482 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1483 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3469 = { - let __t3467 = Value::nil(); - let __t3468 = v_V1483.clone(); - rt::eq(&__t3467, &__t3468) - }; - if match rt::is_truthy(interp, &__t3469) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3466 = { - let __t3452 = { - let __t3443 = v_V1483.clone(); - rt::is_cons(&__t3443) - }; - if !rt::is_truthy(interp, &__t3452)? { - Value::bool(false) - } else { - let __t3453 = { - let __t3450 = { - let __t3445 = { - let __t3444 = v_V1483.clone(); - rt::hd(&__t3444)? - }; - rt::apply_direct(interp, "tuple?", &[__t3445])? - }; - if !rt::is_truthy(interp, &__t3450)? { - Value::bool(false) - } else { - let __t3451 = { - let __t3446 = v_V1482.clone(); - let __t3449 = { - let __t3448 = { - let __t3447 = v_V1483.clone(); - rt::hd(&__t3447)? - }; - rt::apply_direct(interp, "fst", &[__t3448])? - }; - rt::eq(&__t3446, &__t3449) - }; - Value::bool(rt::is_truthy(interp, &__t3451)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t3453)?) - } - }; - if match rt::is_truthy(interp, &__t3466) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3458 = { - let __t3454 = v_V1481.clone(); - let __t3457 = { - let __t3456 = { - let __t3455 = v_V1483.clone(); - rt::hd(&__t3455)? - }; - rt::apply_direct(interp, "snd", &[__t3456])? - }; - rt::apply_direct(interp, "@p", &[__t3454, __t3457])? - }; - let __t3465 = { - let __t3459 = v_V1481.clone(); - let __t3462 = { - let __t3461 = { - let __t3460 = v_V1483.clone(); - rt::hd(&__t3460)? - }; - rt::apply_direct(interp, "fst", &[__t3461])? - }; - let __t3464 = { - let __t3463 = v_V1483.clone(); - rt::tl(&__t3463)? - }; - rt::apply_direct( - interp, - "list.find-trans", - &[__t3459, __t3462, __t3464], - )? - }; - rt::cons(&__t3458, &__t3465) - }); - } else { - { - let __t3442 = { - let __t3437 = v_V1483.clone(); - rt::is_cons(&__t3437) - }; - if match rt::is_truthy(interp, &__t3442) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3438 = v_V1481.clone(); - let __t3439 = v_V1482.clone(); - let __t3441 = { - let __t3440 = v_V1483.clone(); - rt::tl(&__t3440)? - }; - v_V1481 = __t3438; - v_V1482 = __t3439; - v_V1483 = __t3441; - continue; - } - } else { - { - let __t3436 = Value::bool(true); - if match rt::is_truthy(interp, &__t3436) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3435 = - Value::sym(interp.intern("list.find-trans")); - rt::apply_direct(interp, "shen.f-error", &[__t3435])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_list_x2e_find_x2d_trans(interp: &mut Interp) { - interp.register_native("list.find-trans", 3, aot_list_x2e_find_x2d_trans); - interp.register_aot_direct("list.find-trans", aot_list_x2e_find_x2d_trans); -} - -/// AOT-compiled from KL `(defun x->ascii ...)` -pub fn aot_x_x2d__x3e_ascii(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "x->ascii: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1488 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3471 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1489 = args[0].clone(); - Ok({ - let __t3470 = v_Z1489.clone(); - rt::apply_direct(interp, "string->n", &[__t3470])? - }) - }, - Vec::new(), - interp, - ) - }; - let __t3473 = { - let __t3472 = v_V1488.clone(); - rt::apply_direct(interp, "explode", &[__t3472])? - }; - rt::apply_direct(interp, "map", &[__t3471, __t3473])? - }); - } -} - -fn install_x_x2d__x3e_ascii(interp: &mut Interp) { - interp.register_native("x->ascii", 1, aot_x_x2d__x3e_ascii); - interp.register_aot_direct("x->ascii", aot_x_x2d__x3e_ascii); -} - -/// AOT-compiled from KL `(defun splice ...)` -pub fn aot_splice(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "splice: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1491 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1492 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1493 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3491 = { - let __t3487 = Value::int(1i64); - let __t3488 = v_V1491.clone(); - rt::eq(&__t3487, &__t3488) - }; - if match rt::is_truthy(interp, &__t3491) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3489 = v_V1492.clone(); - let __t3490 = v_V1493.clone(); - rt::apply_direct(interp, "append", &[__t3489, __t3490])? - }); - } else { - { - let __t3486 = { - let __t3476 = v_V1493.clone(); - rt::is_cons(&__t3476) - }; - if match rt::is_truthy(interp, &__t3486) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3478 = { - let __t3477 = v_V1493.clone(); - rt::hd(&__t3477)? - }; - let __t3485 = { - let __t3481 = { - let __t3479 = v_V1491.clone(); - let __t3480 = Value::int(1i64); - rt::sub(&__t3479, &__t3480)? - }; - let __t3482 = v_V1492.clone(); - let __t3484 = { - let __t3483 = v_V1493.clone(); - rt::tl(&__t3483)? - }; - rt::apply_direct(interp, "splice", &[__t3481, __t3482, __t3484])? - }; - rt::cons(&__t3478, &__t3485) - }); - } else { - { - let __t3475 = Value::bool(true); - if match rt::is_truthy(interp, &__t3475) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3474 = Value::sym(interp.intern("splice")); - rt::apply_direct(interp, "shen.f-error", &[__t3474])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_splice(interp: &mut Interp) { - interp.register_native("splice", 3, aot_splice); - interp.register_aot_direct("splice", aot_splice); -} - -/// AOT-compiled from KL `(defun string-macros ...)` -pub fn aot_string_x2d_macros(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string-macros: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1497 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3589 = { - let __t3568 = { - let __t3548 = v_V1497.clone(); - rt::is_cons(&__t3548) - }; - if !rt::is_truthy(interp, &__t3568)? { - Value::bool(false) - } else { - let __t3569 = { - let __t3566 = { - let __t3549 = Value::sym(interp.intern("s-op1")); - let __t3551 = { - let __t3550 = v_V1497.clone(); - rt::hd(&__t3550)? - }; - rt::eq(&__t3549, &__t3551) - }; - if !rt::is_truthy(interp, &__t3566)? { - Value::bool(false) - } else { - let __t3567 = { - let __t3564 = { - let __t3553 = { - let __t3552 = v_V1497.clone(); - rt::tl(&__t3552)? - }; - rt::is_cons(&__t3553) - }; - if !rt::is_truthy(interp, &__t3564)? { - Value::bool(false) - } else { - let __t3565 = { - let __t3562 = { - let __t3556 = { - let __t3555 = { - let __t3554 = v_V1497.clone(); - rt::tl(&__t3554)? - }; - rt::tl(&__t3555)? - }; - rt::is_cons(&__t3556) - }; - if !rt::is_truthy(interp, &__t3562)? { - Value::bool(false) - } else { - let __t3563 = { - let __t3557 = Value::nil(); - let __t3561 = { - let __t3560 = { - let __t3559 = { - let __t3558 = v_V1497.clone(); - rt::tl(&__t3558)? - }; - rt::tl(&__t3559)? - }; - rt::tl(&__t3560)? - }; - rt::eq(&__t3557, &__t3561) - }; - Value::bool(rt::is_truthy(interp, &__t3563)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t3565)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t3567)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t3569)?) - } - }; - if match rt::is_truthy(interp, &__t3589) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3570 = Value::sym(interp.intern("s-op1")); - let __t3588 = { - let __t3573 = { - let __t3572 = { - let __t3571 = v_V1497.clone(); - rt::tl(&__t3571)? - }; - rt::hd(&__t3572)? - }; - let __t3587 = { - let __t3577 = { - let __t3576 = { - let __t3575 = { - let __t3574 = v_V1497.clone(); - rt::tl(&__t3574)? - }; - rt::tl(&__t3575)? - }; - rt::hd(&__t3576)? - }; - let __t3586 = { - let __t3584 = { - let __t3578 = Value::sym(interp.intern("/.")); - let __t3583 = { - let __t3579 = Value::sym(interp.intern("X")); - let __t3582 = { - let __t3580 = Value::sym(interp.intern("X")); - let __t3581 = Value::nil(); - rt::cons(&__t3580, &__t3581) - }; - rt::cons(&__t3579, &__t3582) - }; - rt::cons(&__t3578, &__t3583) - }; - let __t3585 = Value::nil(); - rt::cons(&__t3584, &__t3585) - }; - rt::cons(&__t3577, &__t3586) - }; - rt::cons(&__t3573, &__t3587) - }; - rt::cons(&__t3570, &__t3588) - }); - } else { - { - let __t3547 = { - let __t3520 = { - let __t3493 = v_V1497.clone(); - rt::is_cons(&__t3493) - }; - if !rt::is_truthy(interp, &__t3520)? { - Value::bool(false) - } else { - let __t3521 = { - let __t3518 = { - let __t3494 = Value::sym(interp.intern("s-op2")); - let __t3496 = { - let __t3495 = v_V1497.clone(); - rt::hd(&__t3495)? - }; - rt::eq(&__t3494, &__t3496) - }; - if !rt::is_truthy(interp, &__t3518)? { - Value::bool(false) - } else { - let __t3519 = { - let __t3516 = { - let __t3498 = { - let __t3497 = v_V1497.clone(); - rt::tl(&__t3497)? - }; - rt::is_cons(&__t3498) - }; - if !rt::is_truthy(interp, &__t3516)? { - Value::bool(false) - } else { - let __t3517 = { - let __t3514 = { - let __t3501 = { - let __t3500 = { - let __t3499 = v_V1497.clone(); - rt::tl(&__t3499)? - }; - rt::tl(&__t3500)? - }; - rt::is_cons(&__t3501) - }; - if !rt::is_truthy(interp, &__t3514)? { - Value::bool(false) - } else { - let __t3515 = { - let __t3512 = { - let __t3505 = { - let __t3504 = { - let __t3503 = { - let __t3502 = - v_V1497.clone(); - rt::tl(&__t3502)? - }; - rt::tl(&__t3503)? - }; - rt::tl(&__t3504)? - }; - rt::is_cons(&__t3505) - }; - if !rt::is_truthy(interp, &__t3512)? { - Value::bool(false) - } else { - let __t3513 = { - let __t3506 = Value::nil(); - let __t3511 = { - let __t3510 = { - let __t3509 = { - let __t3508 = { - let __t3507 = - v_V1497.clone(); - rt::tl(&__t3507)? - }; - rt::tl(&__t3508)? - }; - rt::tl(&__t3509)? - }; - rt::tl(&__t3510)? - }; - rt::eq(&__t3506, &__t3511) - }; - Value::bool(rt::is_truthy( - interp, &__t3513, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t3515)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t3517)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t3519)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t3521)?) - } - }; - if match rt::is_truthy(interp, &__t3547) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3522 = Value::sym(interp.intern("s-op2")); - let __t3546 = { - let __t3525 = { - let __t3524 = { - let __t3523 = v_V1497.clone(); - rt::tl(&__t3523)? - }; - rt::hd(&__t3524)? - }; - let __t3545 = { - let __t3529 = { - let __t3528 = { - let __t3527 = { - let __t3526 = v_V1497.clone(); - rt::tl(&__t3526)? - }; - rt::tl(&__t3527)? - }; - rt::hd(&__t3528)? - }; - let __t3544 = { - let __t3534 = { - let __t3533 = { - let __t3532 = { - let __t3531 = { - let __t3530 = v_V1497.clone(); - rt::tl(&__t3530)? - }; - rt::tl(&__t3531)? - }; - rt::tl(&__t3532)? - }; - rt::hd(&__t3533)? - }; - let __t3543 = { - let __t3541 = { - let __t3535 = Value::sym(interp.intern("/.")); - let __t3540 = { - let __t3536 = Value::sym(interp.intern("X")); - let __t3539 = { - let __t3537 = - Value::sym(interp.intern("X")); - let __t3538 = Value::nil(); - rt::cons(&__t3537, &__t3538) - }; - rt::cons(&__t3536, &__t3539) - }; - rt::cons(&__t3535, &__t3540) - }; - let __t3542 = Value::nil(); - rt::cons(&__t3541, &__t3542) - }; - rt::cons(&__t3534, &__t3543) - }; - rt::cons(&__t3529, &__t3544) - }; - rt::cons(&__t3525, &__t3545) - }; - rt::cons(&__t3522, &__t3546) - }); - } else { - { - let __t3492 = Value::bool(true); - if match rt::is_truthy(interp, &__t3492) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1497.clone()); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_string_x2d_macros(interp: &mut Interp) { - interp.register_native("string-macros", 1, aot_string_x2d_macros); - interp.register_aot_direct("string-macros", aot_string_x2d_macros); -} - -/// AOT-compiled from KL `(defun string->list ...)` -pub fn aot_string_x2d__x3e_list(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string->list: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1587 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3599 = { - let __t3597 = Value::str(""); - let __t3598 = v_V1587.clone(); - rt::eq(&__t3597, &__t3598) - }; - if match rt::is_truthy(interp, &__t3599) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t3596 = Value::bool(true); - if match rt::is_truthy(interp, &__t3596) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3590 = v_V1587.clone(); - let __t3591 = Value::int(1i64); - let __t3594 = { - let __t3592 = v_V1587.clone(); - let __t3593 = Value::int(0i64); - rt::apply_direct(interp, "pos", &[__t3592, __t3593])? - }; - let __t3595 = Value::nil(); - rt::apply_direct( - interp, - "string.s->l-h", - &[__t3590, __t3591, __t3594, __t3595], - )? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_string_x2d__x3e_list(interp: &mut Interp) { - interp.register_native("string->list", 1, aot_string_x2d__x3e_list); - interp.register_aot_direct("string->list", aot_string_x2d__x3e_list); -} - -/// AOT-compiled from KL `(defun string.s->l-h ...)` -pub fn aot_string_x2e_s_x2d__x3e_l_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "string.s->l-h: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1589 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1590 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1591 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V1592 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3614 = { - let __t3611 = Value::str(""); - let __t3612 = v_V1591.clone(); - rt::eq(&__t3611, &__t3612) - }; - if match rt::is_truthy(interp, &__t3614) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3613 = v_V1592.clone(); - rt::apply_direct(interp, "reverse", &[__t3613])? - }); - } else { - { - let __t3610 = Value::bool(true); - if match rt::is_truthy(interp, &__t3610) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3600 = v_V1589.clone(); - let __t3603 = { - let __t3601 = v_V1590.clone(); - let __t3602 = Value::int(1i64); - rt::add(&__t3601, &__t3602)? - }; - let __t3606 = match (|| -> ShenResult { - Ok({ - let __t3604 = v_V1589.clone(); - let __t3605 = v_V1590.clone(); - rt::apply_direct(interp, "pos", &[__t3604, __t3605])? - }) - })() { - Ok(v) => v, - Err(e) => { - let __h = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1593 = args[0].clone(); - Ok(Value::str("")) - }, - Vec::new(), - interp, - ) - }; - let __err = Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - }; - let __t3609 = { - let __t3607 = v_V1591.clone(); - let __t3608 = v_V1592.clone(); - rt::cons(&__t3607, &__t3608) - }; - v_V1589 = __t3600; - v_V1590 = __t3603; - v_V1591 = __t3606; - v_V1592 = __t3609; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_string_x2e_s_x2d__x3e_l_x2d_h(interp: &mut Interp) { - interp.register_native("string.s->l-h", 4, aot_string_x2e_s_x2d__x3e_l_x2d_h); - interp.register_aot_direct("string.s->l-h", aot_string_x2e_s_x2d__x3e_l_x2d_h); -} - -/// AOT-compiled from KL `(defun list->string ...)` -pub fn aot_list_x2d__x3e_string(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "list->string: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1598 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3626 = { - let __t3624 = Value::nil(); - let __t3625 = v_V1598.clone(); - rt::eq(&__t3624, &__t3625) - }; - if match rt::is_truthy(interp, &__t3626) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t3623 = { - let __t3617 = v_V1598.clone(); - rt::is_cons(&__t3617) - }; - if match rt::is_truthy(interp, &__t3623) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3619 = { - let __t3618 = v_V1598.clone(); - rt::hd(&__t3618)? - }; - let __t3622 = { - let __t3621 = { - let __t3620 = v_V1598.clone(); - rt::tl(&__t3620)? - }; - rt::apply_direct(interp, "list->string", &[__t3621])? - }; - rt::apply_direct(interp, "cn", &[__t3619, __t3622])? - }); - } else { - { - let __t3616 = Value::bool(true); - if match rt::is_truthy(interp, &__t3616) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3615 = Value::sym(interp.intern("list->string")); - rt::apply_direct(interp, "shen.f-error", &[__t3615])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_list_x2d__x3e_string(interp: &mut Interp) { - interp.register_native("list->string", 1, aot_list_x2d__x3e_string); - interp.register_aot_direct("list->string", aot_list_x2d__x3e_string); -} - -/// AOT-compiled from KL `(defun s-op1 ...)` -pub fn aot_s_x2d_op1(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "s-op1: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1600 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1601 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1602 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3629 = { - let __t3628 = { - let __t3627 = v_V1601.clone(); - rt::apply_direct(interp, "string->list", &[__t3627])? - }; - rt::apply_value(interp, v_V1600.clone(), &[__t3628])? - }; - rt::apply_value(interp, v_V1602.clone(), &[__t3629])? - }); - } -} - -fn install_s_x2d_op1(interp: &mut Interp) { - interp.register_native("s-op1", 3, aot_s_x2d_op1); - interp.register_aot_direct("s-op1", aot_s_x2d_op1); -} - -/// AOT-compiled from KL `(defun s-op2 ...)` -pub fn aot_s_x2d_op2(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "s-op2: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1606 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1607 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1608 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V1609 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3635 = { - let __t3632 = { - let __t3631 = { - let __t3630 = v_V1607.clone(); - rt::apply_direct(interp, "string->list", &[__t3630])? - }; - rt::apply_value(interp, v_V1606.clone(), &[__t3631])? - }; - let __t3634 = { - let __t3633 = v_V1608.clone(); - rt::apply_direct(interp, "string->list", &[__t3633])? - }; - rt::apply_value(interp, __t3632, &[__t3634])? - }; - rt::apply_value(interp, v_V1609.clone(), &[__t3635])? - }); - } -} - -fn install_s_x2d_op2(interp: &mut Interp) { - interp.register_native("s-op2", 4, aot_s_x2d_op2); - interp.register_aot_direct("s-op2", aot_s_x2d_op2); -} - -/// AOT-compiled from KL `(defun string.count ...)` -pub fn aot_string_x2e_count(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.count: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1619 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1620 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3658 = { - let __t3656 = Value::str(""); - let __t3657 = v_V1620.clone(); - rt::eq(&__t3656, &__t3657) - }; - if match rt::is_truthy(interp, &__t3658) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(0i64)); - } else { - { - let __t3655 = { - let __t3647 = { - let __t3643 = v_V1620.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3643])? - }; - if !rt::is_truthy(interp, &__t3647)? { - Value::bool(false) - } else { - let __t3648 = { - let __t3644 = v_V1619.clone(); - let __t3646 = { - let __t3645 = v_V1620.clone(); - rt::apply_direct(interp, "hdstr", &[__t3645])? - }; - rt::eq(&__t3644, &__t3646) - }; - Value::bool(rt::is_truthy(interp, &__t3648)?) - } - }; - if match rt::is_truthy(interp, &__t3655) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3649 = Value::int(1i64); - let __t3654 = { - let __t3651 = { - let __t3650 = v_V1620.clone(); - rt::apply_direct(interp, "hdstr", &[__t3650])? - }; - let __t3653 = { - let __t3652 = v_V1620.clone(); - rt::apply_direct(interp, "tlstr", &[__t3652])? - }; - rt::apply_direct(interp, "string.count", &[__t3651, __t3653])? - }; - rt::add(&__t3649, &__t3654)? - }); - } else { - { - let __t3642 = { - let __t3638 = v_V1620.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3638])? - }; - if match rt::is_truthy(interp, &__t3642) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3639 = v_V1619.clone(); - let __t3641 = { - let __t3640 = v_V1620.clone(); - rt::apply_direct(interp, "tlstr", &[__t3640])? - }; - v_V1619 = __t3639; - v_V1620 = __t3641; - continue; - } - } else { - { - let __t3637 = Value::bool(true); - if match rt::is_truthy(interp, &__t3637) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3636 = Value::sym(interp.intern("string.count")); - rt::apply_direct(interp, "shen.f-error", &[__t3636])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_string_x2e_count(interp: &mut Interp) { - interp.register_native("string.count", 2, aot_string_x2e_count); - interp.register_aot_direct("string.count", aot_string_x2e_count); -} - -/// AOT-compiled from KL `(defun string.reverse ...)` -pub fn aot_string_x2e_reverse(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.reverse: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1625 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3660 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1626 = args[0].clone(); - Ok({ - let __t3659 = v_Z1626.clone(); - rt::apply_direct(interp, "reverse", &[__t3659])? - }) - }, - Vec::new(), - interp, - ) - }; - let __t3661 = v_V1625.clone(); - let __t3663 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1627 = args[0].clone(); - Ok({ - let __t3662 = v_Z1627.clone(); - rt::apply_direct(interp, "list->string", &[__t3662])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3660, __t3661, __t3663])? - }); - } -} - -fn install_string_x2e_reverse(interp: &mut Interp) { - interp.register_native("string.reverse", 1, aot_string_x2e_reverse); - interp.register_aot_direct("string.reverse", aot_string_x2e_reverse); -} - -/// AOT-compiled from KL `(defun string.element? ...)` -pub fn aot_string_x2e_element_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.element?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1629 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1630 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3666 = { - let v_V1629 = v_V1629.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1631 = args[0].clone(); - Ok({ - let __t3664 = v_V1629.clone(); - let __t3665 = v_Z1631.clone(); - rt::apply_direct(interp, "element?", &[__t3664, __t3665])? - }) - }, - vec![v_V1629], - interp, - ) - }; - let __t3667 = v_V1630.clone(); - let __t3668 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1632 = args[0].clone(); - Ok(v_Z1632.clone()) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3666, __t3667, __t3668])? - }); - } -} - -fn install_string_x2e_element_x3f_(interp: &mut Interp) { - interp.register_native("string.element?", 2, aot_string_x2e_element_x3f_); - interp.register_aot_direct("string.element?", aot_string_x2e_element_x3f_); -} - -/// AOT-compiled from KL `(defun string.prefix? ...)` -pub fn aot_string_x2e_prefix_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.prefix?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1637 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1638 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3671 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1639 = args[0].clone(); - Ok({ - let v_Z1639 = v_Z1639.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1640 = args[0].clone(); - Ok({ - let __t3669 = v_Z1639.clone(); - let __t3670 = v_Z1640.clone(); - rt::apply_direct(interp, "prefix?", &[__t3669, __t3670])? - }) - }, - vec![v_Z1639], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t3672 = v_V1637.clone(); - let __t3673 = v_V1638.clone(); - let __t3674 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1641 = args[0].clone(); - Ok(v_Z1641.clone()) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op2", &[__t3671, __t3672, __t3673, __t3674])? - }); - } -} - -fn install_string_x2e_prefix_x3f_(interp: &mut Interp) { - interp.register_native("string.prefix?", 2, aot_string_x2e_prefix_x3f_); - interp.register_aot_direct("string.prefix?", aot_string_x2e_prefix_x3f_); -} - -/// AOT-compiled from KL `(defun string.infix? ...)` -pub fn aot_string_x2e_infix_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.infix?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1646 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1647 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3677 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1648 = args[0].clone(); - Ok({ - let v_Z1648 = v_Z1648.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1649 = args[0].clone(); - Ok({ - let __t3675 = v_Z1648.clone(); - let __t3676 = v_Z1649.clone(); - rt::apply_direct(interp, "infix?", &[__t3675, __t3676])? - }) - }, - vec![v_Z1648], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t3678 = v_V1646.clone(); - let __t3679 = v_V1647.clone(); - let __t3680 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1650 = args[0].clone(); - Ok(v_Z1650.clone()) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op2", &[__t3677, __t3678, __t3679, __t3680])? - }); - } -} - -fn install_string_x2e_infix_x3f_(interp: &mut Interp) { - interp.register_native("string.infix?", 2, aot_string_x2e_infix_x3f_); - interp.register_aot_direct("string.infix?", aot_string_x2e_infix_x3f_); -} - -/// AOT-compiled from KL `(defun string.suffix? ...)` -pub fn aot_string_x2e_suffix_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.suffix?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1655 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1656 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3683 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1657 = args[0].clone(); - Ok({ - let v_Z1657 = v_Z1657.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1658 = args[0].clone(); - Ok({ - let __t3681 = v_Z1657.clone(); - let __t3682 = v_Z1658.clone(); - rt::apply_direct(interp, "suffix?", &[__t3681, __t3682])? - }) - }, - vec![v_Z1657], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t3684 = v_V1655.clone(); - let __t3685 = v_V1656.clone(); - let __t3686 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1659 = args[0].clone(); - Ok(v_Z1659.clone()) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op2", &[__t3683, __t3684, __t3685, __t3686])? - }); - } -} - -fn install_string_x2e_suffix_x3f_(interp: &mut Interp) { - interp.register_native("string.suffix?", 2, aot_string_x2e_suffix_x3f_); - interp.register_aot_direct("string.suffix?", aot_string_x2e_suffix_x3f_); -} - -/// AOT-compiled from KL `(defun string.subset? ...)` -pub fn aot_string_x2e_subset_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.subset?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1664 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1665 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3689 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1666 = args[0].clone(); - Ok({ - let v_Z1666 = v_Z1666.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1667 = args[0].clone(); - Ok({ - let __t3687 = v_Z1666.clone(); - let __t3688 = v_Z1667.clone(); - rt::apply_direct(interp, "subset?", &[__t3687, __t3688])? - }) - }, - vec![v_Z1666], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t3690 = v_V1664.clone(); - let __t3691 = v_V1665.clone(); - let __t3692 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1668 = args[0].clone(); - Ok(v_Z1668.clone()) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op2", &[__t3689, __t3690, __t3691, __t3692])? - }); - } -} - -fn install_string_x2e_subset_x3f_(interp: &mut Interp) { - interp.register_native("string.subset?", 2, aot_string_x2e_subset_x3f_); - interp.register_aot_direct("string.subset?", aot_string_x2e_subset_x3f_); -} - -/// AOT-compiled from KL `(defun string.set=? ...)` -pub fn aot_string_x2e_set_x3d__x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.set=?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1673 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1674 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3695 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1675 = args[0].clone(); - Ok({ - let v_Z1675 = v_Z1675.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1676 = args[0].clone(); - Ok({ - let __t3693 = v_Z1675.clone(); - let __t3694 = v_Z1676.clone(); - rt::apply_direct(interp, "set=?", &[__t3693, __t3694])? - }) - }, - vec![v_Z1675], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t3696 = v_V1673.clone(); - let __t3697 = v_V1674.clone(); - let __t3698 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1677 = args[0].clone(); - Ok(v_Z1677.clone()) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op2", &[__t3695, __t3696, __t3697, __t3698])? - }); - } -} - -fn install_string_x2e_set_x3d__x3f_(interp: &mut Interp) { - interp.register_native("string.set=?", 2, aot_string_x2e_set_x3d__x3f_); - interp.register_aot_direct("string.set=?", aot_string_x2e_set_x3d__x3f_); -} - -/// AOT-compiled from KL `(defun string.set? ...)` -pub fn aot_string_x2e_set_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.set?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1681 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3700 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1682 = args[0].clone(); - Ok({ - let __t3699 = v_Z1682.clone(); - rt::apply_direct(interp, "set?", &[__t3699])? - }) - }, - Vec::new(), - interp, - ) - }; - let __t3701 = v_V1681.clone(); - let __t3702 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1683 = args[0].clone(); - Ok(v_Z1683.clone()) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3700, __t3701, __t3702])? - }); - } -} - -fn install_string_x2e_set_x3f_(interp: &mut Interp) { - interp.register_native("string.set?", 1, aot_string_x2e_set_x3f_); - interp.register_aot_direct("string.set?", aot_string_x2e_set_x3f_); -} - -/// AOT-compiled from KL `(defun file-extension ...)` -pub fn aot_file_x2d_extension(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "file-extension: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1685 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1686 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3704 = { - let __t3703 = v_V1685.clone(); - rt::apply_direct(interp, "strip-extension", &[__t3703])? - }; - let __t3705 = v_V1686.clone(); - rt::apply_direct(interp, "cn", &[__t3704, __t3705])? - }); - } -} - -fn install_file_x2d_extension(interp: &mut Interp) { - interp.register_native("file-extension", 2, aot_file_x2d_extension); - interp.register_aot_direct("file-extension", aot_file_x2d_extension); -} - -/// AOT-compiled from KL `(defun strip-extension ...)` -pub fn aot_strip_x2d_extension(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "strip-extension: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1691 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3724 = { - let __t3722 = Value::str(""); - let __t3723 = v_V1691.clone(); - rt::eq(&__t3722, &__t3723) - }; - if match rt::is_truthy(interp, &__t3724) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t3721 = { - let __t3719 = { - let __t3715 = v_V1691.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3715])? - }; - if !rt::is_truthy(interp, &__t3719)? { - Value::bool(false) - } else { - let __t3720 = { - let __t3716 = Value::str("."); - let __t3718 = { - let __t3717 = v_V1691.clone(); - rt::apply_direct(interp, "hdstr", &[__t3717])? - }; - rt::eq(&__t3716, &__t3718) - }; - Value::bool(rt::is_truthy(interp, &__t3720)?) - } - }; - if match rt::is_truthy(interp, &__t3721) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t3714 = { - let __t3708 = v_V1691.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3708])? - }; - if match rt::is_truthy(interp, &__t3714) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3710 = { - let __t3709 = v_V1691.clone(); - rt::apply_direct(interp, "hdstr", &[__t3709])? - }; - let __t3713 = { - let __t3712 = { - let __t3711 = v_V1691.clone(); - rt::apply_direct(interp, "tlstr", &[__t3711])? - }; - rt::apply_direct(interp, "strip-extension", &[__t3712])? - }; - rt::apply_direct(interp, "@s", &[__t3710, __t3713])? - }); - } else { - { - let __t3707 = Value::bool(true); - if match rt::is_truthy(interp, &__t3707) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3706 = - Value::sym(interp.intern("strip-extension")); - rt::apply_direct(interp, "shen.f-error", &[__t3706])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_strip_x2d_extension(interp: &mut Interp) { - interp.register_native("strip-extension", 1, aot_strip_x2d_extension); - interp.register_aot_direct("strip-extension", aot_strip_x2d_extension); -} - -/// AOT-compiled from KL `(defun string.length ...)` -pub fn aot_string_x2e_length(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.length: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1694 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3726 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1695 = args[0].clone(); - Ok({ - let __t3725 = v_Z1695.clone(); - rt::apply_direct(interp, "length", &[__t3725])? - }) - }, - Vec::new(), - interp, - ) - }; - let __t3727 = v_V1694.clone(); - let __t3728 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1696 = args[0].clone(); - Ok(v_Z1696.clone()) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3726, __t3727, __t3728])? - }); - } -} - -fn install_string_x2e_length(interp: &mut Interp) { - interp.register_native("string.length", 1, aot_string_x2e_length); - interp.register_aot_direct("string.length", aot_string_x2e_length); -} - -/// AOT-compiled from KL `(defun string.trim ...)` -pub fn aot_string_x2e_trim(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.trim: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1700 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1701 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3731 = { - let v_V1700 = v_V1700.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1702 = args[0].clone(); - Ok({ - let __t3729 = v_V1700.clone(); - let __t3730 = v_Z1702.clone(); - rt::apply_direct(interp, "trim", &[__t3729, __t3730])? - }) - }, - vec![v_V1700], - interp, - ) - }; - let __t3732 = v_V1701.clone(); - let __t3734 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1703 = args[0].clone(); - Ok({ - let __t3733 = v_Z1703.clone(); - rt::apply_direct(interp, "list->string", &[__t3733])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3731, __t3732, __t3734])? - }); - } -} - -fn install_string_x2e_trim(interp: &mut Interp) { - interp.register_native("string.trim", 2, aot_string_x2e_trim); - interp.register_aot_direct("string.trim", aot_string_x2e_trim); -} - -/// AOT-compiled from KL `(defun string.trim-if ...)` -pub fn aot_string_x2e_trim_x2d_if(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.trim-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1708 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1709 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3737 = { - let v_V1708 = v_V1708.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1710 = args[0].clone(); - Ok({ - let __t3735 = v_V1708.clone(); - let __t3736 = v_Z1710.clone(); - rt::apply_direct(interp, "trim-if", &[__t3735, __t3736])? - }) - }, - vec![v_V1708], - interp, - ) - }; - let __t3738 = v_V1709.clone(); - let __t3740 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1711 = args[0].clone(); - Ok({ - let __t3739 = v_Z1711.clone(); - rt::apply_direct(interp, "list->string", &[__t3739])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3737, __t3738, __t3740])? - }); - } -} - -fn install_string_x2e_trim_x2d_if(interp: &mut Interp) { - interp.register_native("string.trim-if", 2, aot_string_x2e_trim_x2d_if); - interp.register_aot_direct("string.trim-if", aot_string_x2e_trim_x2d_if); -} - -/// AOT-compiled from KL `(defun string.trim-right-if ...)` -pub fn aot_string_x2e_trim_x2d_right_x2d_if( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.trim-right-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1716 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1717 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3743 = { - let v_V1716 = v_V1716.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1718 = args[0].clone(); - Ok({ - let __t3741 = v_V1716.clone(); - let __t3742 = v_Z1718.clone(); - rt::apply_direct(interp, "trim-right-if", &[__t3741, __t3742])? - }) - }, - vec![v_V1716], - interp, - ) - }; - let __t3744 = v_V1717.clone(); - let __t3746 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1719 = args[0].clone(); - Ok({ - let __t3745 = v_Z1719.clone(); - rt::apply_direct(interp, "list->string", &[__t3745])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3743, __t3744, __t3746])? - }); - } -} - -fn install_string_x2e_trim_x2d_right_x2d_if(interp: &mut Interp) { - interp.register_native( - "string.trim-right-if", - 2, - aot_string_x2e_trim_x2d_right_x2d_if, - ); - interp.register_aot_direct("string.trim-right-if", aot_string_x2e_trim_x2d_right_x2d_if); -} - -/// AOT-compiled from KL `(defun string.trim-left-if ...)` -pub fn aot_string_x2e_trim_x2d_left_x2d_if( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.trim-left-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1724 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1725 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3749 = { - let v_V1724 = v_V1724.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1726 = args[0].clone(); - Ok({ - let __t3747 = v_V1724.clone(); - let __t3748 = v_Z1726.clone(); - rt::apply_direct(interp, "trim-left-if", &[__t3747, __t3748])? - }) - }, - vec![v_V1724], - interp, - ) - }; - let __t3750 = v_V1725.clone(); - let __t3752 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1727 = args[0].clone(); - Ok({ - let __t3751 = v_Z1727.clone(); - rt::apply_direct(interp, "list->string", &[__t3751])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3749, __t3750, __t3752])? - }); - } -} - -fn install_string_x2e_trim_x2d_left_x2d_if(interp: &mut Interp) { - interp.register_native( - "string.trim-left-if", - 2, - aot_string_x2e_trim_x2d_left_x2d_if, - ); - interp.register_aot_direct("string.trim-left-if", aot_string_x2e_trim_x2d_left_x2d_if); -} - -/// AOT-compiled from KL `(defun string.trim-right ...)` -pub fn aot_string_x2e_trim_x2d_right(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.trim-right: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1732 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1733 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3755 = { - let v_V1732 = v_V1732.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1734 = args[0].clone(); - Ok({ - let __t3753 = v_V1732.clone(); - let __t3754 = v_Z1734.clone(); - rt::apply_direct(interp, "trim-right", &[__t3753, __t3754])? - }) - }, - vec![v_V1732], - interp, - ) - }; - let __t3756 = v_V1733.clone(); - let __t3758 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1735 = args[0].clone(); - Ok({ - let __t3757 = v_Z1735.clone(); - rt::apply_direct(interp, "list->string", &[__t3757])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3755, __t3756, __t3758])? - }); - } -} - -fn install_string_x2e_trim_x2d_right(interp: &mut Interp) { - interp.register_native("string.trim-right", 2, aot_string_x2e_trim_x2d_right); - interp.register_aot_direct("string.trim-right", aot_string_x2e_trim_x2d_right); -} - -/// AOT-compiled from KL `(defun string.trim-left ...)` -pub fn aot_string_x2e_trim_x2d_left(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.trim-left: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1740 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1741 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3761 = { - let v_V1740 = v_V1740.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1742 = args[0].clone(); - Ok({ - let __t3759 = v_V1740.clone(); - let __t3760 = v_Z1742.clone(); - rt::apply_direct(interp, "trim-left", &[__t3759, __t3760])? - }) - }, - vec![v_V1740], - interp, - ) - }; - let __t3762 = v_V1741.clone(); - let __t3764 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1743 = args[0].clone(); - Ok({ - let __t3763 = v_Z1743.clone(); - rt::apply_direct(interp, "list->string", &[__t3763])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op1", &[__t3761, __t3762, __t3764])? - }); - } -} - -fn install_string_x2e_trim_x2d_left(interp: &mut Interp) { - interp.register_native("string.trim-left", 2, aot_string_x2e_trim_x2d_left); - interp.register_aot_direct("string.trim-left", aot_string_x2e_trim_x2d_left); -} - -/// AOT-compiled from KL `(defun string.some? ...)` -pub fn aot_string_x2e_some_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.some?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1748 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1749 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3777 = { - let __t3775 = Value::str(""); - let __t3776 = v_V1749.clone(); - rt::eq(&__t3775, &__t3776) - }; - if match rt::is_truthy(interp, &__t3777) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t3774 = { - let __t3767 = v_V1749.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3767])? - }; - if match rt::is_truthy(interp, &__t3774) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3770 = { - let __t3769 = { - let __t3768 = v_V1749.clone(); - rt::apply_direct(interp, "hdstr", &[__t3768])? - }; - rt::apply_value(interp, v_V1748.clone(), &[__t3769])? - }; - if match rt::is_truthy(interp, &__t3770) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3771 = v_V1748.clone(); - let __t3773 = { - let __t3772 = v_V1749.clone(); - rt::apply_direct(interp, "tlstr", &[__t3772])? - }; - v_V1748 = __t3771; - v_V1749 = __t3773; - continue; - } - } - } - } else { - { - let __t3766 = Value::bool(true); - if match rt::is_truthy(interp, &__t3766) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3765 = Value::sym(interp.intern("string.some?")); - rt::apply_direct(interp, "shen.f-error", &[__t3765])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_string_x2e_some_x3f_(interp: &mut Interp) { - interp.register_native("string.some?", 2, aot_string_x2e_some_x3f_); - interp.register_aot_direct("string.some?", aot_string_x2e_some_x3f_); -} - -/// AOT-compiled from KL `(defun string.every? ...)` -pub fn aot_string_x2e_every_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.every?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1754 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1755 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3790 = { - let __t3788 = Value::str(""); - let __t3789 = v_V1755.clone(); - rt::eq(&__t3788, &__t3789) - }; - if match rt::is_truthy(interp, &__t3790) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3787 = { - let __t3780 = v_V1755.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3780])? - }; - if match rt::is_truthy(interp, &__t3787) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3783 = { - let __t3782 = { - let __t3781 = v_V1755.clone(); - rt::apply_direct(interp, "hdstr", &[__t3781])? - }; - rt::apply_value(interp, v_V1754.clone(), &[__t3782])? - }; - if !match rt::is_truthy(interp, &__t3783) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t3784 = v_V1754.clone(); - let __t3786 = { - let __t3785 = v_V1755.clone(); - rt::apply_direct(interp, "tlstr", &[__t3785])? - }; - v_V1754 = __t3784; - v_V1755 = __t3786; - continue; - } - } - } - } else { - { - let __t3779 = Value::bool(true); - if match rt::is_truthy(interp, &__t3779) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3778 = Value::sym(interp.intern("string.every?")); - rt::apply_direct(interp, "shen.f-error", &[__t3778])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_string_x2e_every_x3f_(interp: &mut Interp) { - interp.register_native("string.every?", 2, aot_string_x2e_every_x3f_); - interp.register_aot_direct("string.every?", aot_string_x2e_every_x3f_); -} - -/// AOT-compiled from KL `(defun string.difference ...)` -pub fn aot_string_x2e_difference(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.difference: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1761 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1762 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3793 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1763 = args[0].clone(); - Ok({ - let v_Z1763 = v_Z1763.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1764 = args[0].clone(); - Ok({ - let __t3791 = v_Z1763.clone(); - let __t3792 = v_Z1764.clone(); - rt::apply_direct(interp, "difference", &[__t3791, __t3792])? - }) - }, - vec![v_Z1763], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t3794 = v_V1761.clone(); - let __t3795 = v_V1762.clone(); - let __t3797 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1765 = args[0].clone(); - Ok({ - let __t3796 = v_Z1765.clone(); - rt::apply_direct(interp, "list->string", &[__t3796])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op2", &[__t3793, __t3794, __t3795, __t3797])? - }); - } -} - -fn install_string_x2e_difference(interp: &mut Interp) { - interp.register_native("string.difference", 2, aot_string_x2e_difference); - interp.register_aot_direct("string.difference", aot_string_x2e_difference); -} - -/// AOT-compiled from KL `(defun string.intersection ...)` -pub fn aot_string_x2e_intersection(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.intersection: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1771 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1772 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3800 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1773 = args[0].clone(); - Ok({ - let v_Z1773 = v_Z1773.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1774 = args[0].clone(); - Ok({ - let __t3798 = v_Z1773.clone(); - let __t3799 = v_Z1774.clone(); - rt::apply_direct( - interp, - "intersection", - &[__t3798, __t3799], - )? - }) - }, - vec![v_Z1773], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - let __t3801 = v_V1771.clone(); - let __t3802 = v_V1772.clone(); - let __t3804 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1775 = args[0].clone(); - Ok({ - let __t3803 = v_Z1775.clone(); - rt::apply_direct(interp, "list->string", &[__t3803])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "s-op2", &[__t3800, __t3801, __t3802, __t3804])? - }); - } -} - -fn install_string_x2e_intersection(interp: &mut Interp) { - interp.register_native("string.intersection", 2, aot_string_x2e_intersection); - interp.register_aot_direct("string.intersection", aot_string_x2e_intersection); -} - -/// AOT-compiled from KL `(defun string.nth ...)` -pub fn aot_string_x2e_nth(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.nth: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1778 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1779 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3805 = v_V1779.clone(); - let __t3808 = { - let __t3806 = v_V1778.clone(); - let __t3807 = Value::int(1i64); - rt::add(&__t3806, &__t3807)? - }; - rt::apply_direct(interp, "pos", &[__t3805, __t3808])? - }); - } -} - -fn install_string_x2e_nth(interp: &mut Interp) { - interp.register_native("string.nth", 2, aot_string_x2e_nth); - interp.register_aot_direct("string.nth", aot_string_x2e_nth); -} - -/// AOT-compiled from KL `(defun whitespace? ...)` -pub fn aot_whitespace_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "whitespace?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1784 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3824 = { - let __t3811 = v_V1784.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3811])? - }; - if match rt::is_truthy(interp, &__t3824) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1785 = { - let __t3813 = { - let __t3812 = v_V1784.clone(); - rt::apply_direct(interp, "hdstr", &[__t3812])? - }; - rt::apply_direct(interp, "string->n", &[__t3813])? - }; - break Ok({ - let __t3814 = v_W1785.clone(); - let __t3823 = { - let __t3815 = Value::int(9i64); - let __t3822 = { - let __t3816 = Value::int(10i64); - let __t3821 = { - let __t3817 = Value::int(13i64); - let __t3820 = { - let __t3818 = Value::int(32i64); - let __t3819 = Value::nil(); - rt::cons(&__t3818, &__t3819) - }; - rt::cons(&__t3817, &__t3820) - }; - rt::cons(&__t3816, &__t3821) - }; - rt::cons(&__t3815, &__t3822) - }; - rt::apply_direct(interp, "element?", &[__t3814, __t3823])? - }); - } - } else { - { - let __t3810 = Value::bool(true); - if match rt::is_truthy(interp, &__t3810) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3809 = Value::sym(interp.intern("whitespace?")); - rt::apply_direct(interp, "shen.f-error", &[__t3809])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_whitespace_x3f_(interp: &mut Interp) { - interp.register_native("whitespace?", 1, aot_whitespace_x3f_); - interp.register_aot_direct("whitespace?", aot_whitespace_x3f_); -} - -/// AOT-compiled from KL `(defun uppercase? ...)` -pub fn aot_uppercase_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "uppercase?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1789 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3835 = { - let __t3827 = v_V1789.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3827])? - }; - if match rt::is_truthy(interp, &__t3835) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1790 = { - let __t3829 = { - let __t3828 = v_V1789.clone(); - rt::apply_direct(interp, "hdstr", &[__t3828])? - }; - rt::apply_direct(interp, "string->n", &[__t3829])? - }; - { - let __t3832 = { - let __t3830 = v_W1790.clone(); - let __t3831 = Value::int(64i64); - rt::gt(&__t3830, &__t3831)? - }; - if !match rt::is_truthy(interp, &__t3832) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t3833 = v_W1790.clone(); - let __t3834 = Value::int(91i64); - rt::lt(&__t3833, &__t3834)? - }); - } - } - } - } else { - { - let __t3826 = Value::bool(true); - if match rt::is_truthy(interp, &__t3826) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3825 = Value::sym(interp.intern("uppercase?")); - rt::apply_direct(interp, "shen.f-error", &[__t3825])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_uppercase_x3f_(interp: &mut Interp) { - interp.register_native("uppercase?", 1, aot_uppercase_x3f_); - interp.register_aot_direct("uppercase?", aot_uppercase_x3f_); -} - -/// AOT-compiled from KL `(defun lowercase? ...)` -pub fn aot_lowercase_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "lowercase?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1794 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3846 = { - let __t3838 = v_V1794.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3838])? - }; - if match rt::is_truthy(interp, &__t3846) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1795 = { - let __t3840 = { - let __t3839 = v_V1794.clone(); - rt::apply_direct(interp, "hdstr", &[__t3839])? - }; - rt::apply_direct(interp, "string->n", &[__t3840])? - }; - { - let __t3843 = { - let __t3841 = v_W1795.clone(); - let __t3842 = Value::int(96i64); - rt::gt(&__t3841, &__t3842)? - }; - if !match rt::is_truthy(interp, &__t3843) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t3844 = v_W1795.clone(); - let __t3845 = Value::int(123i64); - rt::lt(&__t3844, &__t3845)? - }); - } - } - } - } else { - { - let __t3837 = Value::bool(true); - if match rt::is_truthy(interp, &__t3837) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3836 = Value::sym(interp.intern("lowercase?")); - rt::apply_direct(interp, "shen.f-error", &[__t3836])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_lowercase_x3f_(interp: &mut Interp) { - interp.register_native("lowercase?", 1, aot_lowercase_x3f_); - interp.register_aot_direct("lowercase?", aot_lowercase_x3f_); -} - -/// AOT-compiled from KL `(defun digit? ...)` -pub fn aot_digit_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "digit?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1799 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3857 = { - let __t3849 = v_V1799.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3849])? - }; - if match rt::is_truthy(interp, &__t3857) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1800 = { - let __t3851 = { - let __t3850 = v_V1799.clone(); - rt::apply_direct(interp, "hdstr", &[__t3850])? - }; - rt::apply_direct(interp, "string->n", &[__t3851])? - }; - { - let __t3854 = { - let __t3852 = v_W1800.clone(); - let __t3853 = Value::int(47i64); - rt::gt(&__t3852, &__t3853)? - }; - if !match rt::is_truthy(interp, &__t3854) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t3855 = v_W1800.clone(); - let __t3856 = Value::int(58i64); - rt::lt(&__t3855, &__t3856)? - }); - } - } - } - } else { - { - let __t3848 = Value::bool(true); - if match rt::is_truthy(interp, &__t3848) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3847 = Value::sym(interp.intern("digit?")); - rt::apply_direct(interp, "shen.f-error", &[__t3847])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_digit_x3f_(interp: &mut Interp) { - interp.register_native("digit?", 1, aot_digit_x3f_); - interp.register_aot_direct("digit?", aot_digit_x3f_); -} - -/// AOT-compiled from KL `(defun alpha? ...)` -pub fn aot_alpha_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "alpha?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1806 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3874 = { - let __t3859 = v_V1806.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3859])? - }; - if match rt::is_truthy(interp, &__t3874) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1807 = { - let __t3861 = { - let __t3860 = v_V1806.clone(); - rt::apply_direct(interp, "hdstr", &[__t3860])? - }; - rt::apply_direct(interp, "string->n", &[__t3861])? - }; - { - let __t3868 = { - let __t3866 = { - let __t3862 = v_W1807.clone(); - let __t3863 = Value::int(64i64); - rt::gt(&__t3862, &__t3863)? - }; - if !rt::is_truthy(interp, &__t3866)? { - Value::bool(false) - } else { - let __t3867 = { - let __t3864 = v_W1807.clone(); - let __t3865 = Value::int(91i64); - rt::lt(&__t3864, &__t3865)? - }; - Value::bool(rt::is_truthy(interp, &__t3867)?) - } - }; - if match rt::is_truthy(interp, &__t3868) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3871 = { - let __t3869 = v_W1807.clone(); - let __t3870 = Value::int(96i64); - rt::gt(&__t3869, &__t3870)? - }; - if !match rt::is_truthy(interp, &__t3871) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t3872 = v_W1807.clone(); - let __t3873 = Value::int(123i64); - rt::lt(&__t3872, &__t3873)? - }); - } - } - } - } - } - } else { - { - let __t3858 = Value::bool(true); - if match rt::is_truthy(interp, &__t3858) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_alpha_x3f_(interp: &mut Interp) { - interp.register_native("alpha?", 1, aot_alpha_x3f_); - interp.register_aot_direct("alpha?", aot_alpha_x3f_); -} - -/// AOT-compiled from KL `(defun alphanum? ...)` -pub fn aot_alphanum_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "alphanum?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1813 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3898 = { - let __t3876 = v_V1813.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3876])? - }; - if match rt::is_truthy(interp, &__t3898) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1814 = { - let __t3878 = { - let __t3877 = v_V1813.clone(); - rt::apply_direct(interp, "hdstr", &[__t3877])? - }; - rt::apply_direct(interp, "string->n", &[__t3878])? - }; - { - let __t3885 = { - let __t3883 = { - let __t3879 = v_W1814.clone(); - let __t3880 = Value::int(64i64); - rt::gt(&__t3879, &__t3880)? - }; - if !rt::is_truthy(interp, &__t3883)? { - Value::bool(false) - } else { - let __t3884 = { - let __t3881 = v_W1814.clone(); - let __t3882 = Value::int(91i64); - rt::lt(&__t3881, &__t3882)? - }; - Value::bool(rt::is_truthy(interp, &__t3884)?) - } - }; - if match rt::is_truthy(interp, &__t3885) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3892 = { - let __t3890 = { - let __t3886 = v_W1814.clone(); - let __t3887 = Value::int(96i64); - rt::gt(&__t3886, &__t3887)? - }; - if !rt::is_truthy(interp, &__t3890)? { - Value::bool(false) - } else { - let __t3891 = { - let __t3888 = v_W1814.clone(); - let __t3889 = Value::int(123i64); - rt::lt(&__t3888, &__t3889)? - }; - Value::bool(rt::is_truthy(interp, &__t3891)?) - } - }; - if match rt::is_truthy(interp, &__t3892) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t3895 = { - let __t3893 = v_W1814.clone(); - let __t3894 = Value::int(47i64); - rt::gt(&__t3893, &__t3894)? - }; - if !match rt::is_truthy(interp, &__t3895) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Ok({ - let __t3896 = v_W1814.clone(); - let __t3897 = Value::int(58i64); - rt::lt(&__t3896, &__t3897)? - }); - } - } - } - } - } - } - } - } else { - { - let __t3875 = Value::bool(true); - if match rt::is_truthy(interp, &__t3875) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_alphanum_x3f_(interp: &mut Interp) { - interp.register_native("alphanum?", 1, aot_alphanum_x3f_); - interp.register_aot_direct("alphanum?", aot_alphanum_x3f_); -} - -/// AOT-compiled from KL `(defun tokenise ...)` -pub fn aot_tokenise(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "tokenise: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1816 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1817 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t3899 = v_V1816.clone(); - let __t3900 = v_V1817.clone(); - let __t3901 = Value::str(""); - rt::apply_direct(interp, "string.tokenise-h", &[__t3899, __t3900, __t3901])? - }); - } -} - -fn install_tokenise(interp: &mut Interp) { - interp.register_native("tokenise", 2, aot_tokenise); - interp.register_aot_direct("tokenise", aot_tokenise); -} - -/// AOT-compiled from KL `(defun string.tokenise-h ...)` -pub fn aot_string_x2e_tokenise_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "string.tokenise-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1822 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1823 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V1824 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3929 = { - let __t3925 = Value::str(""); - let __t3926 = v_V1823.clone(); - rt::eq(&__t3925, &__t3926) - }; - if match rt::is_truthy(interp, &__t3929) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3927 = v_V1824.clone(); - let __t3928 = Value::nil(); - rt::cons(&__t3927, &__t3928) - }); - } else { - { - let __t3924 = { - let __t3916 = { - let __t3913 = v_V1823.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3913])? - }; - if !rt::is_truthy(interp, &__t3916)? { - Value::bool(false) - } else { - let __t3917 = { - let __t3915 = { - let __t3914 = v_V1823.clone(); - rt::apply_direct(interp, "hdstr", &[__t3914])? - }; - rt::apply_value(interp, v_V1822.clone(), &[__t3915])? - }; - Value::bool(rt::is_truthy(interp, &__t3917)?) - } - }; - if match rt::is_truthy(interp, &__t3924) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3918 = v_V1824.clone(); - let __t3923 = { - let __t3919 = v_V1822.clone(); - let __t3921 = { - let __t3920 = v_V1823.clone(); - rt::apply_direct(interp, "tlstr", &[__t3920])? - }; - let __t3922 = Value::str(""); - rt::apply_direct( - interp, - "string.tokenise-h", - &[__t3919, __t3921, __t3922], - )? - }; - rt::cons(&__t3918, &__t3923) - }); - } else { - { - let __t3912 = { - let __t3904 = v_V1823.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3904])? - }; - if match rt::is_truthy(interp, &__t3912) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3905 = v_V1822.clone(); - let __t3907 = { - let __t3906 = v_V1823.clone(); - rt::apply_direct(interp, "tlstr", &[__t3906])? - }; - let __t3911 = { - let __t3908 = v_V1824.clone(); - let __t3910 = { - let __t3909 = v_V1823.clone(); - rt::apply_direct(interp, "hdstr", &[__t3909])? - }; - rt::apply_direct(interp, "@s", &[__t3908, __t3910])? - }; - v_V1822 = __t3905; - v_V1823 = __t3907; - v_V1824 = __t3911; - continue; - } - } else { - { - let __t3903 = Value::bool(true); - if match rt::is_truthy(interp, &__t3903) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3902 = - Value::sym(interp.intern("string.tokenise-h")); - rt::apply_direct(interp, "shen.f-error", &[__t3902])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_string_x2e_tokenise_x2d_h(interp: &mut Interp) { - interp.register_native("string.tokenise-h", 3, aot_string_x2e_tokenise_x2d_h); - interp.register_aot_direct("string.tokenise-h", aot_string_x2e_tokenise_x2d_h); -} - -/// AOT-compiled from KL `(defun uppercase ...)` -pub fn aot_uppercase(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "uppercase: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1828 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3944 = { - let __t3932 = v_V1828.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3932])? - }; - if match rt::is_truthy(interp, &__t3944) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3935 = { - let __t3934 = { - let __t3933 = v_V1828.clone(); - rt::apply_direct(interp, "hdstr", &[__t3933])? - }; - rt::apply_direct(interp, "lowercase?", &[__t3934])? - }; - if match rt::is_truthy(interp, &__t3935) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3941 = { - let __t3940 = { - let __t3938 = { - let __t3937 = { - let __t3936 = v_V1828.clone(); - rt::apply_direct(interp, "hdstr", &[__t3936])? - }; - rt::apply_direct(interp, "string->n", &[__t3937])? - }; - let __t3939 = Value::int(32i64); - rt::sub(&__t3938, &__t3939)? - }; - rt::apply_direct(interp, "n->string", &[__t3940])? - }; - let __t3943 = { - let __t3942 = v_V1828.clone(); - rt::apply_direct(interp, "tlstr", &[__t3942])? - }; - rt::apply_direct(interp, "@s", &[__t3941, __t3943])? - }); - } else { - break Ok(v_V1828.clone()); - } - } - } else { - { - let __t3931 = Value::bool(true); - if match rt::is_truthy(interp, &__t3931) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3930 = Value::sym(interp.intern("uppercase")); - rt::apply_direct(interp, "shen.f-error", &[__t3930])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_uppercase(interp: &mut Interp) { - interp.register_native("uppercase", 1, aot_uppercase); - interp.register_aot_direct("uppercase", aot_uppercase); -} - -/// AOT-compiled from KL `(defun lowercase ...)` -pub fn aot_lowercase(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "lowercase: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1830 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3959 = { - let __t3947 = v_V1830.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3947])? - }; - if match rt::is_truthy(interp, &__t3959) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t3950 = { - let __t3949 = { - let __t3948 = v_V1830.clone(); - rt::apply_direct(interp, "hdstr", &[__t3948])? - }; - rt::apply_direct(interp, "uppercase?", &[__t3949])? - }; - if match rt::is_truthy(interp, &__t3950) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3956 = { - let __t3955 = { - let __t3953 = { - let __t3952 = { - let __t3951 = v_V1830.clone(); - rt::apply_direct(interp, "hdstr", &[__t3951])? - }; - rt::apply_direct(interp, "string->n", &[__t3952])? - }; - let __t3954 = Value::int(32i64); - rt::add(&__t3953, &__t3954)? - }; - rt::apply_direct(interp, "n->string", &[__t3955])? - }; - let __t3958 = { - let __t3957 = v_V1830.clone(); - rt::apply_direct(interp, "tlstr", &[__t3957])? - }; - rt::apply_direct(interp, "@s", &[__t3956, __t3958])? - }); - } else { - break Ok(v_V1830.clone()); - } - } - } else { - { - let __t3946 = Value::bool(true); - if match rt::is_truthy(interp, &__t3946) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3945 = Value::sym(interp.intern("lowercase")); - rt::apply_direct(interp, "shen.f-error", &[__t3945])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_lowercase(interp: &mut Interp) { - interp.register_native("lowercase", 1, aot_lowercase); - interp.register_aot_direct("lowercase", aot_lowercase); -} - -/// AOT-compiled from KL `(defun string.map ...)` -pub fn aot_string_x2e_map(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.map: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1834 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1835 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3973 = { - let __t3971 = Value::str(""); - let __t3972 = v_V1835.clone(); - rt::eq(&__t3971, &__t3972) - }; - if match rt::is_truthy(interp, &__t3973) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t3970 = { - let __t3962 = v_V1835.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t3962])? - }; - if match rt::is_truthy(interp, &__t3970) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3965 = { - let __t3964 = { - let __t3963 = v_V1835.clone(); - rt::apply_direct(interp, "hdstr", &[__t3963])? - }; - rt::apply_value(interp, v_V1834.clone(), &[__t3964])? - }; - let __t3969 = { - let __t3966 = v_V1834.clone(); - let __t3968 = { - let __t3967 = v_V1835.clone(); - rt::apply_direct(interp, "tlstr", &[__t3967])? - }; - rt::apply_direct(interp, "string.map", &[__t3966, __t3968])? - }; - rt::apply_direct(interp, "@s", &[__t3965, __t3969])? - }); - } else { - { - let __t3961 = Value::bool(true); - if match rt::is_truthy(interp, &__t3961) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3960 = Value::sym(interp.intern("string.map")); - rt::apply_direct(interp, "shen.f-error", &[__t3960])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_string_x2e_map(interp: &mut Interp) { - interp.register_native("string.map", 2, aot_string_x2e_map); - interp.register_aot_direct("string.map", aot_string_x2e_map); -} - -/// AOT-compiled from KL `(defun spell-number ...)` -pub fn aot_spell_x2d_number(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "spell-number: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1839 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t3983 = { - let __t3981 = Value::int(0i64); - let __t3982 = v_V1839.clone(); - rt::eq(&__t3981, &__t3982) - }; - if match rt::is_truthy(interp, &__t3983) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("zero")); - } else { - { - let __t3980 = Value::bool(true); - if match rt::is_truthy(interp, &__t3980) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t3979 = { - let __t3975 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z1840 = args[0].clone(); - Ok({ - let __t3974 = v_Z1840.clone(); - rt::apply_direct( - interp, - "string.digits", - &[__t3974], - )? - }) - }, - Vec::new(), - interp, - ) - }; - let __t3978 = { - let __t3977 = { - let __t3976 = v_V1839.clone(); - rt::apply_direct(interp, "explode", &[__t3976])? - }; - rt::apply_direct(interp, "string.triples", &[__t3977])? - }; - rt::apply_direct(interp, "map", &[__t3975, __t3978])? - }; - rt::apply_direct(interp, "string.scale", &[__t3979])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_spell_x2d_number(interp: &mut Interp) { - interp.register_native("spell-number", 1, aot_spell_x2d_number); - interp.register_aot_direct("spell-number", aot_spell_x2d_number); -} - -/// AOT-compiled from KL `(defun string.digit ...)` -pub fn aot_string_x2e_digit(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.digit: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1842 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4015 = { - let __t4013 = Value::str("0"); - let __t4014 = v_V1842.clone(); - rt::eq(&__t4013, &__t4014) - }; - if match rt::is_truthy(interp, &__t4015) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t4012 = { - let __t4010 = Value::str("1"); - let __t4011 = v_V1842.clone(); - rt::eq(&__t4010, &__t4011) - }; - if match rt::is_truthy(interp, &__t4012) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("one")); - } else { - { - let __t4009 = { - let __t4007 = Value::str("2"); - let __t4008 = v_V1842.clone(); - rt::eq(&__t4007, &__t4008) - }; - if match rt::is_truthy(interp, &__t4009) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("two")); - } else { - { - let __t4006 = { - let __t4004 = Value::str("3"); - let __t4005 = v_V1842.clone(); - rt::eq(&__t4004, &__t4005) - }; - if match rt::is_truthy(interp, &__t4006) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("three")); - } else { - { - let __t4003 = { - let __t4001 = Value::str("4"); - let __t4002 = v_V1842.clone(); - rt::eq(&__t4001, &__t4002) - }; - if match rt::is_truthy(interp, &__t4003) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("four")); - } else { - { - let __t4000 = { - let __t3998 = Value::str("5"); - let __t3999 = v_V1842.clone(); - rt::eq(&__t3998, &__t3999) - }; - if match rt::is_truthy(interp, &__t4000) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("five")); - } else { - { - let __t3997 = { - let __t3995 = Value::str("6"); - let __t3996 = v_V1842.clone(); - rt::eq(&__t3995, &__t3996) - }; - if match rt::is_truthy(interp, &__t3997) - { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("six")); - } else { - { - let __t3994 = { - let __t3992 = - Value::str("7"); - let __t3993 = - v_V1842.clone(); - rt::eq(&__t3992, &__t3993) - }; - if match rt::is_truthy( - interp, &__t3994, - ) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str( - "seven", - )); - } else { - { - let __t3991 = { - let __t3989 = - Value::str("8"); - let __t3990 = - v_V1842.clone(); - rt::eq( - &__t3989, - &__t3990, - ) - }; - if match rt::is_truthy( - interp, &__t3991, - ) { - Ok(b) => b, - Err(e) => { - break Err(e) - } - } { - break Ok( - Value::str( - "eight", - ), - ); - } else { - { - let __t3988 = { - let __t3986 = Value::str("9"); - let __t3987 = v_V1842.clone(); - rt::eq(&__t3986, &__t3987) - }; - if match rt::is_truthy(interp, &__t3988) { Ok(b) => b, Err(e) => break Err(e), } { break Ok(Value::str("nine")); } else { { let __t3985 = Value::bool(true); if match rt::is_truthy(interp, &__t3985) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t3984 = Value::sym(interp.intern("string.digit")); rt::apply_direct(interp, "shen.f-error", &[__t3984])? }); } else { break Err(ShenError::new("cond: no clause matched")); } } } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_string_x2e_digit(interp: &mut Interp) { - interp.register_native("string.digit", 1, aot_string_x2e_digit); - interp.register_aot_direct("string.digit", aot_string_x2e_digit); -} - -/// AOT-compiled from KL `(defun string.triples ...)` -pub fn aot_string_x2e_triples(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.triples: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1844 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t4017 = { - let __t4016 = v_V1844.clone(); - rt::apply_direct(interp, "reverse", &[__t4016])? - }; - let __t4018 = Value::nil(); - rt::apply_direct(interp, "string.triples-h", &[__t4017, __t4018])? - }); - } -} - -fn install_string_x2e_triples(interp: &mut Interp) { - interp.register_native("string.triples", 1, aot_string_x2e_triples); - interp.register_aot_direct("string.triples", aot_string_x2e_triples); -} - -/// AOT-compiled from KL `(defun string.triples-h ...)` -pub fn aot_string_x2e_triples_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.triples-h: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1846 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1847 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4053 = { - let __t4031 = { - let __t4023 = v_V1846.clone(); - rt::is_cons(&__t4023) - }; - if !rt::is_truthy(interp, &__t4031)? { - Value::bool(false) - } else { - let __t4032 = { - let __t4029 = { - let __t4025 = { - let __t4024 = v_V1846.clone(); - rt::tl(&__t4024)? - }; - rt::is_cons(&__t4025) - }; - if !rt::is_truthy(interp, &__t4029)? { - Value::bool(false) - } else { - let __t4030 = { - let __t4028 = { - let __t4027 = { - let __t4026 = v_V1846.clone(); - rt::tl(&__t4026)? - }; - rt::tl(&__t4027)? - }; - rt::is_cons(&__t4028) - }; - Value::bool(rt::is_truthy(interp, &__t4030)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4032)?) - } - }; - if match rt::is_truthy(interp, &__t4053) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t4036 = { - let __t4035 = { - let __t4034 = { - let __t4033 = v_V1846.clone(); - rt::tl(&__t4033)? - }; - rt::tl(&__t4034)? - }; - rt::tl(&__t4035)? - }; - let __t4052 = { - let __t4050 = { - let __t4049 = { - let __t4038 = { - let __t4037 = v_V1846.clone(); - rt::hd(&__t4037)? - }; - let __t4048 = { - let __t4041 = { - let __t4040 = { - let __t4039 = v_V1846.clone(); - rt::tl(&__t4039)? - }; - rt::hd(&__t4040)? - }; - let __t4047 = { - let __t4045 = { - let __t4044 = { - let __t4043 = { - let __t4042 = v_V1846.clone(); - rt::tl(&__t4042)? - }; - rt::tl(&__t4043)? - }; - rt::hd(&__t4044)? - }; - let __t4046 = Value::nil(); - rt::cons(&__t4045, &__t4046) - }; - rt::cons(&__t4041, &__t4047) - }; - rt::cons(&__t4038, &__t4048) - }; - rt::apply_direct(interp, "reverse", &[__t4049])? - }; - let __t4051 = v_V1847.clone(); - rt::cons(&__t4050, &__t4051) - }; - v_V1846 = __t4036; - v_V1847 = __t4052; - continue; - } - } else { - { - let __t4022 = Value::bool(true); - if match rt::is_truthy(interp, &__t4022) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4020 = { - let __t4019 = v_V1846.clone(); - rt::apply_direct(interp, "reverse", &[__t4019])? - }; - let __t4021 = v_V1847.clone(); - rt::cons(&__t4020, &__t4021) - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_string_x2e_triples_x2d_h(interp: &mut Interp) { - interp.register_native("string.triples-h", 2, aot_string_x2e_triples_x2d_h); - interp.register_aot_direct("string.triples-h", aot_string_x2e_triples_x2d_h); -} - -/// AOT-compiled from KL `(defun string.digits ...)` -pub fn aot_string_x2e_digits(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.digits: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1850 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4349 = { - let __t4347 = { - let __t4314 = v_V1850.clone(); - rt::is_cons(&__t4314) - }; - if !rt::is_truthy(interp, &__t4347)? { - Value::bool(false) - } else { - let __t4348 = { - let __t4345 = { - let __t4315 = Value::str("0"); - let __t4317 = { - let __t4316 = v_V1850.clone(); - rt::hd(&__t4316)? - }; - rt::eq(&__t4315, &__t4317) - }; - if !rt::is_truthy(interp, &__t4345)? { - Value::bool(false) - } else { - let __t4346 = { - let __t4343 = { - let __t4319 = { - let __t4318 = v_V1850.clone(); - rt::tl(&__t4318)? - }; - rt::is_cons(&__t4319) - }; - if !rt::is_truthy(interp, &__t4343)? { - Value::bool(false) - } else { - let __t4344 = { - let __t4341 = { - let __t4320 = Value::str("0"); - let __t4323 = { - let __t4322 = { - let __t4321 = v_V1850.clone(); - rt::tl(&__t4321)? - }; - rt::hd(&__t4322)? - }; - rt::eq(&__t4320, &__t4323) - }; - if !rt::is_truthy(interp, &__t4341)? { - Value::bool(false) - } else { - let __t4342 = { - let __t4339 = { - let __t4326 = { - let __t4325 = { - let __t4324 = v_V1850.clone(); - rt::tl(&__t4324)? - }; - rt::tl(&__t4325)? - }; - rt::is_cons(&__t4326) - }; - if !rt::is_truthy(interp, &__t4339)? { - Value::bool(false) - } else { - let __t4340 = { - let __t4337 = { - let __t4327 = Value::str("0"); - let __t4331 = { - let __t4330 = { - let __t4329 = { - let __t4328 = - v_V1850.clone(); - rt::tl(&__t4328)? - }; - rt::tl(&__t4329)? - }; - rt::hd(&__t4330)? - }; - rt::eq(&__t4327, &__t4331) - }; - if !rt::is_truthy(interp, &__t4337)? { - Value::bool(false) - } else { - let __t4338 = { - let __t4332 = Value::nil(); - let __t4336 = { - let __t4335 = { - let __t4334 = { - let __t4333 = - v_V1850.clone(); - rt::tl(&__t4333)? - }; - rt::tl(&__t4334)? - }; - rt::tl(&__t4335)? - }; - rt::eq(&__t4332, &__t4336) - }; - Value::bool(rt::is_truthy( - interp, &__t4338, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4340)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4342)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4344)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4346)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4348)?) - } - }; - if match rt::is_truthy(interp, &__t4349) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t4313 = { - let __t4305 = { - let __t4277 = v_V1850.clone(); - rt::is_cons(&__t4277) - }; - if !rt::is_truthy(interp, &__t4305)? { - Value::bool(false) - } else { - let __t4306 = { - let __t4303 = { - let __t4279 = { - let __t4278 = v_V1850.clone(); - rt::tl(&__t4278)? - }; - rt::is_cons(&__t4279) - }; - if !rt::is_truthy(interp, &__t4303)? { - Value::bool(false) - } else { - let __t4304 = { - let __t4301 = { - let __t4280 = Value::str("0"); - let __t4283 = { - let __t4282 = { - let __t4281 = v_V1850.clone(); - rt::tl(&__t4281)? - }; - rt::hd(&__t4282)? - }; - rt::eq(&__t4280, &__t4283) - }; - if !rt::is_truthy(interp, &__t4301)? { - Value::bool(false) - } else { - let __t4302 = { - let __t4299 = { - let __t4286 = { - let __t4285 = { - let __t4284 = v_V1850.clone(); - rt::tl(&__t4284)? - }; - rt::tl(&__t4285)? - }; - rt::is_cons(&__t4286) - }; - if !rt::is_truthy(interp, &__t4299)? { - Value::bool(false) - } else { - let __t4300 = { - let __t4297 = { - let __t4287 = Value::str("0"); - let __t4291 = { - let __t4290 = { - let __t4289 = { - let __t4288 = - v_V1850.clone(); - rt::tl(&__t4288)? - }; - rt::tl(&__t4289)? - }; - rt::hd(&__t4290)? - }; - rt::eq(&__t4287, &__t4291) - }; - if !rt::is_truthy(interp, &__t4297)? { - Value::bool(false) - } else { - let __t4298 = { - let __t4292 = Value::nil(); - let __t4296 = { - let __t4295 = { - let __t4294 = { - let __t4293 = - v_V1850.clone(); - rt::tl(&__t4293)? - }; - rt::tl(&__t4294)? - }; - rt::tl(&__t4295)? - }; - rt::eq(&__t4292, &__t4296) - }; - Value::bool(rt::is_truthy( - interp, &__t4298, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4300)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4302)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4304)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4306)?) - } - }; - if match rt::is_truthy(interp, &__t4313) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4309 = { - let __t4308 = { - let __t4307 = v_V1850.clone(); - rt::hd(&__t4307)? - }; - rt::apply_direct(interp, "string.digit", &[__t4308])? - }; - let __t4312 = { - let __t4310 = Value::str(" "); - let __t4311 = Value::str("hundred"); - rt::apply_direct(interp, "@s", &[__t4310, __t4311])? - }; - rt::apply_direct(interp, "@s", &[__t4309, __t4312])? - }); - } else { - { - let __t4276 = { - let __t4262 = { - let __t4236 = v_V1850.clone(); - rt::is_cons(&__t4236) - }; - if !rt::is_truthy(interp, &__t4262)? { - Value::bool(false) - } else { - let __t4263 = { - let __t4260 = { - let __t4237 = Value::str("0"); - let __t4239 = { - let __t4238 = v_V1850.clone(); - rt::hd(&__t4238)? - }; - rt::eq(&__t4237, &__t4239) - }; - if !rt::is_truthy(interp, &__t4260)? { - Value::bool(false) - } else { - let __t4261 = { - let __t4258 = { - let __t4241 = { - let __t4240 = v_V1850.clone(); - rt::tl(&__t4240)? - }; - rt::is_cons(&__t4241) - }; - if !rt::is_truthy(interp, &__t4258)? { - Value::bool(false) - } else { - let __t4259 = { - let __t4256 = { - let __t4242 = Value::str("0"); - let __t4245 = { - let __t4244 = { - let __t4243 = v_V1850.clone(); - rt::tl(&__t4243)? - }; - rt::hd(&__t4244)? - }; - rt::eq(&__t4242, &__t4245) - }; - if !rt::is_truthy(interp, &__t4256)? { - Value::bool(false) - } else { - let __t4257 = { - let __t4254 = { - let __t4248 = { - let __t4247 = { - let __t4246 = - v_V1850.clone(); - rt::tl(&__t4246)? - }; - rt::tl(&__t4247)? - }; - rt::is_cons(&__t4248) - }; - if !rt::is_truthy(interp, &__t4254)? - { - Value::bool(false) - } else { - let __t4255 = { - let __t4249 = Value::nil(); - let __t4253 = { - let __t4252 = { - let __t4251 = { - let __t4250 = - v_V1850 - .clone( - ); - rt::tl( - &__t4250, - )? - }; - rt::tl(&__t4251)? - }; - rt::tl(&__t4252)? - }; - rt::eq(&__t4249, &__t4253) - }; - Value::bool(rt::is_truthy( - interp, &__t4255, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t4257, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4259)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4261)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4263)?) - } - }; - if match rt::is_truthy(interp, &__t4276) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4264 = Value::str("a"); - let __t4275 = { - let __t4265 = Value::str("n"); - let __t4274 = { - let __t4266 = Value::str("d"); - let __t4273 = { - let __t4267 = Value::str(" "); - let __t4272 = { - let __t4271 = { - let __t4270 = { - let __t4269 = { - let __t4268 = v_V1850.clone(); - rt::tl(&__t4268)? - }; - rt::tl(&__t4269)? - }; - rt::hd(&__t4270)? - }; - rt::apply_direct( - interp, - "string.digit", - &[__t4271], - )? - }; - rt::apply_direct(interp, "@s", &[__t4267, __t4272])? - }; - rt::apply_direct(interp, "@s", &[__t4266, __t4273])? - }; - rt::apply_direct(interp, "@s", &[__t4265, __t4274])? - }; - rt::apply_direct(interp, "@s", &[__t4264, __t4275])? - }); - } else { - { - let __t4235 = { - let __t4218 = { - let __t4198 = v_V1850.clone(); - rt::is_cons(&__t4198) - }; - if !rt::is_truthy(interp, &__t4218)? { - Value::bool(false) - } else { - let __t4219 = { - let __t4216 = { - let __t4199 = Value::str("0"); - let __t4201 = { - let __t4200 = v_V1850.clone(); - rt::hd(&__t4200)? - }; - rt::eq(&__t4199, &__t4201) - }; - if !rt::is_truthy(interp, &__t4216)? { - Value::bool(false) - } else { - let __t4217 = { - let __t4214 = { - let __t4203 = { - let __t4202 = v_V1850.clone(); - rt::tl(&__t4202)? - }; - rt::is_cons(&__t4203) - }; - if !rt::is_truthy(interp, &__t4214)? { - Value::bool(false) - } else { - let __t4215 = { - let __t4212 = { - let __t4206 = { - let __t4205 = { - let __t4204 = - v_V1850.clone(); - rt::tl(&__t4204)? - }; - rt::tl(&__t4205)? - }; - rt::is_cons(&__t4206) - }; - if !rt::is_truthy(interp, &__t4212)? - { - Value::bool(false) - } else { - let __t4213 = { - let __t4207 = Value::nil(); - let __t4211 = { - let __t4210 = { - let __t4209 = { - let __t4208 = - v_V1850 - .clone( - ); - rt::tl( - &__t4208, - )? - }; - rt::tl(&__t4209)? - }; - rt::tl(&__t4210)? - }; - rt::eq(&__t4207, &__t4211) - }; - Value::bool(rt::is_truthy( - interp, &__t4213, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t4215, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4217)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4219)?) - } - }; - if match rt::is_truthy(interp, &__t4235) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4220 = Value::str("a"); - let __t4234 = { - let __t4221 = Value::str("n"); - let __t4233 = { - let __t4222 = Value::str("d"); - let __t4232 = { - let __t4223 = Value::str(" "); - let __t4231 = { - let __t4226 = { - let __t4225 = { - let __t4224 = v_V1850.clone(); - rt::tl(&__t4224)? - }; - rt::hd(&__t4225)? - }; - let __t4230 = { - let __t4229 = { - let __t4228 = { - let __t4227 = - v_V1850.clone(); - rt::tl(&__t4227)? - }; - rt::tl(&__t4228)? - }; - rt::hd(&__t4229)? - }; - rt::apply_direct( - interp, - "string.tens", - &[__t4226, __t4230], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4223, __t4231], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4222, __t4232], - )? - }; - rt::apply_direct(interp, "@s", &[__t4221, __t4233])? - }; - rt::apply_direct(interp, "@s", &[__t4220, __t4234])? - }); - } else { - { - let __t4197 = { - let __t4161 = { - let __t4140 = v_V1850.clone(); - rt::is_cons(&__t4140) - }; - if !rt::is_truthy(interp, &__t4161)? { - Value::bool(false) - } else { - let __t4162 = { - let __t4159 = { - let __t4142 = { - let __t4141 = v_V1850.clone(); - rt::tl(&__t4141)? - }; - rt::is_cons(&__t4142) - }; - if !rt::is_truthy(interp, &__t4159)? { - Value::bool(false) - } else { - let __t4160 = { - let __t4157 = { - let __t4143 = Value::str("0"); - let __t4146 = { - let __t4145 = { - let __t4144 = - v_V1850.clone(); - rt::tl(&__t4144)? - }; - rt::hd(&__t4145)? - }; - rt::eq(&__t4143, &__t4146) - }; - if !rt::is_truthy(interp, &__t4157)? - { - Value::bool(false) - } else { - let __t4158 = { - let __t4155 = { - let __t4149 = { - let __t4148 = { - let __t4147 = - v_V1850 - .clone( - ); - rt::tl( - &__t4147, - )? - }; - rt::tl(&__t4148)? - }; - rt::is_cons(&__t4149) - }; - if !rt::is_truthy( - interp, &__t4155, - )? { - Value::bool(false) - } else { - let __t4156 = { - let __t4150 = - Value::nil(); - let __t4154 = { - let __t4153 = { - let __t4152 = { - let __t4151 = v_V1850.clone(); - rt::tl(&__t4151)? - }; - rt::tl(&__t4152)? - }; - rt::tl( - &__t4153, - )? - }; - rt::eq( - &__t4150, - &__t4154, - ) - }; - Value::bool( - rt::is_truthy( - interp, - &__t4156, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t4158, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t4160, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4162)?) - } - }; - if match rt::is_truthy(interp, &__t4197) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4165 = { - let __t4164 = { - let __t4163 = v_V1850.clone(); - rt::hd(&__t4163)? - }; - rt::apply_direct( - interp, - "string.digit", - &[__t4164], - )? - }; - let __t4196 = { - let __t4166 = Value::str(" "); - let __t4195 = { - let __t4167 = Value::str("h"); - let __t4194 = { - let __t4168 = Value::str("u"); - let __t4193 = { - let __t4169 = Value::str("n"); - let __t4192 = { - let __t4170 = - Value::str("d"); - let __t4191 = { - let __t4171 = - Value::str("r"); - let __t4190 = { - let __t4172 = - Value::str("e"); - let __t4189 = { - let __t4173 = - Value::str( - "d", - ); - let __t4188 = { - let __t4174 = Value::str(" "); - let __t4187 = { - let __t4175 = Value::str("a"); - let __t4186 = { - let __t4176 = Value::str("n"); - let __t4185 = { let __t4177 = Value::str("d"); let __t4184 = { let __t4178 = Value::str(" "); let __t4183 = { let __t4182 = { let __t4181 = { let __t4180 = { let __t4179 = v_V1850.clone(); rt::tl(&__t4179)? }; rt::tl(&__t4180)? }; rt::hd(&__t4181)? }; rt::apply_direct(interp, "string.digit", &[__t4182])? }; rt::apply_direct(interp, "@s", &[__t4178, __t4183])? }; rt::apply_direct(interp, "@s", &[__t4177, __t4184])? }; - rt::apply_direct(interp, "@s", &[__t4176, __t4185])? - }; - rt::apply_direct(interp, "@s", &[__t4175, __t4186])? - }; - rt::apply_direct(interp, "@s", &[__t4174, __t4187])? - }; - rt::apply_direct(interp, "@s", &[__t4173, __t4188])? - }; - rt::apply_direct( - interp, - "@s", - &[ - __t4172, - __t4189, - ], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4171, __t4190], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4170, __t4191], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4169, __t4192], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4168, __t4193], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4167, __t4194], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4166, __t4195], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4165, __t4196], - )? - }); - } else { - { - let __t4139 = { - let __t4100 = { - let __t4085 = v_V1850.clone(); - rt::is_cons(&__t4085) - }; - if !rt::is_truthy(interp, &__t4100)? { - Value::bool(false) - } else { - let __t4101 = { - let __t4098 = { - let __t4087 = { - let __t4086 = - v_V1850.clone(); - rt::tl(&__t4086)? - }; - rt::is_cons(&__t4087) - }; - if !rt::is_truthy(interp, &__t4098)? - { - Value::bool(false) - } else { - let __t4099 = { - let __t4096 = { - let __t4090 = { - let __t4089 = { - let __t4088 = - v_V1850 - .clone( - ); - rt::tl( - &__t4088, - )? - }; - rt::tl(&__t4089)? - }; - rt::is_cons(&__t4090) - }; - if !rt::is_truthy( - interp, &__t4096, - )? { - Value::bool(false) - } else { - let __t4097 = { - let __t4091 = - Value::nil(); - let __t4095 = { - let __t4094 = { - let __t4093 = { - let __t4092 = v_V1850.clone(); - rt::tl(&__t4092)? - }; - rt::tl(&__t4093)? - }; - rt::tl( - &__t4094, - )? - }; - rt::eq( - &__t4091, - &__t4095, - ) - }; - Value::bool( - rt::is_truthy( - interp, - &__t4097, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t4099, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t4101, - )?) - } - }; - if match rt::is_truthy(interp, &__t4139) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4104 = { - let __t4103 = { - let __t4102 = v_V1850.clone(); - rt::hd(&__t4102)? - }; - rt::apply_direct( - interp, - "string.digit", - &[__t4103], - )? - }; - let __t4138 = { - let __t4105 = Value::str(" "); - let __t4137 = { - let __t4106 = Value::str("h"); - let __t4136 = { - let __t4107 = - Value::str("u"); - let __t4135 = { - let __t4108 = - Value::str("n"); - let __t4134 = { - let __t4109 = - Value::str("d"); - let __t4133 = { - let __t4110 = - Value::str( - "r", - ); - let __t4132 = { - let __t4111 = Value::str("e"); - let __t4131 = { - let __t4112 = Value::str("d"); - let __t4130 = { - let __t4113 = Value::str(" "); - let __t4129 = { let __t4114 = Value::str("a"); let __t4128 = { let __t4115 = Value::str("n"); let __t4127 = { let __t4116 = Value::str("d"); let __t4126 = { let __t4117 = Value::str(" "); let __t4125 = { let __t4120 = { let __t4119 = { let __t4118 = v_V1850.clone(); rt::tl(&__t4118)? }; rt::hd(&__t4119)? }; let __t4124 = { let __t4123 = { let __t4122 = { let __t4121 = v_V1850.clone(); rt::tl(&__t4121)? }; rt::tl(&__t4122)? }; rt::hd(&__t4123)? }; rt::apply_direct(interp, "string.tens", &[__t4120, __t4124])? }; rt::apply_direct(interp, "@s", &[__t4117, __t4125])? }; rt::apply_direct(interp, "@s", &[__t4116, __t4126])? }; rt::apply_direct(interp, "@s", &[__t4115, __t4127])? }; rt::apply_direct(interp, "@s", &[__t4114, __t4128])? }; - rt::apply_direct(interp, "@s", &[__t4113, __t4129])? - }; - rt::apply_direct(interp, "@s", &[__t4112, __t4130])? - }; - rt::apply_direct(interp, "@s", &[__t4111, __t4131])? - }; - rt::apply_direct(interp, "@s", &[__t4110, __t4132])? - }; - rt::apply_direct( - interp, - "@s", - &[ - __t4109, - __t4133, - ], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4108, __t4134], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4107, __t4135], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4106, __t4136], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4105, __t4137], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4104, __t4138], - )? - }); - } else { - { - let __t4084 = { - let __t4077 = { - let __t4068 = v_V1850.clone(); - rt::is_cons(&__t4068) - }; - if !rt::is_truthy(interp, &__t4077)? - { - Value::bool(false) - } else { - let __t4078 = { - let __t4075 = { - let __t4070 = { - let __t4069 = - v_V1850.clone(); - rt::tl(&__t4069)? - }; - rt::is_cons(&__t4070) - }; - if !rt::is_truthy( - interp, &__t4075, - )? { - Value::bool(false) - } else { - let __t4076 = { - let __t4071 = - Value::nil(); - let __t4074 = { - let __t4073 = { - let __t4072 = v_V1850.clone(); - rt::tl(&__t4072)? - }; - rt::tl( - &__t4073, - )? - }; - rt::eq( - &__t4071, - &__t4074, - ) - }; - Value::bool( - rt::is_truthy( - interp, - &__t4076, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t4078, - )?) - } - }; - if match rt::is_truthy(interp, &__t4084) - { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4080 = { - let __t4079 = - v_V1850.clone(); - rt::hd(&__t4079)? - }; - let __t4083 = { - let __t4082 = { - let __t4081 = - v_V1850.clone(); - rt::tl(&__t4081)? - }; - rt::hd(&__t4082)? - }; - rt::apply_direct( - interp, - "string.tens", - &[__t4080, __t4083], - )? - }); - } else { - { - let __t4067 = { - let __t4063 = { - let __t4059 = - v_V1850.clone(); - rt::is_cons(&__t4059) - }; - if !rt::is_truthy( - interp, &__t4063, - )? { - Value::bool(false) - } else { - let __t4064 = { - let __t4060 = - Value::nil(); - let __t4062 = { - let __t4061 = - v_V1850 - .clone( - ); - rt::tl( - &__t4061, - )? - }; - rt::eq( - &__t4060, - &__t4062, - ) - }; - Value::bool( - rt::is_truthy( - interp, - &__t4064, - )?, - ) - } - }; - if match rt::is_truthy( - interp, &__t4067, - ) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4066 = { - let __t4065 = - v_V1850.clone(); - rt::hd(&__t4065)? - }; - rt::apply_direct( - interp, - "string.digit", - &[__t4066], - )? - }); - } else { - { - let __t4058 = { - let __t4056 = - Value::nil(); - let __t4057 = - v_V1850.clone(); - rt::eq( - &__t4056, - &__t4057, - ) - }; - if match rt::is_truthy( - interp, &__t4058, - ) { - Ok(b) => b, - Err(e) => { - break Err(e) - } - } { - break Ok( - Value::str(""), - ); - } else { - { - let __t4055 = - Value::bool( - true, - ); - if match rt::is_truthy(interp, &__t4055) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t4054 = Value::sym(interp.intern("string.digits")); rt::apply_direct(interp, "shen.f-error", &[__t4054])? }); } else { break Err(ShenError::new("cond: no clause matched")); } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_string_x2e_digits(interp: &mut Interp) { - interp.register_native("string.digits", 1, aot_string_x2e_digits); - interp.register_aot_direct("string.digits", aot_string_x2e_digits); -} - -/// AOT-compiled from KL `(defun string.tens ...)` -pub fn aot_string_x2e_tens(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.tens: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1852 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1853 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4525 = { - let __t4492 = Value::str("1"); - let __t4493 = v_V1852.clone(); - rt::eq(&__t4492, &__t4493) - }; - if match rt::is_truthy(interp, &__t4525) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t4496 = { - let __t4494 = v_V1853.clone(); - let __t4495 = Value::str("0"); - rt::eq(&__t4494, &__t4495) - }; - if match rt::is_truthy(interp, &__t4496) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("ten")); - } else { - { - let __t4499 = { - let __t4497 = v_V1853.clone(); - let __t4498 = Value::str("1"); - rt::eq(&__t4497, &__t4498) - }; - if match rt::is_truthy(interp, &__t4499) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("eleven")); - } else { - { - let __t4502 = { - let __t4500 = v_V1853.clone(); - let __t4501 = Value::str("2"); - rt::eq(&__t4500, &__t4501) - }; - if match rt::is_truthy(interp, &__t4502) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("twelve")); - } else { - { - let __t4505 = { - let __t4503 = v_V1853.clone(); - let __t4504 = Value::str("3"); - rt::eq(&__t4503, &__t4504) - }; - if match rt::is_truthy(interp, &__t4505) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("thirteen")); - } else { - { - let __t4508 = { - let __t4506 = v_V1853.clone(); - let __t4507 = Value::str("4"); - rt::eq(&__t4506, &__t4507) - }; - if match rt::is_truthy(interp, &__t4508) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("fourteen")); - } else { - { - let __t4511 = { - let __t4509 = v_V1853.clone(); - let __t4510 = Value::str("5"); - rt::eq(&__t4509, &__t4510) - }; - if match rt::is_truthy(interp, &__t4511) - { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("fifteen")); - } else { - { - let __t4514 = { - let __t4512 = - v_V1853.clone(); - let __t4513 = - Value::str("6"); - rt::eq(&__t4512, &__t4513) - }; - if match rt::is_truthy( - interp, &__t4514, - ) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str( - "sixteen", - )); - } else { - { - let __t4517 = { - let __t4515 = - v_V1853.clone(); - let __t4516 = - Value::str("7"); - rt::eq( - &__t4515, - &__t4516, - ) - }; - if match rt::is_truthy( - interp, &__t4517, - ) { - Ok(b) => b, - Err(e) => { - break Err(e) - } - } { - break Ok( - Value::str( - "seventeen", - ), - ); - } else { - { - let __t4520 = { - let __t4518 = v_V1853.clone(); - let __t4519 = Value::str("8"); - rt::eq(&__t4518, &__t4519) - }; - if match rt::is_truthy(interp, &__t4520) { Ok(b) => b, Err(e) => break Err(e), } { break Ok(Value::str("eighteen")); } else { { let __t4523 = { let __t4521 = v_V1853.clone(); let __t4522 = Value::str("9"); rt::eq(&__t4521, &__t4522) }; if match rt::is_truthy(interp, &__t4523) { Ok(b) => b, Err(e) => break Err(e), } { break Ok(Value::str("nineteen")); } else { break Ok({ let __t4524 = Value::str("error: cases exhausted"); rt::apply_direct(interp, "simple-error", &[__t4524])? }); } } } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } else { - { - let __t4491 = { - let __t4474 = Value::str("2"); - let __t4475 = v_V1852.clone(); - rt::eq(&__t4474, &__t4475) - }; - if match rt::is_truthy(interp, &__t4491) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4476 = Value::str("t"); - let __t4490 = { - let __t4477 = Value::str("w"); - let __t4489 = { - let __t4478 = Value::str("e"); - let __t4488 = { - let __t4479 = Value::str("n"); - let __t4487 = { - let __t4480 = Value::str("t"); - let __t4486 = { - let __t4481 = Value::str("y"); - let __t4485 = { - let __t4482 = Value::str(" "); - let __t4484 = { - let __t4483 = v_V1853.clone(); - rt::apply_direct( - interp, - "string.digit", - &[__t4483], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4482, __t4484], - )? - }; - rt::apply_direct(interp, "@s", &[__t4481, __t4485])? - }; - rt::apply_direct(interp, "@s", &[__t4480, __t4486])? - }; - rt::apply_direct(interp, "@s", &[__t4479, __t4487])? - }; - rt::apply_direct(interp, "@s", &[__t4478, __t4488])? - }; - rt::apply_direct(interp, "@s", &[__t4477, __t4489])? - }; - rt::apply_direct(interp, "@s", &[__t4476, __t4490])? - }); - } else { - { - let __t4473 = { - let __t4456 = Value::str("3"); - let __t4457 = v_V1852.clone(); - rt::eq(&__t4456, &__t4457) - }; - if match rt::is_truthy(interp, &__t4473) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4458 = Value::str("t"); - let __t4472 = { - let __t4459 = Value::str("h"); - let __t4471 = { - let __t4460 = Value::str("i"); - let __t4470 = { - let __t4461 = Value::str("r"); - let __t4469 = { - let __t4462 = Value::str("t"); - let __t4468 = { - let __t4463 = Value::str("y"); - let __t4467 = { - let __t4464 = Value::str(" "); - let __t4466 = { - let __t4465 = v_V1853.clone(); - rt::apply_direct( - interp, - "string.digit", - &[__t4465], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4464, __t4466], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4463, __t4467], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4462, __t4468], - )? - }; - rt::apply_direct(interp, "@s", &[__t4461, __t4469])? - }; - rt::apply_direct(interp, "@s", &[__t4460, __t4470])? - }; - rt::apply_direct(interp, "@s", &[__t4459, __t4471])? - }; - rt::apply_direct(interp, "@s", &[__t4458, __t4472])? - }); - } else { - { - let __t4455 = { - let __t4440 = Value::str("4"); - let __t4441 = v_V1852.clone(); - rt::eq(&__t4440, &__t4441) - }; - if match rt::is_truthy(interp, &__t4455) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4442 = Value::str("f"); - let __t4454 = { - let __t4443 = Value::str("o"); - let __t4453 = { - let __t4444 = Value::str("r"); - let __t4452 = { - let __t4445 = Value::str("t"); - let __t4451 = { - let __t4446 = Value::str("y"); - let __t4450 = { - let __t4447 = Value::str(" "); - let __t4449 = { - let __t4448 = v_V1853.clone(); - rt::apply_direct( - interp, - "string.digit", - &[__t4448], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4447, __t4449], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4446, __t4450], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4445, __t4451], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4444, __t4452], - )? - }; - rt::apply_direct(interp, "@s", &[__t4443, __t4453])? - }; - rt::apply_direct(interp, "@s", &[__t4442, __t4454])? - }); - } else { - { - let __t4439 = { - let __t4424 = Value::str("5"); - let __t4425 = v_V1852.clone(); - rt::eq(&__t4424, &__t4425) - }; - if match rt::is_truthy(interp, &__t4439) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4426 = Value::str("f"); - let __t4438 = { - let __t4427 = Value::str("i"); - let __t4437 = { - let __t4428 = Value::str("f"); - let __t4436 = { - let __t4429 = Value::str("t"); - let __t4435 = { - let __t4430 = Value::str("y"); - let __t4434 = { - let __t4431 = - Value::str(" "); - let __t4433 = { - let __t4432 = - v_V1853.clone(); - rt::apply_direct( - interp, - "string.digit", - &[__t4432], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4431, __t4433], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4430, __t4434], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4429, __t4435], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4428, __t4436], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4427, __t4437], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4426, __t4438], - )? - }); - } else { - { - let __t4423 = { - let __t4408 = Value::str("6"); - let __t4409 = v_V1852.clone(); - rt::eq(&__t4408, &__t4409) - }; - if match rt::is_truthy(interp, &__t4423) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4410 = Value::str("s"); - let __t4422 = { - let __t4411 = Value::str("i"); - let __t4421 = { - let __t4412 = Value::str("x"); - let __t4420 = { - let __t4413 = - Value::str("t"); - let __t4419 = { - let __t4414 = - Value::str("y"); - let __t4418 = { - let __t4415 = - Value::str(" "); - let __t4417 = { - let __t4416 = - v_V1853 - .clone( - ); - rt::apply_direct(interp, "string.digit", &[__t4416])? - }; - rt::apply_direct( - interp, - "@s", - &[ - __t4415, - __t4417, - ], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4414, __t4418], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4413, __t4419], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4412, __t4420], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4411, __t4421], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4410, __t4422], - )? - }); - } else { - { - let __t4407 = { - let __t4388 = Value::str("7"); - let __t4389 = v_V1852.clone(); - rt::eq(&__t4388, &__t4389) - }; - if match rt::is_truthy(interp, &__t4407) - { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4390 = Value::str("s"); - let __t4406 = { - let __t4391 = - Value::str("e"); - let __t4405 = { - let __t4392 = - Value::str("v"); - let __t4404 = { - let __t4393 = - Value::str("e"); - let __t4403 = { - let __t4394 = - Value::str( - "n", - ); - let __t4402 = { - let __t4395 = Value::str("t"); - let __t4401 = { - let __t4396 = Value::str("y"); - let __t4400 = { - let __t4397 = Value::str(" "); - let __t4399 = { let __t4398 = v_V1853.clone(); rt::apply_direct(interp, "string.digit", &[__t4398])? }; - rt::apply_direct(interp, "@s", &[__t4397, __t4399])? - }; - rt::apply_direct(interp, "@s", &[__t4396, __t4400])? - }; - rt::apply_direct(interp, "@s", &[__t4395, __t4401])? - }; - rt::apply_direct(interp, "@s", &[__t4394, __t4402])? - }; - rt::apply_direct( - interp, - "@s", - &[ - __t4393, - __t4403, - ], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4392, __t4404], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4391, __t4405], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4390, __t4406], - )? - }); - } else { - { - let __t4387 = { - let __t4370 = - Value::str("8"); - let __t4371 = - v_V1852.clone(); - rt::eq(&__t4370, &__t4371) - }; - if match rt::is_truthy( - interp, &__t4387, - ) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4372 = - Value::str("e"); - let __t4386 = { - let __t4373 = - Value::str("i"); - let __t4385 = { - let __t4374 = - Value::str( - "g", - ); - let __t4384 = { - let __t4375 = Value::str("h"); - let __t4383 = { - let __t4376 = Value::str("t"); - let __t4382 = { - let __t4377 = Value::str("y"); - let __t4381 = { let __t4378 = Value::str(" "); let __t4380 = { let __t4379 = v_V1853.clone(); rt::apply_direct(interp, "string.digit", &[__t4379])? }; rt::apply_direct(interp, "@s", &[__t4378, __t4380])? }; - rt::apply_direct(interp, "@s", &[__t4377, __t4381])? - }; - rt::apply_direct(interp, "@s", &[__t4376, __t4382])? - }; - rt::apply_direct(interp, "@s", &[__t4375, __t4383])? - }; - rt::apply_direct(interp, "@s", &[__t4374, __t4384])? - }; - rt::apply_direct( - interp, - "@s", - &[ - __t4373, - __t4385, - ], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t4372, __t4386], - )? - }); - } else { - { - let __t4369 = { - let __t4352 = - Value::str("9"); - let __t4353 = - v_V1852.clone(); - rt::eq( - &__t4352, - &__t4353, - ) - }; - if match rt::is_truthy( - interp, &__t4369, - ) { - Ok(b) => b, - Err(e) => { - break Err(e) - } - } { - break Ok({ - let __t4354 = - Value::str( - "n", - ); - let __t4368 = { - let __t4355 = Value::str("i"); - let __t4367 = { - let __t4356 = Value::str("n"); - let __t4366 = { - let __t4357 = Value::str("e"); - let __t4365 = { let __t4358 = Value::str("t"); let __t4364 = { let __t4359 = Value::str("y"); let __t4363 = { let __t4360 = Value::str(" "); let __t4362 = { let __t4361 = v_V1853.clone(); rt::apply_direct(interp, "string.digit", &[__t4361])? }; rt::apply_direct(interp, "@s", &[__t4360, __t4362])? }; rt::apply_direct(interp, "@s", &[__t4359, __t4363])? }; rt::apply_direct(interp, "@s", &[__t4358, __t4364])? }; - rt::apply_direct(interp, "@s", &[__t4357, __t4365])? - }; - rt::apply_direct(interp, "@s", &[__t4356, __t4366])? - }; - rt::apply_direct(interp, "@s", &[__t4355, __t4367])? - }; - rt::apply_direct(interp, "@s", &[__t4354, __t4368])? - }); - } else { - { - let __t4351 = - Value::bool( - true, - ); - if match rt::is_truthy(interp, &__t4351) { Ok(b) => b, Err(e) => break Err(e), } { break Ok({ let __t4350 = Value::sym(interp.intern("string.tens")); rt::apply_direct(interp, "shen.f-error", &[__t4350])? }); } else { break Err(ShenError::new("cond: no clause matched")); } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_string_x2e_tens(interp: &mut Interp) { - interp.register_native("string.tens", 2, aot_string_x2e_tens); - interp.register_aot_direct("string.tens", aot_string_x2e_tens); -} - -/// AOT-compiled from KL `(defun string.scale ...)` -pub fn aot_string_x2e_scale(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.scale: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1856 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4555 = { - let __t4552 = { - let __t4548 = v_V1856.clone(); - rt::is_cons(&__t4548) - }; - if !rt::is_truthy(interp, &__t4552)? { - Value::bool(false) - } else { - let __t4553 = { - let __t4549 = Value::nil(); - let __t4551 = { - let __t4550 = v_V1856.clone(); - rt::tl(&__t4550)? - }; - rt::eq(&__t4549, &__t4551) - }; - Value::bool(rt::is_truthy(interp, &__t4553)?) - } - }; - if match rt::is_truthy(interp, &__t4555) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4554 = v_V1856.clone(); - rt::hd(&__t4554)? - }); - } else { - { - let __t4547 = { - let __t4543 = { - let __t4539 = v_V1856.clone(); - rt::is_cons(&__t4539) - }; - if !rt::is_truthy(interp, &__t4543)? { - Value::bool(false) - } else { - let __t4544 = { - let __t4540 = Value::str(""); - let __t4542 = { - let __t4541 = v_V1856.clone(); - rt::hd(&__t4541)? - }; - rt::eq(&__t4540, &__t4542) - }; - Value::bool(rt::is_truthy(interp, &__t4544)?) - } - }; - if match rt::is_truthy(interp, &__t4547) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t4546 = { - let __t4545 = v_V1856.clone(); - rt::tl(&__t4545)? - }; - v_V1856 = __t4546; - continue; - } - } else { - { - let __t4538 = { - let __t4528 = v_V1856.clone(); - rt::is_cons(&__t4528) - }; - if match rt::is_truthy(interp, &__t4538) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4530 = { - let __t4529 = v_V1856.clone(); - rt::hd(&__t4529)? - }; - let __t4537 = { - let __t4533 = { - let __t4532 = { - let __t4531 = v_V1856.clone(); - rt::apply_direct(interp, "length", &[__t4531])? - }; - rt::apply_direct(interp, "string.units", &[__t4532])? - }; - let __t4536 = { - let __t4535 = { - let __t4534 = v_V1856.clone(); - rt::tl(&__t4534)? - }; - rt::apply_direct(interp, "string.scale", &[__t4535])? - }; - rt::apply_direct(interp, "@s", &[__t4533, __t4536])? - }; - rt::apply_direct(interp, "@s", &[__t4530, __t4537])? - }); - } else { - { - let __t4527 = Value::bool(true); - if match rt::is_truthy(interp, &__t4527) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4526 = Value::sym(interp.intern("string.scale")); - rt::apply_direct(interp, "shen.f-error", &[__t4526])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_string_x2e_scale(interp: &mut Interp) { - interp.register_native("string.scale", 1, aot_string_x2e_scale); - interp.register_aot_direct("string.scale", aot_string_x2e_scale); -} - -/// AOT-compiled from KL `(defun string.units ...)` -pub fn aot_string_x2e_units(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.units: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1860 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4569 = { - let __t4567 = Value::int(2i64); - let __t4568 = v_V1860.clone(); - rt::eq(&__t4567, &__t4568) - }; - if match rt::is_truthy(interp, &__t4569) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str(" thousand ")); - } else { - { - let __t4566 = { - let __t4564 = Value::int(3i64); - let __t4565 = v_V1860.clone(); - rt::eq(&__t4564, &__t4565) - }; - if match rt::is_truthy(interp, &__t4566) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str(" million ")); - } else { - { - let __t4563 = { - let __t4561 = Value::int(4i64); - let __t4562 = v_V1860.clone(); - rt::eq(&__t4561, &__t4562) - }; - if match rt::is_truthy(interp, &__t4563) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str(" billion ")); - } else { - { - let __t4560 = { - let __t4558 = Value::int(5i64); - let __t4559 = v_V1860.clone(); - rt::eq(&__t4558, &__t4559) - }; - if match rt::is_truthy(interp, &__t4560) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str(" trillion ")); - } else { - { - let __t4557 = Value::bool(true); - if match rt::is_truthy(interp, &__t4557) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4556 = Value::str("this number has a magnitude beyond our text representation"); - rt::apply_direct( - interp, - "simple-error", - &[__t4556], - )? - }); - } else { - break Err(ShenError::new( - "cond: no clause matched", - )); - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_string_x2e_units(interp: &mut Interp) { - interp.register_native("string.units", 1, aot_string_x2e_units); - interp.register_aot_direct("string.units", aot_string_x2e_units); -} - -/// AOT-compiled from KL `(defun string>? ...)` -pub fn aot_string_x3e__x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string>?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1866 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1867 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4596 = { - let __t4594 = Value::str(""); - let __t4595 = v_V1866.clone(); - rt::eq(&__t4594, &__t4595) - }; - if match rt::is_truthy(interp, &__t4596) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t4593 = { - let __t4591 = Value::str(""); - let __t4592 = v_V1867.clone(); - rt::eq(&__t4591, &__t4592) - }; - if match rt::is_truthy(interp, &__t4593) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t4590 = { - let __t4574 = { - let __t4572 = v_V1866.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t4572])? - }; - if !rt::is_truthy(interp, &__t4574)? { - Value::bool(false) - } else { - let __t4575 = { - let __t4573 = v_V1867.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t4573])? - }; - Value::bool(rt::is_truthy(interp, &__t4575)?) - } - }; - if match rt::is_truthy(interp, &__t4590) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1868 = { - let __t4577 = { - let __t4576 = v_V1866.clone(); - rt::apply_direct(interp, "hdstr", &[__t4576])? - }; - rt::apply_direct(interp, "string->n", &[__t4577])? - }; - { - let v_W1869 = { - let __t4579 = { - let __t4578 = v_V1867.clone(); - rt::apply_direct(interp, "hdstr", &[__t4578])? - }; - rt::apply_direct(interp, "string->n", &[__t4579])? - }; - { - let __t4582 = { - let __t4580 = v_W1868.clone(); - let __t4581 = v_W1869.clone(); - rt::gt(&__t4580, &__t4581)? - }; - if match rt::is_truthy(interp, &__t4582) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t4585 = { - let __t4583 = v_W1868.clone(); - let __t4584 = v_W1869.clone(); - rt::lt(&__t4583, &__t4584)? - }; - if match rt::is_truthy(interp, &__t4585) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t4587 = { - let __t4586 = v_V1866.clone(); - rt::apply_direct( - interp, - "tlstr", - &[__t4586], - )? - }; - let __t4589 = { - let __t4588 = v_V1867.clone(); - rt::apply_direct( - interp, - "tlstr", - &[__t4588], - )? - }; - v_V1866 = __t4587; - v_V1867 = __t4589; - continue; - } - } - } - } - } - } - } - } else { - { - let __t4571 = Value::bool(true); - if match rt::is_truthy(interp, &__t4571) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4570 = Value::sym(interp.intern("string>?")); - rt::apply_direct(interp, "shen.f-error", &[__t4570])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_string_x3e__x3f_(interp: &mut Interp) { - interp.register_native("string>?", 2, aot_string_x3e__x3f_); - interp.register_aot_direct("string>?", aot_string_x3e__x3f_); -} - -/// AOT-compiled from KL `(defun string ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t4620 = { - let __t4618 = Value::str(""); - let __t4619 = v_V1876.clone(); - rt::eq(&__t4618, &__t4619) - }; - if match rt::is_truthy(interp, &__t4620) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t4617 = { - let __t4601 = { - let __t4599 = v_V1876.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t4599])? - }; - if !rt::is_truthy(interp, &__t4601)? { - Value::bool(false) - } else { - let __t4602 = { - let __t4600 = v_V1877.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t4600])? - }; - Value::bool(rt::is_truthy(interp, &__t4602)?) - } - }; - if match rt::is_truthy(interp, &__t4617) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1878 = { - let __t4604 = { - let __t4603 = v_V1876.clone(); - rt::apply_direct(interp, "hdstr", &[__t4603])? - }; - rt::apply_direct(interp, "string->n", &[__t4604])? - }; - { - let v_W1879 = { - let __t4606 = { - let __t4605 = v_V1877.clone(); - rt::apply_direct(interp, "hdstr", &[__t4605])? - }; - rt::apply_direct(interp, "string->n", &[__t4606])? - }; - { - let __t4609 = { - let __t4607 = v_W1878.clone(); - let __t4608 = v_W1879.clone(); - rt::lt(&__t4607, &__t4608)? - }; - if match rt::is_truthy(interp, &__t4609) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t4612 = { - let __t4610 = v_W1878.clone(); - let __t4611 = v_W1879.clone(); - rt::gt(&__t4610, &__t4611)? - }; - if match rt::is_truthy(interp, &__t4612) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t4614 = { - let __t4613 = v_V1876.clone(); - rt::apply_direct( - interp, - "tlstr", - &[__t4613], - )? - }; - let __t4616 = { - let __t4615 = v_V1877.clone(); - rt::apply_direct( - interp, - "tlstr", - &[__t4615], - )? - }; - v_V1876 = __t4614; - v_V1877 = __t4616; - continue; - } - } - } - } - } - } - } - } else { - { - let __t4598 = Value::bool(true); - if match rt::is_truthy(interp, &__t4598) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4597 = Value::sym(interp.intern("string=? ...)` -pub fn aot_string_x3e__x3d__x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string>=?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1882 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1883 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4626 = { - let __t4624 = v_V1882.clone(); - let __t4625 = v_V1883.clone(); - rt::eq(&__t4624, &__t4625) - }; - if match rt::is_truthy(interp, &__t4626) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - break Ok({ - let __t4627 = v_V1882.clone(); - let __t4628 = v_V1883.clone(); - rt::apply_direct(interp, "string>?", &[__t4627, __t4628])? - }); - } - } - } -} - -fn install_string_x3e__x3d__x3f_(interp: &mut Interp) { - interp.register_native("string>=?", 2, aot_string_x3e__x3d__x3f_); - interp.register_aot_direct("string>=?", aot_string_x3e__x3d__x3f_); -} - -/// AOT-compiled from KL `(defun string<=? ...)` -pub fn aot_string_x3c__x3d__x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string<=?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1886 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1887 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4631 = { - let __t4629 = v_V1886.clone(); - let __t4630 = v_V1887.clone(); - rt::eq(&__t4629, &__t4630) - }; - if match rt::is_truthy(interp, &__t4631) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - break Ok({ - let __t4632 = v_V1886.clone(); - let __t4633 = v_V1887.clone(); - rt::apply_direct(interp, "string ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "render-file: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1898 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1899 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W1900 = { - let __t4634 = v_V1898.clone(); - rt::apply_direct(interp, "read-file-as-bytelist", &[__t4634])? - }; - { - let v_W1901 = { - let __t4635 = v_W1900.clone(); - let __t4636 = Value::nil(); - rt::apply_direct(interp, "string.bytes->strings", &[__t4635, __t4636])? - }; - { - let v_W1902 = { - let __t4638 = { - let __t4637 = Value::sym(interp.intern("string.")); - rt::apply_direct(interp, "fn", &[__t4637])? - }; - let __t4639 = v_W1901.clone(); - rt::apply_direct(interp, "compile", &[__t4638, __t4639])? - }; - { - let v_W1903 = { - let __t4640 = v_V1898.clone(); - let __t4641 = v_V1899.clone(); - rt::apply_direct(interp, "file-extension", &[__t4640, __t4641])? - }; - { - let v_W1904 = { - let __t4642 = v_W1903.clone(); - let __t4643 = v_W1902.clone(); - rt::apply_direct(interp, "write-to-file", &[__t4642, __t4643])? - }; - break Ok(v_W1903.clone()); - } - } - } - } - } - } -} - -fn install_render_x2d_file(interp: &mut Interp) { - interp.register_native("render-file", 2, aot_render_x2d_file); - interp.register_aot_direct("render-file", aot_render_x2d_file); -} - -/// AOT-compiled from KL `(defun string.bytes->strings ...)` -pub fn aot_string_x2e_bytes_x2d__x3e_strings( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.bytes->strings: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1907 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1908 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4658 = { - let __t4655 = Value::nil(); - let __t4656 = v_V1907.clone(); - rt::eq(&__t4655, &__t4656) - }; - if match rt::is_truthy(interp, &__t4658) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4657 = v_V1908.clone(); - rt::apply_direct(interp, "reverse", &[__t4657])? - }); - } else { - { - let __t4654 = { - let __t4646 = v_V1907.clone(); - rt::is_cons(&__t4646) - }; - if match rt::is_truthy(interp, &__t4654) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t4648 = { - let __t4647 = v_V1907.clone(); - rt::tl(&__t4647)? - }; - let __t4653 = { - let __t4651 = { - let __t4650 = { - let __t4649 = v_V1907.clone(); - rt::hd(&__t4649)? - }; - rt::apply_direct(interp, "n->string", &[__t4650])? - }; - let __t4652 = v_V1908.clone(); - rt::cons(&__t4651, &__t4652) - }; - v_V1907 = __t4648; - v_V1908 = __t4653; - continue; - } - } else { - { - let __t4645 = Value::bool(true); - if match rt::is_truthy(interp, &__t4645) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4644 = - Value::sym(interp.intern("string.bytes->strings")); - rt::apply_direct(interp, "shen.f-error", &[__t4644])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_string_x2e_bytes_x2d__x3e_strings(interp: &mut Interp) { - interp.register_native( - "string.bytes->strings", - 2, - aot_string_x2e_bytes_x2d__x3e_strings, - ); - interp.register_aot_direct( - "string.bytes->strings", - aot_string_x2e_bytes_x2d__x3e_strings, - ); -} - -/// AOT-compiled from KL `(defun render ...)` -pub fn aot_render(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "render: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1911 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t4660 = { - let __t4659 = Value::sym(interp.intern("string.")); - rt::apply_direct(interp, "fn", &[__t4659])? - }; - let __t4662 = { - let __t4661 = v_V1911.clone(); - rt::apply_direct(interp, "string->list", &[__t4661])? - }; - rt::apply_direct(interp, "compile", &[__t4660, __t4662])? - }); - } -} - -fn install_render(interp: &mut Interp) { - interp.register_native("render", 1, aot_render); - interp.register_aot_direct("render", aot_render); -} - -/// AOT-compiled from KL `(defun string.rendered? ...)` -pub fn aot_string_x2e_rendered_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.rendered?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1917 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4678 = { - let __t4676 = Value::str(""); - let __t4677 = v_V1917.clone(); - rt::eq(&__t4676, &__t4677) - }; - if match rt::is_truthy(interp, &__t4678) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(true)); - } else { - { - let __t4675 = { - let __t4673 = { - let __t4669 = v_V1917.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t4669])? - }; - if !rt::is_truthy(interp, &__t4673)? { - Value::bool(false) - } else { - let __t4674 = { - let __t4670 = Value::str("{"); - let __t4672 = { - let __t4671 = v_V1917.clone(); - rt::apply_direct(interp, "hdstr", &[__t4671])? - }; - rt::eq(&__t4670, &__t4672) - }; - Value::bool(rt::is_truthy(interp, &__t4674)?) - } - }; - if match rt::is_truthy(interp, &__t4675) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::bool(false)); - } else { - { - let __t4668 = { - let __t4665 = v_V1917.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t4665])? - }; - if match rt::is_truthy(interp, &__t4668) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t4667 = { - let __t4666 = v_V1917.clone(); - rt::apply_direct(interp, "tlstr", &[__t4666])? - }; - v_V1917 = __t4667; - continue; - } - } else { - { - let __t4664 = Value::bool(true); - if match rt::is_truthy(interp, &__t4664) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4663 = - Value::sym(interp.intern("string.rendered?")); - rt::apply_direct(interp, "shen.f-error", &[__t4663])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_string_x2e_rendered_x3f_(interp: &mut Interp) { - interp.register_native("string.rendered?", 1, aot_string_x2e_rendered_x3f_); - interp.register_aot_direct("string.rendered?", aot_string_x2e_rendered_x3f_); -} - -/// AOT-compiled from KL `(defun string. ...)` -pub fn aot_string_x2e__x3c_render_x3e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1924 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W1925 = { - let __t4721 = { - let __t4679 = v_V1924.clone(); - let __t4680 = Value::str("{"); - rt::apply_direct(interp, "shen.hds=?", &[__t4679, __t4680])? - }; - if rt::is_truthy(interp, &__t4721)? { - { - let v_W1926 = { - let __t4681 = v_V1924.clone(); - rt::apply_direct(interp, "tail", &[__t4681])? - }; - { - let v_W1927 = { - let __t4683 = { - let __t4682 = Value::sym(interp.intern("string.")); - rt::apply_direct(interp, "fn", &[__t4682])? - }; - let __t4684 = v_W1926.clone(); - rt::apply_value(interp, __t4683, &[__t4684])? - }; - { - let __t4720 = { - let __t4685 = v_W1927.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4685])? - }; - if rt::is_truthy(interp, &__t4720)? { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } else { - { - let v_W1928 = { - let __t4686 = v_W1927.clone(); - rt::apply_direct(interp, "shen.<-out", &[__t4686])? - }; - { - let v_W1929 = { - let __t4687 = v_W1927.clone(); - rt::apply_direct(interp, "shen.in->", &[__t4687])? - }; - { - let v_W1930 = { - let __t4689 = { - let __t4688 = Value::sym( - interp.intern("string."), - ); - rt::apply_direct(interp, "fn", &[__t4688])? - }; - let __t4690 = v_W1929.clone(); - rt::apply_value(interp, __t4689, &[__t4690])? - }; - { - let __t4719 = { - let __t4691 = v_W1930.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4691], - )? - }; - if rt::is_truthy(interp, &__t4719)? { - { - rt::apply_direct( - interp, - "shen.parse-failure", - &[], - )? - } - } else { - { - let v_W1931 = { - let __t4692 = v_W1930.clone(); - rt::apply_direct( - interp, - "shen.in->", - &[__t4692], - )? - }; - { - let v_W1932 = { - let __t4694 = { - let __t4693 = Value::sym( - interp.intern( - "string.", - ), - ); - rt::apply_direct( - interp, - "fn", - &[__t4693], - )? - }; - let __t4695 = v_W1931.clone(); - rt::apply_value( - interp, - __t4694, - &[__t4695], - )? - }; - { - let __t4718 = { - let __t4696 = - v_W1932.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4696], - )? - }; - if rt::is_truthy( - interp, &__t4718, - )? { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } else { - { - let v_W1933 = { - let __t4697 = - v_W1932.clone(); - rt::apply_direct( - interp, - "shen.<-out", - &[__t4697], - )? - }; - { - let v_W1934 = { - let __t4698 = - v_W1932 - .clone( - ); - rt::apply_direct(interp, "shen.in->", &[__t4698])? - }; - { - let __t4717 = { - let __t4699 = v_W1934.clone(); - let __t4700 = Value::str("}"); - rt::apply_direct(interp, "shen.hds=?", &[__t4699, __t4700])? - }; - if rt::is_truthy(interp, &__t4717)? { { let v_W1935 = { let __t4701 = v_W1934.clone(); rt::apply_direct(interp, "tail", &[__t4701])? }; { let v_W1936 = { let __t4703 = { let __t4702 = Value::sym(interp.intern("string.")); rt::apply_direct(interp, "fn", &[__t4702])? }; let __t4704 = v_W1935.clone(); rt::apply_value(interp, __t4703, &[__t4704])? }; { let __t4716 = { let __t4705 = v_W1936.clone(); rt::apply_direct(interp, "shen.parse-failure?", &[__t4705])? }; if rt::is_truthy(interp, &__t4716)? { { rt::apply_direct(interp, "shen.parse-failure", &[])? } } else { { let v_W1937 = { let __t4706 = v_W1936.clone(); rt::apply_direct(interp, "shen.<-out", &[__t4706])? }; { let v_W1938 = { let __t4707 = v_W1936.clone(); rt::apply_direct(interp, "shen.in->", &[__t4707])? }; { let __t4708 = v_W1938.clone(); let __t4715 = { let __t4713 = { let __t4711 = { let __t4710 = { let __t4709 = v_W1928.clone(); rt::apply_direct(interp, "intern", &[__t4709])? }; rt::apply_direct(interp, "fn", &[__t4710])? }; let __t4712 = v_W1933.clone(); rt::apply_direct(interp, "string.recapply", &[__t4711, __t4712])? }; let __t4714 = v_W1937.clone(); rt::apply_direct(interp, "cn", &[__t4713, __t4714])? }; rt::apply_direct(interp, "shen.comb", &[__t4708, __t4715])? } } } } } } } } else { { rt::apply_direct(interp, "shen.parse-failure", &[])? } } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - }; - { - let __t4723 = { - let __t4722 = v_W1925.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4722])? - }; - if match rt::is_truthy(interp, &__t4723) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1939 = { - let __t4751 = { - let __t4724 = v_V1924.clone(); - let __t4725 = Value::str("{"); - rt::apply_direct(interp, "shen.hds=?", &[__t4724, __t4725])? - }; - if rt::is_truthy(interp, &__t4751)? { - { - let v_W1940 = { - let __t4726 = v_V1924.clone(); - rt::apply_direct(interp, "tail", &[__t4726])? - }; - { - let v_W1941 = { - let __t4728 = { - let __t4727 = - Value::sym(interp.intern("string.")); - rt::apply_direct(interp, "fn", &[__t4727])? - }; - let __t4729 = v_W1940.clone(); - rt::apply_value(interp, __t4728, &[__t4729])? - }; - { - let __t4750 = { - let __t4730 = v_W1941.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4730], - )? - }; - if rt::is_truthy(interp, &__t4750)? { - { - rt::apply_direct( - interp, - "shen.parse-failure", - &[], - )? - } - } else { - { - let v_W1942 = { - let __t4731 = v_W1941.clone(); - rt::apply_direct( - interp, - "shen.<-out", - &[__t4731], - )? - }; - { - let v_W1943 = { - let __t4732 = v_W1941.clone(); - rt::apply_direct( - interp, - "shen.in->", - &[__t4732], - )? - }; - { - let __t4749 = { - let __t4733 = v_W1943.clone(); - let __t4734 = Value::str("}"); - rt::apply_direct( - interp, - "shen.hds=?", - &[__t4733, __t4734], - )? - }; - if rt::is_truthy(interp, &__t4749)? { - { - let v_W1944 = { - let __t4735 = - v_W1943.clone(); - rt::apply_direct( - interp, - "tail", - &[__t4735], - )? - }; - { - let v_W1945 = { - let __t4737 = { - let __t4736 = Value::sym(interp.intern("string.")); - rt::apply_direct( - interp, - "fn", - &[__t4736], - )? - }; - let __t4738 = - v_W1944.clone(); - rt::apply_value( - interp, - __t4737, - &[__t4738], - )? - }; - { - let __t4748 = { - let __t4739 = - v_W1945.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4739])? - }; - if rt::is_truthy( - interp, &__t4748, - )? { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } else { - { - let v_W1946 = { - let __t4740 = v_W1945.clone(); - rt::apply_direct(interp, "shen.<-out", &[__t4740])? - }; - { - let v_W1947 = { - let __t4741 = v_W1945.clone(); - rt::apply_direct(interp, "shen.in->", &[__t4741])? - }; - { - let __t4742 = v_W1947.clone(); - let __t4747 = { - let __t4745 = { let __t4744 = { let __t4743 = v_W1942.clone(); rt::apply_direct(interp, "intern", &[__t4743])? }; rt::apply_value(interp, __t4744, &[])? }; - let __t4746 = v_W1946.clone(); - rt::apply_direct(interp, "cn", &[__t4745, __t4746])? - }; - rt::apply_direct(interp, "shen.comb", &[__t4742, __t4747])? - } - } - } - } - } - } - } - } else { - { - rt::apply_direct( - interp, - "shen.parse-failure", - &[], - )? - } - } - } - } - } - } - } - } - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - }; - { - let __t4753 = { - let __t4752 = v_W1939.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4752])? - }; - if match rt::is_truthy(interp, &__t4753) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1948 = { - let v_W1949 = { - let __t4755 = { - let __t4754 = Value::sym( - interp.intern("string."), - ); - rt::apply_direct(interp, "fn", &[__t4754])? - }; - let __t4756 = v_V1924.clone(); - rt::apply_value(interp, __t4755, &[__t4756])? - }; - { - let __t4771 = { - let __t4757 = v_W1949.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4757], - )? - }; - if rt::is_truthy(interp, &__t4771)? { - { - rt::apply_direct( - interp, - "shen.parse-failure", - &[], - )? - } - } else { - { - let v_W1950 = { - let __t4758 = v_W1949.clone(); - rt::apply_direct( - interp, - "shen.<-out", - &[__t4758], - )? - }; - { - let v_W1951 = { - let __t4759 = v_W1949.clone(); - rt::apply_direct( - interp, - "shen.in->", - &[__t4759], - )? - }; - { - let v_W1952 = { - let __t4761 = { - let __t4760 = - Value::sym(interp.intern( - "string.", - )); - rt::apply_direct( - interp, - "fn", - &[__t4760], - )? - }; - let __t4762 = v_W1951.clone(); - rt::apply_value( - interp, - __t4761, - &[__t4762], - )? - }; - { - let __t4770 = { - let __t4763 = v_W1952.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4763], - )? - }; - if rt::is_truthy(interp, &__t4770)? - { - { - rt::apply_direct( - interp, - "shen.parse-failure", - &[], - )? - } - } else { - { - let v_W1953 = { - let __t4764 = - v_W1952.clone(); - rt::apply_direct( - interp, - "shen.<-out", - &[__t4764], - )? - }; - { - let v_W1954 = { - let __t4765 = - v_W1952.clone(); - rt::apply_direct( - interp, - "shen.in->", - &[__t4765], - )? - }; - { - let __t4766 = - v_W1954.clone(); - let __t4769 = { - let __t4767 = - v_W1950 - .clone( - ); - let __t4768 = - v_W1953 - .clone( - ); - rt::apply_direct(interp, "cn", &[__t4767, __t4768])? - }; - rt::apply_direct( - interp, - "shen.comb", - &[ - __t4766, - __t4769, - ], - )? - } - } - } - } - } - } - } - } - } - } - }; - { - let __t4773 = { - let __t4772 = v_W1948.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4772], - )? - }; - if match rt::is_truthy(interp, &__t4773) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1955 = { - let v_W1956 = { - let __t4774 = v_V1924.clone(); - rt::apply_direct(interp, "", &[__t4774])? - }; - { - let __t4779 = { - let __t4775 = v_W1956.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4775], - )? - }; - if rt::is_truthy(interp, &__t4779)? { - { - rt::apply_direct( - interp, - "shen.parse-failure", - &[], - )? - } - } else { - { - let v_W1957 = { - let __t4776 = v_W1956.clone(); - rt::apply_direct( - interp, - "shen.in->", - &[__t4776], - )? - }; - { - let __t4777 = v_W1957.clone(); - let __t4778 = Value::str(""); - rt::apply_direct( - interp, - "shen.comb", - &[__t4777, __t4778], - )? - } - } - } - } - }; - { - let __t4781 = { - let __t4780 = v_W1955.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4780], - )? - }; - if match rt::is_truthy(interp, &__t4781) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - rt::apply_direct( - interp, - "shen.parse-failure", - &[], - )? - }); - } else { - break Ok(v_W1955.clone()); - } - } - } - } else { - break Ok(v_W1948.clone()); - } - } - } - } else { - break Ok(v_W1939.clone()); - } - } - } - } else { - break Ok(v_W1925.clone()); - } - } - } - } -} - -fn install_string_x2e__x3c_render_x3e_(interp: &mut Interp) { - interp.register_native("string.", 1, aot_string_x2e__x3c_render_x3e_); - interp.register_aot_direct("string.", aot_string_x2e__x3c_render_x3e_); -} - -/// AOT-compiled from KL `(defun string. ...)` -pub fn aot_string_x2e__x3c_renderchar_x3e_( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1961 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W1962 = { - let __t4796 = { - let __t4782 = v_V1961.clone(); - rt::is_cons(&__t4782) - }; - if rt::is_truthy(interp, &__t4796)? { - { - let v_W1963 = { - let __t4783 = v_V1961.clone(); - rt::apply_direct(interp, "head", &[__t4783])? - }; - { - let v_W1964 = { - let __t4784 = v_V1961.clone(); - rt::apply_direct(interp, "tail", &[__t4784])? - }; - { - let __t4795 = { - let __t4791 = { - let __t4787 = { - let __t4785 = v_W1963.clone(); - let __t4786 = Value::str("}"); - rt::eq(&__t4785, &__t4786) - }; - rt::apply_direct(interp, "not", &[__t4787])? - }; - if !rt::is_truthy(interp, &__t4791)? { - Value::bool(false) - } else { - let __t4792 = { - let __t4790 = { - let __t4788 = v_W1963.clone(); - let __t4789 = Value::str("\\"); - rt::eq(&__t4788, &__t4789) - }; - rt::apply_direct(interp, "not", &[__t4790])? - }; - Value::bool(rt::is_truthy(interp, &__t4792)?) - } - }; - if rt::is_truthy(interp, &__t4795)? { - { - let __t4793 = v_W1964.clone(); - let __t4794 = v_W1963.clone(); - rt::apply_direct(interp, "shen.comb", &[__t4793, __t4794])? - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - } - } - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - }; - { - let __t4798 = { - let __t4797 = v_W1962.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4797])? - }; - if match rt::is_truthy(interp, &__t4798) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ rt::apply_direct(interp, "shen.parse-failure", &[])? }); - } else { - break Ok(v_W1962.clone()); - } - } - } - } -} - -fn install_string_x2e__x3c_renderchar_x3e_(interp: &mut Interp) { - interp.register_native( - "string.", - 1, - aot_string_x2e__x3c_renderchar_x3e_, - ); - interp.register_aot_direct("string.", aot_string_x2e__x3c_renderchar_x3e_); -} - -/// AOT-compiled from KL `(defun string.recapply ...)` -pub fn aot_string_x2e_recapply(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "string.recapply: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1966 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V1967 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t4810 = { - let __t4808 = Value::nil(); - let __t4809 = v_V1967.clone(); - rt::eq(&__t4808, &__t4809) - }; - if match rt::is_truthy(interp, &__t4810) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V1966.clone()); - } else { - { - let __t4807 = { - let __t4801 = v_V1967.clone(); - rt::is_cons(&__t4801) - }; - if match rt::is_truthy(interp, &__t4807) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t4804 = { - let __t4803 = { - let __t4802 = v_V1967.clone(); - rt::hd(&__t4802)? - }; - rt::apply_value(interp, v_V1966.clone(), &[__t4803])? - }; - let __t4806 = { - let __t4805 = v_V1967.clone(); - rt::tl(&__t4805)? - }; - v_V1966 = __t4804; - v_V1967 = __t4806; - continue; - } - } else { - { - let __t4800 = Value::bool(true); - if match rt::is_truthy(interp, &__t4800) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t4799 = Value::sym(interp.intern("string.recapply")); - rt::apply_direct(interp, "shen.f-error", &[__t4799])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_string_x2e_recapply(interp: &mut Interp) { - interp.register_native("string.recapply", 2, aot_string_x2e_recapply); - interp.register_aot_direct("string.recapply", aot_string_x2e_recapply); -} - -/// AOT-compiled from KL `(defun string. ...)` -pub fn aot_string_x2e__x3c_args_x3e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1972 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W1973 = { - let v_W1974 = { - let __t4812 = { - let __t4811 = Value::sym(interp.intern("string.")); - rt::apply_direct(interp, "fn", &[__t4811])? - }; - let __t4813 = v_V1972.clone(); - rt::apply_value(interp, __t4812, &[__t4813])? - }; - { - let __t4832 = { - let __t4814 = v_W1974.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4814])? - }; - if rt::is_truthy(interp, &__t4832)? { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } else { - { - let v_W1975 = { - let __t4815 = v_W1974.clone(); - rt::apply_direct(interp, "shen.<-out", &[__t4815])? - }; - { - let v_W1976 = { - let __t4816 = v_W1974.clone(); - rt::apply_direct(interp, "shen.in->", &[__t4816])? - }; - { - let __t4831 = { - let __t4817 = v_W1976.clone(); - let __t4818 = Value::str("\\"); - rt::apply_direct(interp, "shen.hds=?", &[__t4817, __t4818])? - }; - if rt::is_truthy(interp, &__t4831)? { - { - let v_W1977 = { - let __t4819 = v_W1976.clone(); - rt::apply_direct(interp, "tail", &[__t4819])? - }; - { - let v_W1978 = { - let __t4821 = { - let __t4820 = Value::sym( - interp.intern("string."), - ); - rt::apply_direct(interp, "fn", &[__t4820])? - }; - let __t4822 = v_W1977.clone(); - rt::apply_value(interp, __t4821, &[__t4822])? - }; - { - let __t4830 = { - let __t4823 = v_W1978.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4823], - )? - }; - if rt::is_truthy(interp, &__t4830)? { - { - rt::apply_direct( - interp, - "shen.parse-failure", - &[], - )? - } - } else { - { - let v_W1979 = { - let __t4824 = v_W1978.clone(); - rt::apply_direct( - interp, - "shen.<-out", - &[__t4824], - )? - }; - { - let v_W1980 = { - let __t4825 = v_W1978.clone(); - rt::apply_direct( - interp, - "shen.in->", - &[__t4825], - )? - }; - { - let __t4826 = v_W1980.clone(); - let __t4829 = { - let __t4827 = - v_W1975.clone(); - let __t4828 = - v_W1979.clone(); - rt::cons(&__t4827, &__t4828) - }; - rt::apply_direct( - interp, - "shen.comb", - &[__t4826, __t4829], - )? - } - } - } - } - } - } - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - } - } - } - } - } - }; - { - let __t4834 = { - let __t4833 = v_W1973.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4833])? - }; - if match rt::is_truthy(interp, &__t4834) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W1981 = { - let v_W1982 = { - let __t4836 = { - let __t4835 = Value::sym(interp.intern("string.")); - rt::apply_direct(interp, "fn", &[__t4835])? - }; - let __t4837 = v_V1972.clone(); - rt::apply_value(interp, __t4836, &[__t4837])? - }; - { - let __t4845 = { - let __t4838 = v_W1982.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4838])? - }; - if rt::is_truthy(interp, &__t4845)? { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } else { - { - let v_W1983 = { - let __t4839 = v_W1982.clone(); - rt::apply_direct(interp, "shen.<-out", &[__t4839])? - }; - { - let v_W1984 = { - let __t4840 = v_W1982.clone(); - rt::apply_direct(interp, "shen.in->", &[__t4840])? - }; - { - let __t4841 = v_W1984.clone(); - let __t4844 = { - let __t4842 = v_W1983.clone(); - let __t4843 = Value::nil(); - rt::cons(&__t4842, &__t4843) - }; - rt::apply_direct( - interp, - "shen.comb", - &[__t4841, __t4844], - )? - } - } - } - } - } - }; - { - let __t4847 = { - let __t4846 = v_W1981.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4846])? - }; - if match rt::is_truthy(interp, &__t4847) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ rt::apply_direct(interp, "shen.parse-failure", &[])? }); - } else { - break Ok(v_W1981.clone()); - } - } - } - } else { - break Ok(v_W1973.clone()); - } - } - } - } -} - -fn install_string_x2e__x3c_args_x3e_(interp: &mut Interp) { - interp.register_native("string.", 1, aot_string_x2e__x3c_args_x3e_); - interp.register_aot_direct("string.", aot_string_x2e__x3c_args_x3e_); -} - -/// AOT-compiled from KL `(defun string. ...)` -pub fn aot_string_x2e__x3c_arg_x3e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1987 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W1988 = { - let v_W1989 = { - let __t4848 = v_V1987.clone(); - rt::apply_direct(interp, "string.", &[__t4848])? - }; - { - let __t4854 = { - let __t4849 = v_W1989.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4849])? - }; - if rt::is_truthy(interp, &__t4854)? { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } else { - { - let v_W1990 = { - let __t4850 = v_W1989.clone(); - rt::apply_direct(interp, "shen.<-out", &[__t4850])? - }; - { - let v_W1991 = { - let __t4851 = v_W1989.clone(); - rt::apply_direct(interp, "shen.in->", &[__t4851])? - }; - { - let __t4852 = v_W1991.clone(); - let __t4853 = v_W1990.clone(); - rt::apply_direct(interp, "shen.comb", &[__t4852, __t4853])? - } - } - } - } - } - }; - { - let __t4856 = { - let __t4855 = v_W1988.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4855])? - }; - if match rt::is_truthy(interp, &__t4856) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ rt::apply_direct(interp, "shen.parse-failure", &[])? }); - } else { - break Ok(v_W1988.clone()); - } - } - } - } -} - -fn install_string_x2e__x3c_arg_x3e_(interp: &mut Interp) { - interp.register_native("string.", 1, aot_string_x2e__x3c_arg_x3e_); - interp.register_aot_direct("string.", aot_string_x2e__x3c_arg_x3e_); -} - -/// AOT-compiled from KL `(defun string. ...)` -pub fn aot_string_x2e__x3c_argchar_x3e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V1995 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W1996 = { - let __t4871 = { - let __t4857 = v_V1995.clone(); - rt::is_cons(&__t4857) - }; - if rt::is_truthy(interp, &__t4871)? { - { - let v_W1997 = { - let __t4858 = v_V1995.clone(); - rt::apply_direct(interp, "head", &[__t4858])? - }; - { - let v_W1998 = { - let __t4859 = v_V1995.clone(); - rt::apply_direct(interp, "tail", &[__t4859])? - }; - { - let __t4870 = { - let __t4866 = { - let __t4862 = { - let __t4860 = v_W1997.clone(); - let __t4861 = Value::str("}"); - rt::eq(&__t4860, &__t4861) - }; - rt::apply_direct(interp, "not", &[__t4862])? - }; - if !rt::is_truthy(interp, &__t4866)? { - Value::bool(false) - } else { - let __t4867 = { - let __t4865 = { - let __t4863 = v_W1997.clone(); - let __t4864 = Value::str("\\"); - rt::eq(&__t4863, &__t4864) - }; - rt::apply_direct(interp, "not", &[__t4865])? - }; - Value::bool(rt::is_truthy(interp, &__t4867)?) - } - }; - if rt::is_truthy(interp, &__t4870)? { - { - let __t4868 = v_W1998.clone(); - let __t4869 = v_W1997.clone(); - rt::apply_direct(interp, "shen.comb", &[__t4868, __t4869])? - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - } - } - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - }; - { - let __t4873 = { - let __t4872 = v_W1996.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4872])? - }; - if match rt::is_truthy(interp, &__t4873) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ rt::apply_direct(interp, "shen.parse-failure", &[])? }); - } else { - break Ok(v_W1996.clone()); - } - } - } - } -} - -fn install_string_x2e__x3c_argchar_x3e_(interp: &mut Interp) { - interp.register_native("string.", 1, aot_string_x2e__x3c_argchar_x3e_); - interp.register_aot_direct("string.", aot_string_x2e__x3c_argchar_x3e_); -} - -/// AOT-compiled from KL `(defun string. ...)` -pub fn aot_string_x2e__x3c_ws_x3e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2002 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2003 = { - let __t4881 = { - let __t4874 = v_V2002.clone(); - rt::is_cons(&__t4874) - }; - if rt::is_truthy(interp, &__t4881)? { - { - let v_W2004 = { - let __t4875 = v_V2002.clone(); - rt::apply_direct(interp, "head", &[__t4875])? - }; - { - let v_W2005 = { - let __t4876 = v_V2002.clone(); - rt::apply_direct(interp, "tail", &[__t4876])? - }; - { - let __t4880 = { - let __t4877 = v_W2004.clone(); - rt::apply_direct(interp, "whitespace?", &[__t4877])? - }; - if rt::is_truthy(interp, &__t4880)? { - { - let __t4878 = v_W2005.clone(); - let __t4879 = Value::sym(interp.intern("string.skip")); - rt::apply_direct(interp, "shen.comb", &[__t4878, __t4879])? - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - } - } - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - }; - { - let __t4883 = { - let __t4882 = v_W2003.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4882])? - }; - if match rt::is_truthy(interp, &__t4883) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ rt::apply_direct(interp, "shen.parse-failure", &[])? }); - } else { - break Ok(v_W2003.clone()); - } - } - } - } -} - -fn install_string_x2e__x3c_ws_x3e_(interp: &mut Interp) { - interp.register_native("string.", 1, aot_string_x2e__x3c_ws_x3e_); - interp.register_aot_direct("string.", aot_string_x2e__x3c_ws_x3e_); -} - -/// AOT-compiled from KL `(defun string. ...)` -pub fn aot_string_x2e__x3c_fn_x3e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2008 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2009 = { - let v_W2010 = { - let __t4885 = { - let __t4884 = Value::sym(interp.intern("string.")); - rt::apply_direct(interp, "fn", &[__t4884])? - }; - let __t4886 = v_V2008.clone(); - rt::apply_value(interp, __t4885, &[__t4886])? - }; - { - let __t4901 = { - let __t4887 = v_W2010.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4887])? - }; - if rt::is_truthy(interp, &__t4901)? { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } else { - { - let v_W2011 = { - let __t4888 = v_W2010.clone(); - rt::apply_direct(interp, "shen.<-out", &[__t4888])? - }; - { - let v_W2012 = { - let __t4889 = v_W2010.clone(); - rt::apply_direct(interp, "shen.in->", &[__t4889])? - }; - { - let v_W2013 = { - let __t4891 = { - let __t4890 = Value::sym(interp.intern("string.")); - rt::apply_direct(interp, "fn", &[__t4890])? - }; - let __t4892 = v_W2012.clone(); - rt::apply_value(interp, __t4891, &[__t4892])? - }; - { - let __t4900 = { - let __t4893 = v_W2013.clone(); - rt::apply_direct( - interp, - "shen.parse-failure?", - &[__t4893], - )? - }; - if rt::is_truthy(interp, &__t4900)? { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } else { - { - let v_W2014 = { - let __t4894 = v_W2013.clone(); - rt::apply_direct( - interp, - "shen.<-out", - &[__t4894], - )? - }; - { - let v_W2015 = { - let __t4895 = v_W2013.clone(); - rt::apply_direct( - interp, - "shen.in->", - &[__t4895], - )? - }; - { - let __t4896 = v_W2015.clone(); - let __t4899 = { - let __t4897 = v_W2011.clone(); - let __t4898 = v_W2014.clone(); - rt::apply_direct( - interp, - "cn", - &[__t4897, __t4898], - )? - }; - rt::apply_direct( - interp, - "shen.comb", - &[__t4896, __t4899], - )? - } - } - } - } - } - } - } - } - } - } - }; - { - let __t4903 = { - let __t4902 = v_W2009.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4902])? - }; - if match rt::is_truthy(interp, &__t4903) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W2016 = { - let v_W2017 = { - let __t4904 = v_V2008.clone(); - rt::apply_direct(interp, "", &[__t4904])? - }; - { - let __t4909 = { - let __t4905 = v_W2017.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4905])? - }; - if rt::is_truthy(interp, &__t4909)? { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } else { - { - let v_W2018 = { - let __t4906 = v_W2017.clone(); - rt::apply_direct(interp, "shen.in->", &[__t4906])? - }; - { - let __t4907 = v_W2018.clone(); - let __t4908 = Value::str(""); - rt::apply_direct( - interp, - "shen.comb", - &[__t4907, __t4908], - )? - } - } - } - } - }; - { - let __t4911 = { - let __t4910 = v_W2016.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4910])? - }; - if match rt::is_truthy(interp, &__t4911) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ rt::apply_direct(interp, "shen.parse-failure", &[])? }); - } else { - break Ok(v_W2016.clone()); - } - } - } - } else { - break Ok(v_W2009.clone()); - } - } - } - } -} - -fn install_string_x2e__x3c_fn_x3e_(interp: &mut Interp) { - interp.register_native("string.", 1, aot_string_x2e__x3c_fn_x3e_); - interp.register_aot_direct("string.", aot_string_x2e__x3c_fn_x3e_); -} - -/// AOT-compiled from KL `(defun string. ...)` -pub fn aot_string_x2e__x3c_fnchar_x3e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "string.: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2022 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2023 = { - let __t4930 = { - let __t4912 = v_V2022.clone(); - rt::is_cons(&__t4912) - }; - if rt::is_truthy(interp, &__t4930)? { - { - let v_W2024 = { - let __t4913 = v_V2022.clone(); - rt::apply_direct(interp, "head", &[__t4913])? - }; - { - let v_W2025 = { - let __t4914 = v_V2022.clone(); - rt::apply_direct(interp, "tail", &[__t4914])? - }; - { - let __t4929 = { - let __t4925 = { - let __t4917 = { - let __t4915 = v_W2024.clone(); - let __t4916 = Value::str("}"); - rt::eq(&__t4915, &__t4916) - }; - rt::apply_direct(interp, "not", &[__t4917])? - }; - if !rt::is_truthy(interp, &__t4925)? { - Value::bool(false) - } else { - let __t4926 = { - let __t4923 = { - let __t4920 = { - let __t4918 = v_W2024.clone(); - let __t4919 = Value::str("\\"); - rt::eq(&__t4918, &__t4919) - }; - rt::apply_direct(interp, "not", &[__t4920])? - }; - if !rt::is_truthy(interp, &__t4923)? { - Value::bool(false) - } else { - let __t4924 = { - let __t4922 = { - let __t4921 = v_W2024.clone(); - rt::apply_direct( - interp, - "whitespace?", - &[__t4921], - )? - }; - rt::apply_direct(interp, "not", &[__t4922])? - }; - Value::bool(rt::is_truthy(interp, &__t4924)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t4926)?) - } - }; - if rt::is_truthy(interp, &__t4929)? { - { - let __t4927 = v_W2025.clone(); - let __t4928 = v_W2024.clone(); - rt::apply_direct(interp, "shen.comb", &[__t4927, __t4928])? - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - } - } - } - } else { - { - rt::apply_direct(interp, "shen.parse-failure", &[])? - } - } - }; - { - let __t4932 = { - let __t4931 = v_W2023.clone(); - rt::apply_direct(interp, "shen.parse-failure?", &[__t4931])? - }; - if match rt::is_truthy(interp, &__t4932) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ rt::apply_direct(interp, "shen.parse-failure", &[])? }); - } else { - break Ok(v_W2023.clone()); - } - } - } - } -} - -fn install_string_x2e__x3c_fnchar_x3e_(interp: &mut Interp) { - interp.register_native("string.", 1, aot_string_x2e__x3c_fnchar_x3e_); - interp.register_aot_direct("string.", aot_string_x2e__x3c_fnchar_x3e_); -} - -/// AOT-compiled from KL `(defun vector.vector-macros ...)` -pub fn aot_vector_x2e_vector_x2d_macros(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "vector.vector-macros: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2049 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t5309 = { - let __t5300 = { - let __t5280 = v_V2049.clone(); - rt::is_cons(&__t5280) - }; - if !rt::is_truthy(interp, &__t5300)? { - Value::bool(false) - } else { - let __t5301 = { - let __t5298 = { - let __t5281 = Value::sym(interp.intern(":=")); - let __t5283 = { - let __t5282 = v_V2049.clone(); - rt::hd(&__t5282)? - }; - rt::eq(&__t5281, &__t5283) - }; - if !rt::is_truthy(interp, &__t5298)? { - Value::bool(false) - } else { - let __t5299 = { - let __t5296 = { - let __t5285 = { - let __t5284 = v_V2049.clone(); - rt::tl(&__t5284)? - }; - rt::is_cons(&__t5285) - }; - if !rt::is_truthy(interp, &__t5296)? { - Value::bool(false) - } else { - let __t5297 = { - let __t5294 = { - let __t5288 = { - let __t5287 = { - let __t5286 = v_V2049.clone(); - rt::tl(&__t5286)? - }; - rt::tl(&__t5287)? - }; - rt::is_cons(&__t5288) - }; - if !rt::is_truthy(interp, &__t5294)? { - Value::bool(false) - } else { - let __t5295 = { - let __t5289 = Value::nil(); - let __t5293 = { - let __t5292 = { - let __t5291 = { - let __t5290 = v_V2049.clone(); - rt::tl(&__t5290)? - }; - rt::tl(&__t5291)? - }; - rt::tl(&__t5292)? - }; - rt::eq(&__t5289, &__t5293) - }; - Value::bool(rt::is_truthy(interp, &__t5295)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5297)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5299)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5301)?) - } - }; - if match rt::is_truthy(interp, &__t5309) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5304 = { - let __t5303 = { - let __t5302 = v_V2049.clone(); - rt::tl(&__t5302)? - }; - rt::hd(&__t5303)? - }; - let __t5308 = { - let __t5307 = { - let __t5306 = { - let __t5305 = v_V2049.clone(); - rt::tl(&__t5305)? - }; - rt::tl(&__t5306)? - }; - rt::hd(&__t5307)? - }; - rt::apply_direct(interp, "vector.<-array", &[__t5304, __t5308])? - }); - } else { - { - let __t5279 = { - let __t5248 = { - let __t5220 = v_V2049.clone(); - rt::is_cons(&__t5220) - }; - if !rt::is_truthy(interp, &__t5248)? { - Value::bool(false) - } else { - let __t5249 = { - let __t5246 = { - let __t5222 = { - let __t5221 = v_V2049.clone(); - rt::tl(&__t5221)? - }; - rt::is_cons(&__t5222) - }; - if !rt::is_truthy(interp, &__t5246)? { - Value::bool(false) - } else { - let __t5247 = { - let __t5244 = { - let __t5225 = { - let __t5224 = { - let __t5223 = v_V2049.clone(); - rt::tl(&__t5223)? - }; - rt::tl(&__t5224)? - }; - rt::is_cons(&__t5225) - }; - if !rt::is_truthy(interp, &__t5244)? { - Value::bool(false) - } else { - let __t5245 = { - let __t5242 = { - let __t5226 = Value::sym(interp.intern(":=")); - let __t5230 = { - let __t5229 = { - let __t5228 = { - let __t5227 = v_V2049.clone(); - rt::tl(&__t5227)? - }; - rt::tl(&__t5228)? - }; - rt::hd(&__t5229)? - }; - rt::eq(&__t5226, &__t5230) - }; - if !rt::is_truthy(interp, &__t5242)? { - Value::bool(false) - } else { - let __t5243 = { - let __t5240 = { - let __t5234 = { - let __t5233 = { - let __t5232 = { - let __t5231 = - v_V2049.clone(); - rt::tl(&__t5231)? - }; - rt::tl(&__t5232)? - }; - rt::tl(&__t5233)? - }; - rt::is_cons(&__t5234) - }; - if !rt::is_truthy(interp, &__t5240)? { - Value::bool(false) - } else { - let __t5241 = { - let __t5239 = { - let __t5238 = { - let __t5237 = { - let __t5236 = { - let __t5235 = - v_V2049.clone(); - rt::tl(&__t5235)? - }; - rt::tl(&__t5236)? - }; - rt::tl(&__t5237)? - }; - rt::tl(&__t5238)? - }; - rt::is_cons(&__t5239) - }; - Value::bool(rt::is_truthy( - interp, &__t5241, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5243)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5245)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5247)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5249)?) - } - }; - if match rt::is_truthy(interp, &__t5279) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5251 = { - let __t5250 = v_V2049.clone(); - rt::hd(&__t5250)? - }; - let __t5254 = { - let __t5253 = { - let __t5252 = v_V2049.clone(); - rt::tl(&__t5252)? - }; - rt::hd(&__t5253)? - }; - let __t5272 = { - let __t5256 = { - let __t5255 = v_V2049.clone(); - rt::hd(&__t5255)? - }; - let __t5259 = { - let __t5258 = { - let __t5257 = v_V2049.clone(); - rt::tl(&__t5257)? - }; - rt::hd(&__t5258)? - }; - let __t5271 = { - let __t5264 = { - let __t5263 = { - let __t5262 = { - let __t5261 = { - let __t5260 = v_V2049.clone(); - rt::tl(&__t5260)? - }; - rt::tl(&__t5261)? - }; - rt::tl(&__t5262)? - }; - rt::hd(&__t5263)? - }; - let __t5270 = { - let __t5269 = { - let __t5268 = { - let __t5267 = { - let __t5266 = { - let __t5265 = v_V2049.clone(); - rt::tl(&__t5265)? - }; - rt::tl(&__t5266)? - }; - rt::tl(&__t5267)? - }; - rt::tl(&__t5268)? - }; - rt::hd(&__t5269)? - }; - rt::apply_direct(interp, "vector.<-array", &[__t5264, __t5270])? - }; - rt::apply_direct( - interp, - "vector.array->", - &[__t5256, __t5259, __t5271], - )? - }; - let __t5278 = { - let __t5277 = { - let __t5276 = { - let __t5275 = { - let __t5274 = { - let __t5273 = v_V2049.clone(); - rt::tl(&__t5273)? - }; - rt::tl(&__t5274)? - }; - rt::tl(&__t5275)? - }; - rt::tl(&__t5276)? - }; - rt::tl(&__t5277)? - }; - rt::apply_direct( - interp, - "vector.key", - &[__t5251, __t5254, __t5272, __t5278], - )? - }); - } else { - { - let __t5219 = { - let __t5196 = { - let __t5175 = v_V2049.clone(); - rt::is_cons(&__t5175) - }; - if !rt::is_truthy(interp, &__t5196)? { - Value::bool(false) - } else { - let __t5197 = { - let __t5194 = { - let __t5177 = { - let __t5176 = v_V2049.clone(); - rt::tl(&__t5176)? - }; - rt::is_cons(&__t5177) - }; - if !rt::is_truthy(interp, &__t5194)? { - Value::bool(false) - } else { - let __t5195 = { - let __t5192 = { - let __t5180 = { - let __t5179 = { - let __t5178 = v_V2049.clone(); - rt::tl(&__t5178)? - }; - rt::tl(&__t5179)? - }; - rt::is_cons(&__t5180) - }; - if !rt::is_truthy(interp, &__t5192)? { - Value::bool(false) - } else { - let __t5193 = { - let __t5190 = { - let __t5181 = - Value::sym(interp.intern(":=")); - let __t5185 = { - let __t5184 = { - let __t5183 = { - let __t5182 = - v_V2049.clone(); - rt::tl(&__t5182)? - }; - rt::tl(&__t5183)? - }; - rt::hd(&__t5184)? - }; - rt::eq(&__t5181, &__t5185) - }; - if !rt::is_truthy(interp, &__t5190)? { - Value::bool(false) - } else { - let __t5191 = { - let __t5189 = { - let __t5188 = { - let __t5187 = { - let __t5186 = - v_V2049.clone(); - rt::tl(&__t5186)? - }; - rt::tl(&__t5187)? - }; - rt::tl(&__t5188)? - }; - rt::is_cons(&__t5189) - }; - Value::bool(rt::is_truthy( - interp, &__t5191, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5193)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5195)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5197)?) - } - }; - if match rt::is_truthy(interp, &__t5219) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5199 = { - let __t5198 = v_V2049.clone(); - rt::hd(&__t5198)? - }; - let __t5202 = { - let __t5201 = { - let __t5200 = v_V2049.clone(); - rt::tl(&__t5200)? - }; - rt::hd(&__t5201)? - }; - let __t5213 = { - let __t5204 = { - let __t5203 = v_V2049.clone(); - rt::hd(&__t5203)? - }; - let __t5207 = { - let __t5206 = { - let __t5205 = v_V2049.clone(); - rt::tl(&__t5205)? - }; - rt::hd(&__t5206)? - }; - let __t5212 = { - let __t5211 = { - let __t5210 = { - let __t5209 = { - let __t5208 = v_V2049.clone(); - rt::tl(&__t5208)? - }; - rt::tl(&__t5209)? - }; - rt::tl(&__t5210)? - }; - rt::hd(&__t5211)? - }; - rt::apply_direct( - interp, - "vector.array->", - &[__t5204, __t5207, __t5212], - )? - }; - let __t5218 = { - let __t5217 = { - let __t5216 = { - let __t5215 = { - let __t5214 = v_V2049.clone(); - rt::tl(&__t5214)? - }; - rt::tl(&__t5215)? - }; - rt::tl(&__t5216)? - }; - rt::tl(&__t5217)? - }; - rt::apply_direct( - interp, - "vector.key", - &[__t5199, __t5202, __t5213, __t5218], - )? - }); - } else { - { - let __t5174 = { - let __t5160 = { - let __t5133 = v_V2049.clone(); - rt::is_cons(&__t5133) - }; - if !rt::is_truthy(interp, &__t5160)? { - Value::bool(false) - } else { - let __t5161 = { - let __t5158 = { - let __t5134 = - Value::sym(interp.intern("vector.array->")); - let __t5136 = { - let __t5135 = v_V2049.clone(); - rt::hd(&__t5135)? - }; - rt::eq(&__t5134, &__t5136) - }; - if !rt::is_truthy(interp, &__t5158)? { - Value::bool(false) - } else { - let __t5159 = { - let __t5156 = { - let __t5138 = { - let __t5137 = v_V2049.clone(); - rt::tl(&__t5137)? - }; - rt::is_cons(&__t5138) - }; - if !rt::is_truthy(interp, &__t5156)? { - Value::bool(false) - } else { - let __t5157 = { - let __t5154 = { - let __t5141 = { - let __t5140 = { - let __t5139 = - v_V2049.clone(); - rt::tl(&__t5139)? - }; - rt::tl(&__t5140)? - }; - rt::is_cons(&__t5141) - }; - if !rt::is_truthy(interp, &__t5154)? - { - Value::bool(false) - } else { - let __t5155 = { - let __t5152 = { - let __t5145 = { - let __t5144 = { - let __t5143 = { - let __t5142 = v_V2049.clone(); - rt::tl(&__t5142)? - }; - rt::tl( - &__t5143, - )? - }; - rt::tl(&__t5144)? - }; - rt::is_cons(&__t5145) - }; - if !rt::is_truthy( - interp, &__t5152, - )? { - Value::bool(false) - } else { - let __t5153 = { - let __t5146 = - Value::nil(); - let __t5151 = { - let __t5150 = { - let __t5149 = { - let __t5148 = { - let __t5147 = v_V2049.clone(); - rt::tl(&__t5147)? - }; - rt::tl(&__t5148)? - }; - rt::tl(&__t5149)? - }; - rt::tl( - &__t5150, - )? - }; - rt::eq( - &__t5146, - &__t5151, - ) - }; - Value::bool( - rt::is_truthy( - interp, - &__t5153, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t5155, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t5157, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5159)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5161)?) - } - }; - if match rt::is_truthy(interp, &__t5174) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5164 = { - let __t5163 = { - let __t5162 = v_V2049.clone(); - rt::tl(&__t5162)? - }; - rt::hd(&__t5163)? - }; - let __t5168 = { - let __t5167 = { - let __t5166 = { - let __t5165 = v_V2049.clone(); - rt::tl(&__t5165)? - }; - rt::tl(&__t5166)? - }; - rt::hd(&__t5167)? - }; - let __t5173 = { - let __t5172 = { - let __t5171 = { - let __t5170 = { - let __t5169 = v_V2049.clone(); - rt::tl(&__t5169)? - }; - rt::tl(&__t5170)? - }; - rt::tl(&__t5171)? - }; - rt::hd(&__t5172)? - }; - rt::apply_direct( - interp, - "vector.array->", - &[__t5164, __t5168, __t5173], - )? - }); - } else { - { - let __t5132 = { - let __t5127 = { - let __t5113 = v_V2049.clone(); - rt::is_cons(&__t5113) - }; - if !rt::is_truthy(interp, &__t5127)? { - Value::bool(false) - } else { - let __t5128 = { - let __t5125 = { - let __t5114 = - Value::sym(interp.intern("array")); - let __t5116 = { - let __t5115 = v_V2049.clone(); - rt::hd(&__t5115)? - }; - rt::eq(&__t5114, &__t5116) - }; - if !rt::is_truthy(interp, &__t5125)? { - Value::bool(false) - } else { - let __t5126 = { - let __t5123 = { - let __t5118 = { - let __t5117 = - v_V2049.clone(); - rt::tl(&__t5117)? - }; - rt::is_cons(&__t5118) - }; - if !rt::is_truthy(interp, &__t5123)? - { - Value::bool(false) - } else { - let __t5124 = { - let __t5119 = Value::nil(); - let __t5122 = { - let __t5121 = { - let __t5120 = - v_V2049.clone(); - rt::tl(&__t5120)? - }; - rt::tl(&__t5121)? - }; - rt::eq(&__t5119, &__t5122) - }; - Value::bool(rt::is_truthy( - interp, &__t5124, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t5126, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5128)?) - } - }; - if match rt::is_truthy(interp, &__t5132) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5131 = { - let __t5130 = { - let __t5129 = v_V2049.clone(); - rt::tl(&__t5129)? - }; - rt::hd(&__t5130)? - }; - rt::apply_direct( - interp, - "vector.build-array", - &[__t5131], - )? - }); - } else { - { - let __t5112 = { - let __t5103 = { - let __t5044 = v_V2049.clone(); - rt::is_cons(&__t5044) - }; - if !rt::is_truthy(interp, &__t5103)? { - Value::bool(false) - } else { - let __t5104 = { - let __t5101 = { - let __t5045 = Value::sym( - interp.intern("populate"), - ); - let __t5047 = { - let __t5046 = - v_V2049.clone(); - rt::hd(&__t5046)? - }; - rt::eq(&__t5045, &__t5047) - }; - if !rt::is_truthy(interp, &__t5101)? - { - Value::bool(false) - } else { - let __t5102 = { - let __t5099 = { - let __t5049 = { - let __t5048 = - v_V2049.clone(); - rt::tl(&__t5048)? - }; - rt::is_cons(&__t5049) - }; - if !rt::is_truthy( - interp, &__t5099, - )? { - Value::bool(false) - } else { - let __t5100 = { - let __t5097 = { - let __t5052 = { - let __t5051 = { - let __t5050 = v_V2049.clone(); - rt::tl(&__t5050)? - }; - rt::tl(&__t5051)? - }; - rt::is_cons( - &__t5052, - ) - }; - if !rt::is_truthy( - interp, - &__t5097, - )? { - Value::bool( - false, - ) - } else { - let __t5098 = { - let __t5095 = { - let __t5056 = { - let __t5055 = { let __t5054 = { let __t5053 = v_V2049.clone(); rt::tl(&__t5053)? }; rt::tl(&__t5054)? }; - rt::hd(&__t5055)? - }; - rt::is_cons(&__t5056) - }; - if !rt::is_truthy(interp, &__t5095)? { Value::bool(false) } else { let __t5096 = { let __t5093 = { let __t5057 = Value::sym(interp.intern("cons")); let __t5062 = { let __t5061 = { let __t5060 = { let __t5059 = { let __t5058 = v_V2049.clone(); rt::tl(&__t5058)? }; rt::tl(&__t5059)? }; rt::hd(&__t5060)? }; rt::hd(&__t5061)? }; rt::eq(&__t5057, &__t5062) }; if !rt::is_truthy(interp, &__t5093)? { Value::bool(false) } else { let __t5094 = { let __t5091 = { let __t5067 = { let __t5066 = { let __t5065 = { let __t5064 = { let __t5063 = v_V2049.clone(); rt::tl(&__t5063)? }; rt::tl(&__t5064)? }; rt::hd(&__t5065)? }; rt::tl(&__t5066)? }; rt::is_cons(&__t5067) }; if !rt::is_truthy(interp, &__t5091)? { Value::bool(false) } else { let __t5092 = { let __t5089 = { let __t5073 = { let __t5072 = { let __t5071 = { let __t5070 = { let __t5069 = { let __t5068 = v_V2049.clone(); rt::tl(&__t5068)? }; rt::tl(&__t5069)? }; rt::hd(&__t5070)? }; rt::tl(&__t5071)? }; rt::tl(&__t5072)? }; rt::is_cons(&__t5073) }; if !rt::is_truthy(interp, &__t5089)? { Value::bool(false) } else { let __t5090 = { let __t5087 = { let __t5074 = Value::nil(); let __t5081 = { let __t5080 = { let __t5079 = { let __t5078 = { let __t5077 = { let __t5076 = { let __t5075 = v_V2049.clone(); rt::tl(&__t5075)? }; rt::tl(&__t5076)? }; rt::hd(&__t5077)? }; rt::tl(&__t5078)? }; rt::tl(&__t5079)? }; rt::tl(&__t5080)? }; rt::eq(&__t5074, &__t5081) }; if !rt::is_truthy(interp, &__t5087)? { Value::bool(false) } else { let __t5088 = { let __t5082 = Value::nil(); let __t5086 = { let __t5085 = { let __t5084 = { let __t5083 = v_V2049.clone(); rt::tl(&__t5083)? }; rt::tl(&__t5084)? }; rt::tl(&__t5085)? }; rt::eq(&__t5082, &__t5086) }; Value::bool(rt::is_truthy(interp, &__t5088)?) } }; Value::bool(rt::is_truthy(interp, &__t5090)?) } }; Value::bool(rt::is_truthy(interp, &__t5092)?) } }; Value::bool(rt::is_truthy(interp, &__t5094)?) } }; Value::bool(rt::is_truthy(interp, &__t5096)?) } - }; - Value::bool(rt::is_truthy(interp, &__t5098)?) - } - }; - Value::bool( - rt::is_truthy( - interp, - &__t5100, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t5102, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t5104, - )?) - } - }; - if match rt::is_truthy(interp, &__t5112) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5107 = { - let __t5106 = { - let __t5105 = v_V2049.clone(); - rt::tl(&__t5105)? - }; - rt::hd(&__t5106)? - }; - let __t5111 = { - let __t5110 = { - let __t5109 = { - let __t5108 = - v_V2049.clone(); - rt::tl(&__t5108)? - }; - rt::tl(&__t5109)? - }; - rt::hd(&__t5110)? - }; - rt::apply_direct( - interp, - "vector.unfold-populate", - &[__t5107, __t5111], - )? - }); - } else { - { - let __t5043 = { - let __t5033 = { - let __t5019 = v_V2049.clone(); - rt::is_cons(&__t5019) - }; - if !rt::is_truthy(interp, &__t5033)? - { - Value::bool(false) - } else { - let __t5034 = { - let __t5031 = { - let __t5020 = Value::sym(interp.intern("vector->list")); - let __t5022 = { - let __t5021 = - v_V2049.clone(); - rt::hd(&__t5021)? - }; - rt::eq( - &__t5020, &__t5022, - ) - }; - if !rt::is_truthy( - interp, &__t5031, - )? { - Value::bool(false) - } else { - let __t5032 = { - let __t5029 = { - let __t5024 = { - let __t5023 = v_V2049.clone(); - rt::tl(&__t5023)? - }; - rt::is_cons( - &__t5024, - ) - }; - if !rt::is_truthy( - interp, - &__t5029, - )? { - Value::bool( - false, - ) - } else { - let __t5030 = { - let __t5025 = Value::nil(); - let __t5028 = { - let __t5027 = { - let __t5026 = v_V2049.clone(); - rt::tl(&__t5026)? - }; - rt::tl(&__t5027)? - }; - rt::eq(&__t5025, &__t5028) - }; - Value::bool(rt::is_truthy(interp, &__t5030)?) - } - }; - Value::bool( - rt::is_truthy( - interp, - &__t5032, - )?, - ) - } - }; - Value::bool(rt::is_truthy( - interp, &__t5034, - )?) - } - }; - if match rt::is_truthy(interp, &__t5043) - { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5035 = Value::sym( - interp - .intern("vector->list"), - ); - let __t5042 = { - let __t5038 = { - let __t5037 = { - let __t5036 = - v_V2049.clone(); - rt::tl(&__t5036)? - }; - rt::hd(&__t5037)? - }; - let __t5041 = { - let __t5039 = - Value::nil(); - let __t5040 = - Value::nil(); - rt::cons( - &__t5039, &__t5040, - ) - }; - rt::cons(&__t5038, &__t5041) - }; - rt::cons(&__t5035, &__t5042) - }); - } else { - { - let __t5018 = { - let __t5003 = { - let __t4983 = - v_V2049.clone(); - rt::is_cons(&__t4983) - }; - if !rt::is_truthy( - interp, &__t5003, - )? { - Value::bool(false) - } else { - let __t5004 = { - let __t5001 = { - let __t4984 = Value::sym(interp.intern("v-op1")); - let __t4986 = { - let __t4985 = v_V2049.clone(); - rt::hd(&__t4985)? - }; - rt::eq( - &__t4984, - &__t4986, - ) - }; - if !rt::is_truthy( - interp, - &__t5001, - )? { - Value::bool( - false, - ) - } else { - let __t5002 = { - let __t4999 = { - let __t4988 = { - let __t4987 = v_V2049.clone(); - rt::tl(&__t4987)? - }; - rt::is_cons(&__t4988) - }; - if !rt::is_truthy(interp, &__t4999)? { Value::bool(false) } else { let __t5000 = { let __t4997 = { let __t4991 = { let __t4990 = { let __t4989 = v_V2049.clone(); rt::tl(&__t4989)? }; rt::tl(&__t4990)? }; rt::is_cons(&__t4991) }; if !rt::is_truthy(interp, &__t4997)? { Value::bool(false) } else { let __t4998 = { let __t4992 = Value::nil(); let __t4996 = { let __t4995 = { let __t4994 = { let __t4993 = v_V2049.clone(); rt::tl(&__t4993)? }; rt::tl(&__t4994)? }; rt::tl(&__t4995)? }; rt::eq(&__t4992, &__t4996) }; Value::bool(rt::is_truthy(interp, &__t4998)?) } }; Value::bool(rt::is_truthy(interp, &__t5000)?) } - }; - Value::bool(rt::is_truthy(interp, &__t5002)?) - } - }; - Value::bool( - rt::is_truthy( - interp, - &__t5004, - )?, - ) - } - }; - if match rt::is_truthy( - interp, &__t5018, - ) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5005 = - Value::sym( - interp.intern( - "v-op1", - ), - ); - let __t5017 = { - let __t5008 = { - let __t5007 = { - let __t5006 = v_V2049.clone(); - rt::tl(&__t5006)? - }; - rt::hd( - &__t5007, - )? - }; - let __t5016 = { - let __t5012 = { - let __t5011 = { - let __t5010 = { - let __t5009 = v_V2049.clone(); - rt::tl(&__t5009)? - }; - rt::tl(&__t5010)? - }; - rt::hd(&__t5011)? - }; - let __t5015 = { - let __t5013 = Value::nil(); - let __t5014 = Value::nil(); - rt::cons(&__t5013, &__t5014) - }; - rt::cons( - &__t5012, - &__t5015, - ) - }; - rt::cons( - &__t5008, - &__t5016, - ) - }; - rt::cons( - &__t5005, &__t5017, - ) - }); - } else { - { - let __t4982 = { - let __t4961 = { - let __t4934 = - v_V2049 - .clone( - ); - rt::is_cons( - &__t4934, - ) - }; - if !rt::is_truthy( - interp, - &__t4961, - )? { - Value::bool( - false, - ) - } else { - let __t4962 = { - let __t4959 = { - let __t4935 = Value::sym(interp.intern("v-op2")); - let __t4937 = { - let __t4936 = v_V2049.clone(); - rt::hd(&__t4936)? - }; - rt::eq(&__t4935, &__t4937) - }; - if !rt::is_truthy(interp, &__t4959)? { Value::bool(false) } else { let __t4960 = { let __t4957 = { let __t4939 = { let __t4938 = v_V2049.clone(); rt::tl(&__t4938)? }; rt::is_cons(&__t4939) }; if !rt::is_truthy(interp, &__t4957)? { Value::bool(false) } else { let __t4958 = { let __t4955 = { let __t4942 = { let __t4941 = { let __t4940 = v_V2049.clone(); rt::tl(&__t4940)? }; rt::tl(&__t4941)? }; rt::is_cons(&__t4942) }; if !rt::is_truthy(interp, &__t4955)? { Value::bool(false) } else { let __t4956 = { let __t4953 = { let __t4946 = { let __t4945 = { let __t4944 = { let __t4943 = v_V2049.clone(); rt::tl(&__t4943)? }; rt::tl(&__t4944)? }; rt::tl(&__t4945)? }; rt::is_cons(&__t4946) }; if !rt::is_truthy(interp, &__t4953)? { Value::bool(false) } else { let __t4954 = { let __t4947 = Value::nil(); let __t4952 = { let __t4951 = { let __t4950 = { let __t4949 = { let __t4948 = v_V2049.clone(); rt::tl(&__t4948)? }; rt::tl(&__t4949)? }; rt::tl(&__t4950)? }; rt::tl(&__t4951)? }; rt::eq(&__t4947, &__t4952) }; Value::bool(rt::is_truthy(interp, &__t4954)?) } }; Value::bool(rt::is_truthy(interp, &__t4956)?) } }; Value::bool(rt::is_truthy(interp, &__t4958)?) } }; Value::bool(rt::is_truthy(interp, &__t4960)?) } - }; - Value::bool(rt::is_truthy(interp, &__t4962)?) - } - }; - if match rt::is_truthy( - interp, &__t4982, - ) { - Ok(b) => b, - Err(e) => { - break Err(e) - } - } { - break Ok({ - let __t4963 = Value::sym(interp.intern("v-op2")); - let __t4981 = { - let __t4966 = { - let __t4965 = { - let __t4964 = v_V2049.clone(); - rt::tl(&__t4964)? - }; - rt::hd(&__t4965)? - }; - let __t4980 = { - let __t4970 = { - let __t4969 = { let __t4968 = { let __t4967 = v_V2049.clone(); rt::tl(&__t4967)? }; rt::tl(&__t4968)? }; - rt::hd(&__t4969)? - }; - let __t4979 = { - let __t4975 = { let __t4974 = { let __t4973 = { let __t4972 = { let __t4971 = v_V2049.clone(); rt::tl(&__t4971)? }; rt::tl(&__t4972)? }; rt::tl(&__t4973)? }; rt::hd(&__t4974)? }; - let __t4978 = { let __t4976 = Value::nil(); let __t4977 = Value::nil(); rt::cons(&__t4976, &__t4977) }; - rt::cons(&__t4975, &__t4978) - }; - rt::cons(&__t4970, &__t4979) - }; - rt::cons(&__t4966, &__t4980) - }; - rt::cons( - &__t4963, - &__t4981, - ) - }); - } else { - { - let __t4933 = - Value::bool( - true, - ); - if match rt::is_truthy(interp, &__t4933) { Ok(b) => b, Err(e) => break Err(e), } { break Ok(v_V2049.clone()); } else { break Err(ShenError::new("cond: no clause matched")); } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_vector_x2e_vector_x2d_macros(interp: &mut Interp) { - interp.register_native("vector.vector-macros", 1, aot_vector_x2e_vector_x2d_macros); - interp.register_aot_direct("vector.vector-macros", aot_vector_x2e_vector_x2d_macros); -} - -/// AOT-compiled from KL `(defun vector.key ...)` -pub fn aot_vector_x2e_key(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "vector.key: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2065 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2066 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2067 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V2068 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t5421 = { - let __t5419 = Value::nil(); - let __t5420 = v_V2068.clone(); - rt::eq(&__t5419, &__t5420) - }; - if match rt::is_truthy(interp, &__t5421) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V2067.clone()); - } else { - { - let __t5418 = { - let __t5416 = { - let __t5407 = v_V2068.clone(); - rt::is_cons(&__t5407) - }; - if !rt::is_truthy(interp, &__t5416)? { - Value::bool(false) - } else { - let __t5417 = { - let __t5414 = { - let __t5408 = Value::sym(interp.intern("error")); - let __t5410 = { - let __t5409 = v_V2068.clone(); - rt::hd(&__t5409)? - }; - rt::eq(&__t5408, &__t5410) - }; - if !rt::is_truthy(interp, &__t5414)? { - Value::bool(false) - } else { - let __t5415 = { - let __t5411 = Value::nil(); - let __t5413 = { - let __t5412 = v_V2068.clone(); - rt::tl(&__t5412)? - }; - rt::eq(&__t5411, &__t5413) - }; - Value::bool(rt::is_truthy(interp, &__t5415)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5417)?) - } - }; - if match rt::is_truthy(interp, &__t5418) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V2067.clone()); - } else { - { - let __t5406 = { - let __t5392 = { - let __t5383 = v_V2068.clone(); - rt::is_cons(&__t5383) - }; - if !rt::is_truthy(interp, &__t5392)? { - Value::bool(false) - } else { - let __t5393 = { - let __t5390 = { - let __t5384 = Value::sym(interp.intern("ignore")); - let __t5386 = { - let __t5385 = v_V2068.clone(); - rt::hd(&__t5385)? - }; - rt::eq(&__t5384, &__t5386) - }; - if !rt::is_truthy(interp, &__t5390)? { - Value::bool(false) - } else { - let __t5391 = { - let __t5387 = Value::nil(); - let __t5389 = { - let __t5388 = v_V2068.clone(); - rt::tl(&__t5388)? - }; - rt::eq(&__t5387, &__t5389) - }; - Value::bool(rt::is_truthy(interp, &__t5391)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5393)?) - } - }; - if match rt::is_truthy(interp, &__t5406) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5394 = Value::sym(interp.intern("trap-error")); - let __t5405 = { - let __t5395 = v_V2067.clone(); - let __t5404 = { - let __t5402 = { - let __t5396 = Value::sym(interp.intern("/.")); - let __t5401 = { - let __t5397 = - { rt::apply_direct(interp, "newv", &[])? }; - let __t5400 = { - let __t5398 = v_V2065.clone(); - let __t5399 = Value::nil(); - rt::cons(&__t5398, &__t5399) - }; - rt::cons(&__t5397, &__t5400) - }; - rt::cons(&__t5396, &__t5401) - }; - let __t5403 = Value::nil(); - rt::cons(&__t5402, &__t5403) - }; - rt::cons(&__t5395, &__t5404) - }; - rt::cons(&__t5394, &__t5405) - }); - } else { - { - let __t5382 = { - let __t5361 = { - let __t5347 = v_V2068.clone(); - rt::is_cons(&__t5347) - }; - if !rt::is_truthy(interp, &__t5361)? { - Value::bool(false) - } else { - let __t5362 = { - let __t5359 = { - let __t5348 = - Value::sym(interp.intern("insert")); - let __t5350 = { - let __t5349 = v_V2068.clone(); - rt::hd(&__t5349)? - }; - rt::eq(&__t5348, &__t5350) - }; - if !rt::is_truthy(interp, &__t5359)? { - Value::bool(false) - } else { - let __t5360 = { - let __t5357 = { - let __t5352 = { - let __t5351 = v_V2068.clone(); - rt::tl(&__t5351)? - }; - rt::is_cons(&__t5352) - }; - if !rt::is_truthy(interp, &__t5357)? { - Value::bool(false) - } else { - let __t5358 = { - let __t5353 = Value::nil(); - let __t5356 = { - let __t5355 = { - let __t5354 = - v_V2068.clone(); - rt::tl(&__t5354)? - }; - rt::tl(&__t5355)? - }; - rt::eq(&__t5353, &__t5356) - }; - Value::bool(rt::is_truthy( - interp, &__t5358, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5360)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5362)?) - } - }; - if match rt::is_truthy(interp, &__t5382) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5363 = Value::sym(interp.intern("trap-error")); - let __t5381 = { - let __t5364 = v_V2067.clone(); - let __t5380 = { - let __t5378 = { - let __t5365 = - Value::sym(interp.intern("/.")); - let __t5377 = { - let __t5366 = { - rt::apply_direct( - interp, - "newv", - &[], - )? - }; - let __t5376 = { - let __t5374 = { - let __t5367 = v_V2065.clone(); - let __t5373 = { - let __t5368 = - v_V2066.clone(); - let __t5372 = { - let __t5369 = - Value::sym( - interp.intern( - ":=", - ), - ); - let __t5371 = { - let __t5370 = - v_V2068.clone(); - rt::tl(&__t5370)? - }; - rt::cons( - &__t5369, &__t5371, - ) - }; - rt::cons(&__t5368, &__t5372) - }; - rt::cons(&__t5367, &__t5373) - }; - let __t5375 = Value::nil(); - rt::cons(&__t5374, &__t5375) - }; - rt::cons(&__t5366, &__t5376) - }; - rt::cons(&__t5365, &__t5377) - }; - let __t5379 = Value::nil(); - rt::cons(&__t5378, &__t5379) - }; - rt::cons(&__t5364, &__t5380) - }; - rt::cons(&__t5363, &__t5381) - }); - } else { - { - let __t5346 = { - let __t5326 = { - let __t5317 = v_V2068.clone(); - rt::is_cons(&__t5317) - }; - if !rt::is_truthy(interp, &__t5326)? { - Value::bool(false) - } else { - let __t5327 = { - let __t5324 = { - let __t5318 = Value::sym( - interp.intern("overwrite"), - ); - let __t5320 = { - let __t5319 = v_V2068.clone(); - rt::hd(&__t5319)? - }; - rt::eq(&__t5318, &__t5320) - }; - if !rt::is_truthy(interp, &__t5324)? { - Value::bool(false) - } else { - let __t5325 = { - let __t5321 = Value::nil(); - let __t5323 = { - let __t5322 = v_V2068.clone(); - rt::tl(&__t5322)? - }; - rt::eq(&__t5321, &__t5323) - }; - Value::bool(rt::is_truthy( - interp, &__t5325, - )?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5327)?) - } - }; - if match rt::is_truthy(interp, &__t5346) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5328 = - Value::sym(interp.intern("trap-error")); - let __t5345 = { - let __t5329 = v_V2067.clone(); - let __t5344 = { - let __t5342 = { - let __t5330 = - Value::sym(interp.intern("/.")); - let __t5341 = { - let __t5331 = { - rt::apply_direct( - interp, - "newv", - &[], - )? - }; - let __t5340 = { - let __t5338 = { - let __t5332 = Value::sym(interp.intern("depopulate")); - let __t5337 = { - let __t5333 = - v_V2065.clone(); - let __t5336 = { - let __t5334 = - v_V2066 - .clone( - ); - let __t5335 = - Value::nil( - ); - rt::cons( - &__t5334, - &__t5335, - ) - }; - rt::cons( - &__t5333, - &__t5336, - ) - }; - rt::cons( - &__t5332, &__t5337, - ) - }; - let __t5339 = Value::nil(); - rt::cons(&__t5338, &__t5339) - }; - rt::cons(&__t5331, &__t5340) - }; - rt::cons(&__t5330, &__t5341) - }; - let __t5343 = Value::nil(); - rt::cons(&__t5342, &__t5343) - }; - rt::cons(&__t5329, &__t5344) - }; - rt::cons(&__t5328, &__t5345) - }); - } else { - { - let __t5316 = Value::bool(true); - if match rt::is_truthy(interp, &__t5316) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5315 = { - let __t5310 = Value::str( - "key not recognised ", - ); - let __t5314 = { - let __t5311 = v_V2068.clone(); - let __t5312 = Value::str("\n"); - let __t5313 = Value::sym( - interp.intern("shen.a"), - ); - rt::apply_direct( - interp, - "shen.app", - &[ - __t5311, __t5312, - __t5313, - ], - )? - }; - rt::apply_direct( - interp, - "cn", - &[__t5310, __t5314], - )? - }; - rt::apply_direct( - interp, - "simple-error", - &[__t5315], - )? - }); - } else { - break Err(ShenError::new( - "cond: no clause matched", - )); - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_vector_x2e_key(interp: &mut Interp) { - interp.register_native("vector.key", 4, aot_vector_x2e_key); - interp.register_aot_direct("vector.key", aot_vector_x2e_key); -} - -/// AOT-compiled from KL `(defun vector.build-array ...)` -pub fn aot_vector_x2e_build_x2d_array(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "vector.build-array: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2073 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t5533 = { - let __t5525 = { - let __t5498 = v_V2073.clone(); - rt::is_cons(&__t5498) - }; - if !rt::is_truthy(interp, &__t5525)? { - Value::bool(false) - } else { - let __t5526 = { - let __t5523 = { - let __t5499 = Value::sym(interp.intern("cons")); - let __t5501 = { - let __t5500 = v_V2073.clone(); - rt::hd(&__t5500)? - }; - rt::eq(&__t5499, &__t5501) - }; - if !rt::is_truthy(interp, &__t5523)? { - Value::bool(false) - } else { - let __t5524 = { - let __t5521 = { - let __t5503 = { - let __t5502 = v_V2073.clone(); - rt::tl(&__t5502)? - }; - rt::is_cons(&__t5503) - }; - if !rt::is_truthy(interp, &__t5521)? { - Value::bool(false) - } else { - let __t5522 = { - let __t5519 = { - let __t5506 = { - let __t5505 = { - let __t5504 = v_V2073.clone(); - rt::tl(&__t5504)? - }; - rt::tl(&__t5505)? - }; - rt::is_cons(&__t5506) - }; - if !rt::is_truthy(interp, &__t5519)? { - Value::bool(false) - } else { - let __t5520 = { - let __t5517 = { - let __t5507 = Value::nil(); - let __t5511 = { - let __t5510 = { - let __t5509 = { - let __t5508 = v_V2073.clone(); - rt::tl(&__t5508)? - }; - rt::tl(&__t5509)? - }; - rt::hd(&__t5510)? - }; - rt::eq(&__t5507, &__t5511) - }; - if !rt::is_truthy(interp, &__t5517)? { - Value::bool(false) - } else { - let __t5518 = { - let __t5512 = Value::nil(); - let __t5516 = { - let __t5515 = { - let __t5514 = { - let __t5513 = v_V2073.clone(); - rt::tl(&__t5513)? - }; - rt::tl(&__t5514)? - }; - rt::tl(&__t5515)? - }; - rt::eq(&__t5512, &__t5516) - }; - Value::bool(rt::is_truthy(interp, &__t5518)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5520)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5522)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5524)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5526)?) - } - }; - if match rt::is_truthy(interp, &__t5533) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5527 = Value::sym(interp.intern("vector")); - let __t5532 = { - let __t5530 = { - let __t5529 = { - let __t5528 = v_V2073.clone(); - rt::tl(&__t5528)? - }; - rt::hd(&__t5529)? - }; - let __t5531 = Value::nil(); - rt::cons(&__t5530, &__t5531) - }; - rt::cons(&__t5527, &__t5532) - }); - } else { - { - let __t5497 = { - let __t5449 = { - let __t5429 = v_V2073.clone(); - rt::is_cons(&__t5429) - }; - if !rt::is_truthy(interp, &__t5449)? { - Value::bool(false) - } else { - let __t5450 = { - let __t5447 = { - let __t5430 = Value::sym(interp.intern("cons")); - let __t5432 = { - let __t5431 = v_V2073.clone(); - rt::hd(&__t5431)? - }; - rt::eq(&__t5430, &__t5432) - }; - if !rt::is_truthy(interp, &__t5447)? { - Value::bool(false) - } else { - let __t5448 = { - let __t5445 = { - let __t5434 = { - let __t5433 = v_V2073.clone(); - rt::tl(&__t5433)? - }; - rt::is_cons(&__t5434) - }; - if !rt::is_truthy(interp, &__t5445)? { - Value::bool(false) - } else { - let __t5446 = { - let __t5443 = { - let __t5437 = { - let __t5436 = { - let __t5435 = v_V2073.clone(); - rt::tl(&__t5435)? - }; - rt::tl(&__t5436)? - }; - rt::is_cons(&__t5437) - }; - if !rt::is_truthy(interp, &__t5443)? { - Value::bool(false) - } else { - let __t5444 = { - let __t5438 = Value::nil(); - let __t5442 = { - let __t5441 = { - let __t5440 = { - let __t5439 = v_V2073.clone(); - rt::tl(&__t5439)? - }; - rt::tl(&__t5440)? - }; - rt::tl(&__t5441)? - }; - rt::eq(&__t5438, &__t5442) - }; - Value::bool(rt::is_truthy(interp, &__t5444)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5446)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5448)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5450)?) - } - }; - if match rt::is_truthy(interp, &__t5497) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W2074 = { rt::apply_direct(interp, "newv", &[])? }; - { - let v_W2075 = { rt::apply_direct(interp, "newv", &[])? }; - break Ok({ - let __t5451 = Value::sym(interp.intern("let")); - let __t5496 = { - let __t5452 = v_W2075.clone(); - let __t5495 = { - let __t5459 = { - let __t5453 = Value::sym(interp.intern("vector")); - let __t5458 = { - let __t5456 = { - let __t5455 = { - let __t5454 = v_V2073.clone(); - rt::tl(&__t5454)? - }; - rt::hd(&__t5455)? - }; - let __t5457 = Value::nil(); - rt::cons(&__t5456, &__t5457) - }; - rt::cons(&__t5453, &__t5458) - }; - let __t5494 = { - let __t5492 = { - let __t5460 = Value::sym(interp.intern("for")); - let __t5491 = { - let __t5461 = v_W2074.clone(); - let __t5490 = { - let __t5462 = - Value::sym(interp.intern("=")); - let __t5489 = { - let __t5463 = Value::int(1i64); - let __t5488 = { - let __t5472 = { - let __t5464 = Value::sym( - interp.intern("<="), - ); - let __t5471 = { - let __t5465 = - v_W2074.clone(); - let __t5470 = { - let __t5468 = { - let __t5467 = { - let __t5466 = v_V2073.clone(); - rt::tl(&__t5466)? - }; - rt::hd( - &__t5467, - )? - }; - let __t5469 = - Value::nil(); - rt::cons( - &__t5468, - &__t5469, - ) - }; - rt::cons( - &__t5465, &__t5470, - ) - }; - rt::cons(&__t5464, &__t5471) - }; - let __t5487 = { - let __t5485 = { - let __t5473 = - Value::sym( - interp.intern( - "vector->", - ), - ); - let __t5484 = { - let __t5474 = - v_W2075.clone(); - let __t5483 = { - let __t5475 = - v_W2074 - .clone( - ); - let __t5482 = { - let __t5480 = { - let __t5479 = { - let __t5478 = { let __t5477 = { let __t5476 = v_V2073.clone(); rt::tl(&__t5476)? }; rt::tl(&__t5477)? }; - rt::hd(&__t5478)? - }; - rt::apply_direct(interp, "vector.build-array", &[__t5479])? - }; - let __t5481 = Value::nil(); - rt::cons(&__t5480, &__t5481) - }; - rt::cons( - &__t5475, - &__t5482, - ) - }; - rt::cons( - &__t5474, - &__t5483, - ) - }; - rt::cons( - &__t5473, &__t5484, - ) - }; - let __t5486 = Value::nil(); - rt::cons(&__t5485, &__t5486) - }; - rt::cons(&__t5472, &__t5487) - }; - rt::cons(&__t5463, &__t5488) - }; - rt::cons(&__t5462, &__t5489) - }; - rt::cons(&__t5461, &__t5490) - }; - rt::cons(&__t5460, &__t5491) - }; - let __t5493 = Value::nil(); - rt::cons(&__t5492, &__t5493) - }; - rt::cons(&__t5459, &__t5494) - }; - rt::cons(&__t5452, &__t5495) - }; - rt::cons(&__t5451, &__t5496) - }); - } - } - } else { - { - let __t5428 = Value::bool(true); - if match rt::is_truthy(interp, &__t5428) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5427 = { - let __t5422 = Value::str( - "array cannot macro expand the dimensional argument ", - ); - let __t5426 = { - let __t5423 = v_V2073.clone(); - let __t5424 = Value::str("\n"); - let __t5425 = Value::sym(interp.intern("shen.r")); - rt::apply_direct( - interp, - "shen.app", - &[__t5423, __t5424, __t5425], - )? - }; - rt::apply_direct(interp, "cn", &[__t5422, __t5426])? - }; - rt::apply_direct(interp, "simple-error", &[__t5427])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_vector_x2e_build_x2d_array(interp: &mut Interp) { - interp.register_native("vector.build-array", 1, aot_vector_x2e_build_x2d_array); - interp.register_aot_direct("vector.build-array", aot_vector_x2e_build_x2d_array); -} - -/// AOT-compiled from KL `(defun depopulate ...)` -pub fn aot_depopulate(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "depopulate: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2079 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2080 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t5559 = { - let __t5553 = { - let __t5549 = v_V2080.clone(); - rt::is_cons(&__t5549) - }; - if !rt::is_truthy(interp, &__t5553)? { - Value::bool(false) - } else { - let __t5554 = { - let __t5550 = Value::nil(); - let __t5552 = { - let __t5551 = v_V2080.clone(); - rt::tl(&__t5551)? - }; - rt::eq(&__t5550, &__t5552) - }; - Value::bool(rt::is_truthy(interp, &__t5554)?) - } - }; - if match rt::is_truthy(interp, &__t5559) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5555 = v_V2079.clone(); - let __t5557 = { - let __t5556 = v_V2080.clone(); - rt::hd(&__t5556)? - }; - let __t5558 = { rt::apply_direct(interp, "fail", &[])? }; - rt::apply_direct(interp, "address->", &[__t5555, __t5557, __t5558])? - }); - } else { - { - let __t5548 = { - let __t5541 = v_V2080.clone(); - rt::is_cons(&__t5541) - }; - if match rt::is_truthy(interp, &__t5548) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let _ = { - let __t5545 = { - let __t5542 = v_V2079.clone(); - let __t5544 = { - let __t5543 = v_V2080.clone(); - rt::hd(&__t5543)? - }; - rt::apply_direct(interp, "<-vector", &[__t5542, __t5544])? - }; - let __t5547 = { - let __t5546 = v_V2080.clone(); - rt::tl(&__t5546)? - }; - rt::apply_direct(interp, "depopulate", &[__t5545, __t5547])? - }; - break Ok(v_V2079.clone()); - } - } else { - { - let __t5540 = Value::bool(true); - if match rt::is_truthy(interp, &__t5540) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5539 = { - let __t5534 = Value::str( - "depopulate cannot use the dimensional argument ", - ); - let __t5538 = { - let __t5535 = v_V2080.clone(); - let __t5536 = Value::str("\n"); - let __t5537 = Value::sym(interp.intern("shen.s")); - rt::apply_direct( - interp, - "shen.app", - &[__t5535, __t5536, __t5537], - )? - }; - rt::apply_direct(interp, "cn", &[__t5534, __t5538])? - }; - rt::apply_direct(interp, "simple-error", &[__t5539])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_depopulate(interp: &mut Interp) { - interp.register_native("depopulate", 2, aot_depopulate); - interp.register_aot_direct("depopulate", aot_depopulate); -} - -/// AOT-compiled from KL `(defun populated? ...)` -pub fn aot_populated_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "populated?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2083 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2084 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t5582 = { - let __t5574 = { - let __t5570 = v_V2084.clone(); - rt::is_cons(&__t5570) - }; - if !rt::is_truthy(interp, &__t5574)? { - Value::bool(false) - } else { - let __t5575 = { - let __t5571 = Value::nil(); - let __t5573 = { - let __t5572 = v_V2084.clone(); - rt::tl(&__t5572)? - }; - rt::eq(&__t5571, &__t5573) - }; - Value::bool(rt::is_truthy(interp, &__t5575)?) - } - }; - if match rt::is_truthy(interp, &__t5582) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5581 = { - let __t5579 = { - let __t5576 = v_V2083.clone(); - let __t5578 = { - let __t5577 = v_V2084.clone(); - rt::hd(&__t5577)? - }; - rt::apply_direct(interp, "<-address", &[__t5576, __t5578])? - }; - let __t5580 = { rt::apply_direct(interp, "fail", &[])? }; - rt::eq(&__t5579, &__t5580) - }; - rt::apply_direct(interp, "not", &[__t5581])? - }); - } else { - { - let __t5569 = { - let __t5562 = v_V2084.clone(); - rt::is_cons(&__t5562) - }; - if match rt::is_truthy(interp, &__t5569) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t5566 = { - let __t5563 = v_V2083.clone(); - let __t5565 = { - let __t5564 = v_V2084.clone(); - rt::hd(&__t5564)? - }; - rt::apply_direct(interp, "<-address", &[__t5563, __t5565])? - }; - let __t5568 = { - let __t5567 = v_V2084.clone(); - rt::tl(&__t5567)? - }; - v_V2083 = __t5566; - v_V2084 = __t5568; - continue; - } - } else { - { - let __t5561 = Value::bool(true); - if match rt::is_truthy(interp, &__t5561) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5560 = Value::sym(interp.intern("populated?")); - rt::apply_direct(interp, "shen.f-error", &[__t5560])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_populated_x3f_(interp: &mut Interp) { - interp.register_native("populated?", 2, aot_populated_x3f_); - interp.register_aot_direct("populated?", aot_populated_x3f_); -} - -/// AOT-compiled from KL `(defun vector.unfold-populate ...)` -pub fn aot_vector_x2e_unfold_x2d_populate( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector.unfold-populate: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2087 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2088 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t5664 = { - let __t5654 = { - let __t5627 = v_V2088.clone(); - rt::is_cons(&__t5627) - }; - if !rt::is_truthy(interp, &__t5654)? { - Value::bool(false) - } else { - let __t5655 = { - let __t5652 = { - let __t5628 = Value::sym(interp.intern("cons")); - let __t5630 = { - let __t5629 = v_V2088.clone(); - rt::hd(&__t5629)? - }; - rt::eq(&__t5628, &__t5630) - }; - if !rt::is_truthy(interp, &__t5652)? { - Value::bool(false) - } else { - let __t5653 = { - let __t5650 = { - let __t5632 = { - let __t5631 = v_V2088.clone(); - rt::tl(&__t5631)? - }; - rt::is_cons(&__t5632) - }; - if !rt::is_truthy(interp, &__t5650)? { - Value::bool(false) - } else { - let __t5651 = { - let __t5648 = { - let __t5635 = { - let __t5634 = { - let __t5633 = v_V2088.clone(); - rt::tl(&__t5633)? - }; - rt::tl(&__t5634)? - }; - rt::is_cons(&__t5635) - }; - if !rt::is_truthy(interp, &__t5648)? { - Value::bool(false) - } else { - let __t5649 = { - let __t5646 = { - let __t5636 = Value::nil(); - let __t5640 = { - let __t5639 = { - let __t5638 = { - let __t5637 = v_V2088.clone(); - rt::tl(&__t5637)? - }; - rt::tl(&__t5638)? - }; - rt::hd(&__t5639)? - }; - rt::eq(&__t5636, &__t5640) - }; - if !rt::is_truthy(interp, &__t5646)? { - Value::bool(false) - } else { - let __t5647 = { - let __t5641 = Value::nil(); - let __t5645 = { - let __t5644 = { - let __t5643 = { - let __t5642 = v_V2088.clone(); - rt::tl(&__t5642)? - }; - rt::tl(&__t5643)? - }; - rt::tl(&__t5644)? - }; - rt::eq(&__t5641, &__t5645) - }; - Value::bool(rt::is_truthy(interp, &__t5647)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5649)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5651)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5653)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5655)?) - } - }; - if match rt::is_truthy(interp, &__t5664) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5656 = Value::sym(interp.intern("populate")); - let __t5663 = { - let __t5657 = v_V2087.clone(); - let __t5662 = { - let __t5660 = { - let __t5659 = { - let __t5658 = v_V2088.clone(); - rt::tl(&__t5658)? - }; - rt::hd(&__t5659)? - }; - let __t5661 = Value::nil(); - rt::cons(&__t5660, &__t5661) - }; - rt::cons(&__t5657, &__t5662) - }; - rt::cons(&__t5656, &__t5663) - }); - } else { - { - let __t5626 = { - let __t5605 = { - let __t5585 = v_V2088.clone(); - rt::is_cons(&__t5585) - }; - if !rt::is_truthy(interp, &__t5605)? { - Value::bool(false) - } else { - let __t5606 = { - let __t5603 = { - let __t5586 = Value::sym(interp.intern("cons")); - let __t5588 = { - let __t5587 = v_V2088.clone(); - rt::hd(&__t5587)? - }; - rt::eq(&__t5586, &__t5588) - }; - if !rt::is_truthy(interp, &__t5603)? { - Value::bool(false) - } else { - let __t5604 = { - let __t5601 = { - let __t5590 = { - let __t5589 = v_V2088.clone(); - rt::tl(&__t5589)? - }; - rt::is_cons(&__t5590) - }; - if !rt::is_truthy(interp, &__t5601)? { - Value::bool(false) - } else { - let __t5602 = { - let __t5599 = { - let __t5593 = { - let __t5592 = { - let __t5591 = v_V2088.clone(); - rt::tl(&__t5591)? - }; - rt::tl(&__t5592)? - }; - rt::is_cons(&__t5593) - }; - if !rt::is_truthy(interp, &__t5599)? { - Value::bool(false) - } else { - let __t5600 = { - let __t5594 = Value::nil(); - let __t5598 = { - let __t5597 = { - let __t5596 = { - let __t5595 = v_V2088.clone(); - rt::tl(&__t5595)? - }; - rt::tl(&__t5596)? - }; - rt::tl(&__t5597)? - }; - rt::eq(&__t5594, &__t5598) - }; - Value::bool(rt::is_truthy(interp, &__t5600)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5602)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5604)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5606)?) - } - }; - if match rt::is_truthy(interp, &__t5626) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5607 = Value::sym(interp.intern("populate")); - let __t5625 = { - let __t5619 = { - let __t5608 = Value::sym(interp.intern("/.")); - let __t5618 = { - let __t5609 = { rt::apply_direct(interp, "newv", &[])? }; - let __t5617 = { - let __t5615 = { - let __t5610 = v_V2087.clone(); - let __t5614 = { - let __t5613 = { - let __t5612 = { - let __t5611 = v_V2088.clone(); - rt::tl(&__t5611)? - }; - rt::tl(&__t5612)? - }; - rt::hd(&__t5613)? - }; - rt::apply_direct( - interp, - "vector.unfold-populate", - &[__t5610, __t5614], - )? - }; - let __t5616 = Value::nil(); - rt::cons(&__t5615, &__t5616) - }; - rt::cons(&__t5609, &__t5617) - }; - rt::cons(&__t5608, &__t5618) - }; - let __t5624 = { - let __t5622 = { - let __t5621 = { - let __t5620 = v_V2088.clone(); - rt::tl(&__t5620)? - }; - rt::hd(&__t5621)? - }; - let __t5623 = Value::nil(); - rt::cons(&__t5622, &__t5623) - }; - rt::cons(&__t5619, &__t5624) - }; - rt::cons(&__t5607, &__t5625) - }); - } else { - { - let __t5584 = Value::bool(true); - if match rt::is_truthy(interp, &__t5584) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5583 = - Value::sym(interp.intern("vector.unfold-populate")); - rt::apply_direct(interp, "shen.f-error", &[__t5583])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_vector_x2e_unfold_x2d_populate(interp: &mut Interp) { - interp.register_native( - "vector.unfold-populate", - 2, - aot_vector_x2e_unfold_x2d_populate, - ); - interp.register_aot_direct("vector.unfold-populate", aot_vector_x2e_unfold_x2d_populate); -} - -/// AOT-compiled from KL `(defun populate ...)` -pub fn aot_populate(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "populate: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2094 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2095 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2096 = { - let __t5667 = { - let __t5665 = v_V2095.clone(); - let __t5666 = Value::int(1i64); - rt::add(&__t5665, &__t5666)? - }; - rt::apply_direct(interp, "absvector", &[__t5667])? - }; - { - let v_W2097 = { - let __t5668 = v_W2096.clone(); - let __t5669 = Value::int(0i64); - let __t5670 = v_V2095.clone(); - rt::apply_direct(interp, "address->", &[__t5668, __t5669, __t5670])? - }; - break Ok({ - let __t5671 = Value::int(1i64); - let __t5674 = { - let v_V2095 = v_V2095.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2098 = args[0].clone(); - Ok({ - let __t5672 = v_Z2098.clone(); - let __t5673 = v_V2095.clone(); - rt::lte(&__t5672, &__t5673)? - }) - }, - vec![v_V2095], - interp, - ) - }; - let __t5679 = { - let v_V2094 = v_V2094.clone(); - let v_W2096 = v_W2096.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2099 = args[0].clone(); - Ok({ - let __t5675 = v_W2096.clone(); - let __t5676 = v_Z2099.clone(); - let __t5678 = { - let __t5677 = v_Z2099.clone(); - rt::apply_value(interp, v_V2094.clone(), &[__t5677])? - }; - rt::apply_direct( - interp, - "address->", - &[__t5675, __t5676, __t5678], - )? - }) - }, - vec![v_V2094, v_W2096], - interp, - ) - }; - let __t5682 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2100 = args[0].clone(); - Ok({ - let __t5680 = Value::int(1i64); - let __t5681 = v_Z2100.clone(); - rt::add(&__t5680, &__t5681)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t5683 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2101 = args[0].clone(); - Ok({ - let v_Z2101 = v_Z2101.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2102 = args[0].clone(); - Ok({ - let _ = v_Z2101.clone(); - v_Z2102.clone() - }) - }, - vec![v_Z2101], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t5671, __t5674, __t5679, __t5682, __t5683], - )? - }); - } - } - } -} - -fn install_populate(interp: &mut Interp) { - interp.register_native("populate", 2, aot_populate); - interp.register_aot_direct("populate", aot_populate); -} - -/// AOT-compiled from KL `(defun vector.<-array ...)` -pub fn aot_vector_x2e__x3c__x2d_array(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector.<-array: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2107 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2108 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t5764 = { - let __t5754 = { - let __t5727 = v_V2108.clone(); - rt::is_cons(&__t5727) - }; - if !rt::is_truthy(interp, &__t5754)? { - Value::bool(false) - } else { - let __t5755 = { - let __t5752 = { - let __t5728 = Value::sym(interp.intern("cons")); - let __t5730 = { - let __t5729 = v_V2108.clone(); - rt::hd(&__t5729)? - }; - rt::eq(&__t5728, &__t5730) - }; - if !rt::is_truthy(interp, &__t5752)? { - Value::bool(false) - } else { - let __t5753 = { - let __t5750 = { - let __t5732 = { - let __t5731 = v_V2108.clone(); - rt::tl(&__t5731)? - }; - rt::is_cons(&__t5732) - }; - if !rt::is_truthy(interp, &__t5750)? { - Value::bool(false) - } else { - let __t5751 = { - let __t5748 = { - let __t5735 = { - let __t5734 = { - let __t5733 = v_V2108.clone(); - rt::tl(&__t5733)? - }; - rt::tl(&__t5734)? - }; - rt::is_cons(&__t5735) - }; - if !rt::is_truthy(interp, &__t5748)? { - Value::bool(false) - } else { - let __t5749 = { - let __t5746 = { - let __t5736 = Value::nil(); - let __t5740 = { - let __t5739 = { - let __t5738 = { - let __t5737 = v_V2108.clone(); - rt::tl(&__t5737)? - }; - rt::tl(&__t5738)? - }; - rt::hd(&__t5739)? - }; - rt::eq(&__t5736, &__t5740) - }; - if !rt::is_truthy(interp, &__t5746)? { - Value::bool(false) - } else { - let __t5747 = { - let __t5741 = Value::nil(); - let __t5745 = { - let __t5744 = { - let __t5743 = { - let __t5742 = v_V2108.clone(); - rt::tl(&__t5742)? - }; - rt::tl(&__t5743)? - }; - rt::tl(&__t5744)? - }; - rt::eq(&__t5741, &__t5745) - }; - Value::bool(rt::is_truthy(interp, &__t5747)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5749)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5751)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5753)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5755)?) - } - }; - if match rt::is_truthy(interp, &__t5764) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5756 = Value::sym(interp.intern("<-vector")); - let __t5763 = { - let __t5757 = v_V2107.clone(); - let __t5762 = { - let __t5760 = { - let __t5759 = { - let __t5758 = v_V2108.clone(); - rt::tl(&__t5758)? - }; - rt::hd(&__t5759)? - }; - let __t5761 = Value::nil(); - rt::cons(&__t5760, &__t5761) - }; - rt::cons(&__t5757, &__t5762) - }; - rt::cons(&__t5756, &__t5763) - }); - } else { - { - let __t5726 = { - let __t5711 = { - let __t5691 = v_V2108.clone(); - rt::is_cons(&__t5691) - }; - if !rt::is_truthy(interp, &__t5711)? { - Value::bool(false) - } else { - let __t5712 = { - let __t5709 = { - let __t5692 = Value::sym(interp.intern("cons")); - let __t5694 = { - let __t5693 = v_V2108.clone(); - rt::hd(&__t5693)? - }; - rt::eq(&__t5692, &__t5694) - }; - if !rt::is_truthy(interp, &__t5709)? { - Value::bool(false) - } else { - let __t5710 = { - let __t5707 = { - let __t5696 = { - let __t5695 = v_V2108.clone(); - rt::tl(&__t5695)? - }; - rt::is_cons(&__t5696) - }; - if !rt::is_truthy(interp, &__t5707)? { - Value::bool(false) - } else { - let __t5708 = { - let __t5705 = { - let __t5699 = { - let __t5698 = { - let __t5697 = v_V2108.clone(); - rt::tl(&__t5697)? - }; - rt::tl(&__t5698)? - }; - rt::is_cons(&__t5699) - }; - if !rt::is_truthy(interp, &__t5705)? { - Value::bool(false) - } else { - let __t5706 = { - let __t5700 = Value::nil(); - let __t5704 = { - let __t5703 = { - let __t5702 = { - let __t5701 = v_V2108.clone(); - rt::tl(&__t5701)? - }; - rt::tl(&__t5702)? - }; - rt::tl(&__t5703)? - }; - rt::eq(&__t5700, &__t5704) - }; - Value::bool(rt::is_truthy(interp, &__t5706)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5708)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5710)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5712)?) - } - }; - if match rt::is_truthy(interp, &__t5726) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t5721 = { - let __t5713 = Value::sym(interp.intern("<-vector")); - let __t5720 = { - let __t5714 = v_V2107.clone(); - let __t5719 = { - let __t5717 = { - let __t5716 = { - let __t5715 = v_V2108.clone(); - rt::tl(&__t5715)? - }; - rt::hd(&__t5716)? - }; - let __t5718 = Value::nil(); - rt::cons(&__t5717, &__t5718) - }; - rt::cons(&__t5714, &__t5719) - }; - rt::cons(&__t5713, &__t5720) - }; - let __t5725 = { - let __t5724 = { - let __t5723 = { - let __t5722 = v_V2108.clone(); - rt::tl(&__t5722)? - }; - rt::tl(&__t5723)? - }; - rt::hd(&__t5724)? - }; - v_V2107 = __t5721; - v_V2108 = __t5725; - continue; - } - } else { - { - let __t5690 = Value::bool(true); - if match rt::is_truthy(interp, &__t5690) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5689 = { - let __t5684 = Value::str( - "cannot macro expand the dimensional argument ", - ); - let __t5688 = { - let __t5685 = v_V2108.clone(); - let __t5686 = Value::str("\n"); - let __t5687 = Value::sym(interp.intern("shen.r")); - rt::apply_direct( - interp, - "shen.app", - &[__t5685, __t5686, __t5687], - )? - }; - rt::apply_direct(interp, "cn", &[__t5684, __t5688])? - }; - rt::apply_direct(interp, "simple-error", &[__t5689])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_vector_x2e__x3c__x2d_array(interp: &mut Interp) { - interp.register_native("vector.<-array", 2, aot_vector_x2e__x3c__x2d_array); - interp.register_aot_direct("vector.<-array", aot_vector_x2e__x3c__x2d_array); -} - -/// AOT-compiled from KL `(defun vector.array-> ...)` -pub fn aot_vector_x2e_array_x2d__x3e_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "vector.array->: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2111 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2112 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2113 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t5817 = { - let __t5805 = { - let __t5778 = v_V2112.clone(); - rt::is_cons(&__t5778) - }; - if !rt::is_truthy(interp, &__t5805)? { - Value::bool(false) - } else { - let __t5806 = { - let __t5803 = { - let __t5779 = Value::sym(interp.intern("cons")); - let __t5781 = { - let __t5780 = v_V2112.clone(); - rt::hd(&__t5780)? - }; - rt::eq(&__t5779, &__t5781) - }; - if !rt::is_truthy(interp, &__t5803)? { - Value::bool(false) - } else { - let __t5804 = { - let __t5801 = { - let __t5783 = { - let __t5782 = v_V2112.clone(); - rt::tl(&__t5782)? - }; - rt::is_cons(&__t5783) - }; - if !rt::is_truthy(interp, &__t5801)? { - Value::bool(false) - } else { - let __t5802 = { - let __t5799 = { - let __t5786 = { - let __t5785 = { - let __t5784 = v_V2112.clone(); - rt::tl(&__t5784)? - }; - rt::tl(&__t5785)? - }; - rt::is_cons(&__t5786) - }; - if !rt::is_truthy(interp, &__t5799)? { - Value::bool(false) - } else { - let __t5800 = { - let __t5797 = { - let __t5787 = Value::nil(); - let __t5791 = { - let __t5790 = { - let __t5789 = { - let __t5788 = v_V2112.clone(); - rt::tl(&__t5788)? - }; - rt::tl(&__t5789)? - }; - rt::hd(&__t5790)? - }; - rt::eq(&__t5787, &__t5791) - }; - if !rt::is_truthy(interp, &__t5797)? { - Value::bool(false) - } else { - let __t5798 = { - let __t5792 = Value::nil(); - let __t5796 = { - let __t5795 = { - let __t5794 = { - let __t5793 = v_V2112.clone(); - rt::tl(&__t5793)? - }; - rt::tl(&__t5794)? - }; - rt::tl(&__t5795)? - }; - rt::eq(&__t5792, &__t5796) - }; - Value::bool(rt::is_truthy(interp, &__t5798)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5800)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5802)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5804)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5806)?) - } - }; - if match rt::is_truthy(interp, &__t5817) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5807 = Value::sym(interp.intern("vector->")); - let __t5816 = { - let __t5808 = v_V2111.clone(); - let __t5815 = { - let __t5811 = { - let __t5810 = { - let __t5809 = v_V2112.clone(); - rt::tl(&__t5809)? - }; - rt::hd(&__t5810)? - }; - let __t5814 = { - let __t5812 = v_V2113.clone(); - let __t5813 = Value::nil(); - rt::cons(&__t5812, &__t5813) - }; - rt::cons(&__t5811, &__t5814) - }; - rt::cons(&__t5808, &__t5815) - }; - rt::cons(&__t5807, &__t5816) - }); - } else { - { - let __t5777 = Value::bool(true); - if match rt::is_truthy(interp, &__t5777) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W2114 = { rt::apply_direct(interp, "newv", &[])? }; - break Ok({ - let __t5765 = Value::sym(interp.intern("let")); - let __t5776 = { - let __t5766 = v_W2114.clone(); - let __t5775 = { - let __t5767 = v_V2111.clone(); - let __t5774 = { - let __t5772 = { - let __t5768 = v_W2114.clone(); - let __t5769 = v_W2114.clone(); - let __t5770 = v_V2112.clone(); - let __t5771 = v_V2113.clone(); - rt::apply_direct( - interp, - "vector.unfold-vector-assignment", - &[__t5768, __t5769, __t5770, __t5771], - )? - }; - let __t5773 = Value::nil(); - rt::cons(&__t5772, &__t5773) - }; - rt::cons(&__t5767, &__t5774) - }; - rt::cons(&__t5766, &__t5775) - }; - rt::cons(&__t5765, &__t5776) - }); - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_vector_x2e_array_x2d__x3e_(interp: &mut Interp) { - interp.register_native("vector.array->", 3, aot_vector_x2e_array_x2d__x3e_); - interp.register_aot_direct("vector.array->", aot_vector_x2e_array_x2d__x3e_); -} - -/// AOT-compiled from KL `(defun vector.unfold-vector-assignment ...)` -pub fn aot_vector_x2e_unfold_x2d_vector_x2d_assignment( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "vector.unfold-vector-assignment: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2124 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2125 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2126 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V2127 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t5918 = { - let __t5898 = { - let __t5871 = v_V2126.clone(); - rt::is_cons(&__t5871) - }; - if !rt::is_truthy(interp, &__t5898)? { - Value::bool(false) - } else { - let __t5899 = { - let __t5896 = { - let __t5872 = Value::sym(interp.intern("cons")); - let __t5874 = { - let __t5873 = v_V2126.clone(); - rt::hd(&__t5873)? - }; - rt::eq(&__t5872, &__t5874) - }; - if !rt::is_truthy(interp, &__t5896)? { - Value::bool(false) - } else { - let __t5897 = { - let __t5894 = { - let __t5876 = { - let __t5875 = v_V2126.clone(); - rt::tl(&__t5875)? - }; - rt::is_cons(&__t5876) - }; - if !rt::is_truthy(interp, &__t5894)? { - Value::bool(false) - } else { - let __t5895 = { - let __t5892 = { - let __t5879 = { - let __t5878 = { - let __t5877 = v_V2126.clone(); - rt::tl(&__t5877)? - }; - rt::tl(&__t5878)? - }; - rt::is_cons(&__t5879) - }; - if !rt::is_truthy(interp, &__t5892)? { - Value::bool(false) - } else { - let __t5893 = { - let __t5890 = { - let __t5880 = Value::nil(); - let __t5884 = { - let __t5883 = { - let __t5882 = { - let __t5881 = v_V2126.clone(); - rt::tl(&__t5881)? - }; - rt::tl(&__t5882)? - }; - rt::hd(&__t5883)? - }; - rt::eq(&__t5880, &__t5884) - }; - if !rt::is_truthy(interp, &__t5890)? { - Value::bool(false) - } else { - let __t5891 = { - let __t5885 = Value::nil(); - let __t5889 = { - let __t5888 = { - let __t5887 = { - let __t5886 = v_V2126.clone(); - rt::tl(&__t5886)? - }; - rt::tl(&__t5887)? - }; - rt::tl(&__t5888)? - }; - rt::eq(&__t5885, &__t5889) - }; - Value::bool(rt::is_truthy(interp, &__t5891)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5893)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5895)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5897)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5899)?) - } - }; - if match rt::is_truthy(interp, &__t5918) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W2128 = { rt::apply_direct(interp, "newv", &[])? }; - break Ok({ - let __t5900 = Value::sym(interp.intern("let")); - let __t5917 = { - let __t5901 = v_W2128.clone(); - let __t5916 = { - let __t5912 = { - let __t5902 = Value::sym(interp.intern("vector->")); - let __t5911 = { - let __t5903 = v_V2125.clone(); - let __t5910 = { - let __t5906 = { - let __t5905 = { - let __t5904 = v_V2126.clone(); - rt::tl(&__t5904)? - }; - rt::hd(&__t5905)? - }; - let __t5909 = { - let __t5907 = v_V2127.clone(); - let __t5908 = Value::nil(); - rt::cons(&__t5907, &__t5908) - }; - rt::cons(&__t5906, &__t5909) - }; - rt::cons(&__t5903, &__t5910) - }; - rt::cons(&__t5902, &__t5911) - }; - let __t5915 = { - let __t5913 = v_V2124.clone(); - let __t5914 = Value::nil(); - rt::cons(&__t5913, &__t5914) - }; - rt::cons(&__t5912, &__t5915) - }; - rt::cons(&__t5901, &__t5916) - }; - rt::cons(&__t5900, &__t5917) - }); - } - } else { - { - let __t5870 = { - let __t5845 = { - let __t5825 = v_V2126.clone(); - rt::is_cons(&__t5825) - }; - if !rt::is_truthy(interp, &__t5845)? { - Value::bool(false) - } else { - let __t5846 = { - let __t5843 = { - let __t5826 = Value::sym(interp.intern("cons")); - let __t5828 = { - let __t5827 = v_V2126.clone(); - rt::hd(&__t5827)? - }; - rt::eq(&__t5826, &__t5828) - }; - if !rt::is_truthy(interp, &__t5843)? { - Value::bool(false) - } else { - let __t5844 = { - let __t5841 = { - let __t5830 = { - let __t5829 = v_V2126.clone(); - rt::tl(&__t5829)? - }; - rt::is_cons(&__t5830) - }; - if !rt::is_truthy(interp, &__t5841)? { - Value::bool(false) - } else { - let __t5842 = { - let __t5839 = { - let __t5833 = { - let __t5832 = { - let __t5831 = v_V2126.clone(); - rt::tl(&__t5831)? - }; - rt::tl(&__t5832)? - }; - rt::is_cons(&__t5833) - }; - if !rt::is_truthy(interp, &__t5839)? { - Value::bool(false) - } else { - let __t5840 = { - let __t5834 = Value::nil(); - let __t5838 = { - let __t5837 = { - let __t5836 = { - let __t5835 = v_V2126.clone(); - rt::tl(&__t5835)? - }; - rt::tl(&__t5836)? - }; - rt::tl(&__t5837)? - }; - rt::eq(&__t5834, &__t5838) - }; - Value::bool(rt::is_truthy(interp, &__t5840)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5842)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5844)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t5846)?) - } - }; - if match rt::is_truthy(interp, &__t5870) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W2129 = { rt::apply_direct(interp, "newv", &[])? }; - break Ok({ - let __t5847 = Value::sym(interp.intern("let")); - let __t5869 = { - let __t5848 = v_W2129.clone(); - let __t5868 = { - let __t5857 = { - let __t5849 = Value::sym(interp.intern("<-vector")); - let __t5856 = { - let __t5850 = v_V2125.clone(); - let __t5855 = { - let __t5853 = { - let __t5852 = { - let __t5851 = v_V2126.clone(); - rt::tl(&__t5851)? - }; - rt::hd(&__t5852)? - }; - let __t5854 = Value::nil(); - rt::cons(&__t5853, &__t5854) - }; - rt::cons(&__t5850, &__t5855) - }; - rt::cons(&__t5849, &__t5856) - }; - let __t5867 = { - let __t5865 = { - let __t5858 = v_V2124.clone(); - let __t5859 = v_W2129.clone(); - let __t5863 = { - let __t5862 = { - let __t5861 = { - let __t5860 = v_V2126.clone(); - rt::tl(&__t5860)? - }; - rt::tl(&__t5861)? - }; - rt::hd(&__t5862)? - }; - let __t5864 = v_V2127.clone(); - rt::apply_direct( - interp, - "vector.unfold-vector-assignment", - &[__t5858, __t5859, __t5863, __t5864], - )? - }; - let __t5866 = Value::nil(); - rt::cons(&__t5865, &__t5866) - }; - rt::cons(&__t5857, &__t5867) - }; - rt::cons(&__t5848, &__t5868) - }; - rt::cons(&__t5847, &__t5869) - }); - } - } else { - { - let __t5824 = Value::bool(true); - if match rt::is_truthy(interp, &__t5824) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t5823 = { - let __t5818 = Value::str( - "cannot macro expand the dimensional argument ", - ); - let __t5822 = { - let __t5819 = v_V2126.clone(); - let __t5820 = Value::str("\n"); - let __t5821 = Value::sym(interp.intern("shen.r")); - rt::apply_direct( - interp, - "shen.app", - &[__t5819, __t5820, __t5821], - )? - }; - rt::apply_direct(interp, "cn", &[__t5818, __t5822])? - }; - rt::apply_direct(interp, "simple-error", &[__t5823])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_vector_x2e_unfold_x2d_vector_x2d_assignment(interp: &mut Interp) { - interp.register_native( - "vector.unfold-vector-assignment", - 4, - aot_vector_x2e_unfold_x2d_vector_x2d_assignment, - ); - interp.register_aot_direct( - "vector.unfold-vector-assignment", - aot_vector_x2e_unfold_x2d_vector_x2d_assignment, - ); -} - -/// AOT-compiled from KL `(defun compress ...)` -pub fn aot_compress(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "compress: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2168 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t5921 = { - let __t5919 = v_V2168.clone(); - let __t5920 = Value::nil(); - rt::apply_direct(interp, "vector->list", &[__t5919, __t5920])? - }; - rt::apply_direct(interp, "list->vector", &[__t5921])? - }); - } -} - -fn install_compress(interp: &mut Interp) { - interp.register_native("compress", 1, aot_compress); - interp.register_aot_direct("compress", aot_compress); -} - -/// AOT-compiled from KL `(defun vector.copy ...)` -pub fn aot_vector_x2e_copy(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "vector.copy: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2174 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2175 = { - let __t5922 = v_V2174.clone(); - rt::apply_direct(interp, "limit", &[__t5922])? - }; - { - let v_W2176 = { - let __t5923 = v_W2175.clone(); - rt::apply_direct(interp, "vector", &[__t5923])? - }; - break Ok({ - let __t5924 = Value::int(1i64); - let __t5927 = { - let v_W2175 = v_W2175.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2177 = args[0].clone(); - Ok({ - let __t5925 = v_Z2177.clone(); - let __t5926 = v_W2175.clone(); - rt::lte(&__t5925, &__t5926)? - }) - }, - vec![v_W2175], - interp, - ) - }; - let __t5937 = { - let v_V2174 = v_V2174.clone(); - let v_W2176 = v_W2176.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2178 = args[0].clone(); - Ok( - match (|| -> ShenResult { - Ok({ - let __t5928 = v_W2176.clone(); - let __t5929 = v_Z2178.clone(); - let __t5932 = { - let __t5930 = v_V2174.clone(); - let __t5931 = v_Z2178.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t5930, __t5931], - )? - }; - rt::apply_direct( - interp, - "vector->", - &[__t5928, __t5929, __t5932], - )? - }) - })() { - Ok(v) => v, - Err(e) => { - let __h = { - let v_W2176 = v_W2176.clone(); - let v_Z2178 = v_Z2178.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2179 = args[0].clone(); - Ok({ - let __t5933 = v_W2176.clone(); - let __t5936 = { - let __t5934 = v_Z2178.clone(); - let __t5935 = Value::nil(); - rt::cons(&__t5934, &__t5935) - }; - rt::apply_direct( - interp, - "depopulate", - &[__t5933, __t5936], - )? - }) - }, - vec![v_W2176, v_Z2178], - interp, - ) - }; - let __err = Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - }, - ) - }, - vec![v_V2174, v_W2176], - interp, - ) - }; - let __t5940 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2180 = args[0].clone(); - Ok({ - let __t5938 = Value::int(1i64); - let __t5939 = v_Z2180.clone(); - rt::add(&__t5938, &__t5939)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t5941 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2181 = args[0].clone(); - Ok({ - let v_Z2181 = v_Z2181.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2182 = args[0].clone(); - Ok({ - let _ = v_Z2181.clone(); - v_Z2182.clone() - }) - }, - vec![v_Z2181], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t5924, __t5927, __t5937, __t5940, __t5941], - )? - }); - } - } - } -} - -fn install_vector_x2e_copy(interp: &mut Interp) { - interp.register_native("vector.copy", 1, aot_vector_x2e_copy); - interp.register_aot_direct("vector.copy", aot_vector_x2e_copy); -} - -/// AOT-compiled from KL `(defun vector.reverse ...)` -pub fn aot_vector_x2e_reverse(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "vector.reverse: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2187 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2188 = { - let __t5942 = v_V2187.clone(); - rt::apply_direct(interp, "limit", &[__t5942])? - }; - { - let v_W2189 = { - let __t5943 = v_W2188.clone(); - rt::apply_direct(interp, "vector", &[__t5943])? - }; - { - let v_W2190 = { - let __t5944 = v_W2188.clone(); - let __t5947 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2191 = args[0].clone(); - Ok({ - let __t5945 = v_Z2191.clone(); - let __t5946 = Value::int(0i64); - rt::gt(&__t5945, &__t5946)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t5961 = { - let v_V2187 = v_V2187.clone(); - let v_W2188 = v_W2188.clone(); - let v_W2189 = v_W2189.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2192 = args[0].clone(); - Ok( - match (|| -> ShenResult { - Ok({ - let __t5948 = v_W2189.clone(); - let __t5949 = v_Z2192.clone(); - let __t5956 = { - let __t5950 = v_V2187.clone(); - let __t5955 = { - let __t5951 = Value::int(1i64); - let __t5954 = { - let __t5952 = v_W2188.clone(); - let __t5953 = v_Z2192.clone(); - rt::sub(&__t5952, &__t5953)? - }; - rt::add(&__t5951, &__t5954)? - }; - rt::apply_direct( - interp, - "<-vector", - &[__t5950, __t5955], - )? - }; - rt::apply_direct( - interp, - "vector->", - &[__t5948, __t5949, __t5956], - )? - }) - })() { - Ok(v) => v, - Err(e) => { - let __h = { - let v_W2189 = v_W2189.clone(); - let v_Z2192 = v_Z2192.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2193 = args[0].clone(); - Ok({ - let __t5957 = v_W2189.clone(); - let __t5960 = { - let __t5958 = v_Z2192.clone(); - let __t5959 = Value::nil(); - rt::cons(&__t5958, &__t5959) - }; - rt::apply_direct( - interp, - "depopulate", - &[__t5957, __t5960], - )? - }) - }, - vec![v_W2189, v_Z2192], - interp, - ) - }; - let __err = Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - }, - ) - }, - vec![v_V2187, v_W2188, v_W2189], - interp, - ) - }; - let __t5964 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2194 = args[0].clone(); - Ok({ - let __t5962 = v_Z2194.clone(); - let __t5963 = Value::int(1i64); - rt::sub(&__t5962, &__t5963)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t5965 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2195 = args[0].clone(); - Ok({ - let v_Z2195 = v_Z2195.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2196 = args[0].clone(); - Ok({ - let _ = v_Z2195.clone(); - v_Z2196.clone() - }) - }, - vec![v_Z2195], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t5944, __t5947, __t5961, __t5964, __t5965], - )? - }; - break Ok(v_W2189.clone()); - } - } - } - } -} - -fn install_vector_x2e_reverse(interp: &mut Interp) { - interp.register_native("vector.reverse", 1, aot_vector_x2e_reverse); - interp.register_aot_direct("vector.reverse", aot_vector_x2e_reverse); -} - -/// AOT-compiled from KL `(defun vector.append ...)` -pub fn aot_vector_x2e_append(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector.append: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2206 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2207 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2208 = { - let __t5966 = v_V2206.clone(); - rt::apply_direct(interp, "limit", &[__t5966])? - }; - { - let v_W2209 = { - let __t5967 = v_V2207.clone(); - rt::apply_direct(interp, "limit", &[__t5967])? - }; - { - let v_W2210 = { - let __t5968 = v_W2208.clone(); - let __t5969 = v_W2209.clone(); - rt::add(&__t5968, &__t5969)? - }; - { - let v_W2211 = { - let __t5970 = v_W2210.clone(); - rt::apply_direct(interp, "vector", &[__t5970])? - }; - { - let v_W2212 = { - let __t5971 = Value::int(1i64); - let __t5974 = { - let v_W2208 = v_W2208.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2213 = args[0].clone(); - Ok({ - let __t5972 = v_Z2213.clone(); - let __t5973 = v_W2208.clone(); - rt::lte(&__t5972, &__t5973)? - }) - }, - vec![v_W2208], - interp, - ) - }; - let __t5984 = { - let v_V2206 = v_V2206.clone(); - let v_W2211 = v_W2211.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2214 = args[0].clone(); - Ok( - match (|| -> ShenResult { - Ok({ - let __t5975 = v_W2211.clone(); - let __t5976 = v_Z2214.clone(); - let __t5979 = { - let __t5977 = v_V2206.clone(); - let __t5978 = v_Z2214.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t5977, __t5978], - )? - }; - rt::apply_direct( - interp, - "vector->", - &[__t5975, __t5976, __t5979], - )? - }) - })( - ) { - Ok(v) => v, - Err(e) => { - let __h = { - let v_W2211 = v_W2211.clone(); - let v_Z2214 = v_Z2214.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2215 = args[0].clone(); - Ok({ - let __t5980 = - v_W2211.clone(); - let __t5983 = { - let __t5981 = - v_Z2214.clone(); - let __t5982 = - Value::nil(); - rt::cons( - &__t5981, &__t5982, - ) - }; - rt::apply_direct( - interp, - "depopulate", - &[__t5980, __t5983], - )? - }) - }, - vec![v_W2211, v_Z2214], - interp, - ) - }; - let __err = Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - }, - ) - }, - vec![v_V2206, v_W2211], - interp, - ) - }; - let __t5987 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2216 = args[0].clone(); - Ok({ - let __t5985 = Value::int(1i64); - let __t5986 = v_Z2216.clone(); - rt::add(&__t5985, &__t5986)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t5988 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2217 = args[0].clone(); - Ok({ - let v_Z2217 = v_Z2217.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2218 = args[0].clone(); - Ok({ - let _ = v_Z2217.clone(); - v_Z2218.clone() - }) - }, - vec![v_Z2217], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t5971, __t5974, __t5984, __t5987, __t5988], - )? - }; - { - let v_W2219 = { - let __t5991 = { - let __t5989 = v_W2208.clone(); - let __t5990 = Value::int(1i64); - rt::add(&__t5989, &__t5990)? - }; - let __t5994 = { - let v_W2210 = v_W2210.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2220 = args[0].clone(); - Ok({ - let __t5992 = v_Z2220.clone(); - let __t5993 = v_W2210.clone(); - rt::lte(&__t5992, &__t5993)? - }) - }, - vec![v_W2210], - interp, - ) - }; - let __t6004 = { - let v_V2207 = v_V2207.clone(); - let v_W2211 = v_W2211.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2221 = args[0].clone(); - Ok( - match (|| -> ShenResult { - Ok({ - let __t5995 = v_W2211.clone(); - let __t5996 = v_Z2221.clone(); - let __t5999 = { - let __t5997 = v_V2207.clone(); - let __t5998 = v_Z2221.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t5997, __t5998], - )? - }; - rt::apply_direct( - interp, - "vector->", - &[__t5995, __t5996, __t5999], - )? - }) - })( - ) { - Ok(v) => v, - Err(e) => { - let __h = { - let v_W2211 = v_W2211.clone(); - let v_Z2221 = v_Z2221.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2222 = - args[0].clone(); - Ok({ - let __t6000 = - v_W2211.clone(); - let __t6003 = { - let __t6001 = - v_Z2221.clone(); - let __t6002 = - Value::nil(); - rt::cons( - &__t6001, - &__t6002, - ) - }; - rt::apply_direct( - interp, - "depopulate", - &[__t6000, __t6003], - )? - }) - }, - vec![v_W2211, v_Z2221], - interp, - ) - }; - let __err = - Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - }, - ) - }, - vec![v_V2207, v_W2211], - interp, - ) - }; - let __t6007 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2223 = args[0].clone(); - Ok({ - let __t6005 = Value::int(1i64); - let __t6006 = v_Z2223.clone(); - rt::add(&__t6005, &__t6006)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t6008 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2224 = args[0].clone(); - Ok({ - let v_Z2224 = v_Z2224.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2225 = args[0].clone(); - Ok({ - let _ = v_Z2224.clone(); - v_Z2225.clone() - }) - }, - vec![v_Z2224], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t5991, __t5994, __t6004, __t6007, __t6008], - )? - }; - break Ok(v_W2211.clone()); - } - } - } - } - } - } - } -} - -fn install_vector_x2e_append(interp: &mut Interp) { - interp.register_native("vector.append", 2, aot_vector_x2e_append); - interp.register_aot_direct("vector.append", aot_vector_x2e_append); -} - -/// AOT-compiled from KL `(defun vector.dfilter ...)` -pub fn aot_vector_x2e_dfilter(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector.dfilter: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2231 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2232 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2233 = { - let __t6009 = v_V2232.clone(); - rt::apply_direct(interp, "limit", &[__t6009])? - }; - { - let v_W2234 = { - let __t6010 = Value::int(1i64); - let __t6013 = { - let v_W2233 = v_W2233.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2235 = args[0].clone(); - Ok({ - let __t6011 = v_Z2235.clone(); - let __t6012 = v_W2233.clone(); - rt::lte(&__t6011, &__t6012)? - }) - }, - vec![v_W2233], - interp, - ) - }; - let __t6033 = { - let v_V2231 = v_V2231.clone(); - let v_V2232 = v_V2232.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2236 = args[0].clone(); - Ok({ - let __t6032 = { - let __t6021 = { - let __t6014 = v_V2232.clone(); - let __t6017 = { - let __t6015 = v_Z2236.clone(); - let __t6016 = Value::nil(); - rt::cons(&__t6015, &__t6016) - }; - rt::apply_direct( - interp, - "populated?", - &[__t6014, __t6017], - )? - }; - if !rt::is_truthy(interp, &__t6021)? { - Value::bool(false) - } else { - let __t6022 = { - let __t6020 = { - let __t6018 = v_V2232.clone(); - let __t6019 = v_Z2236.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t6018, __t6019], - )? - }; - rt::apply_value( - interp, - v_V2231.clone(), - &[__t6020], - )? - }; - Value::bool(rt::is_truthy(interp, &__t6022)?) - } - }; - if rt::is_truthy(interp, &__t6032)? { - { - let __t6023 = v_V2232.clone(); - let __t6024 = v_Z2236.clone(); - let __t6027 = { - let __t6025 = v_V2232.clone(); - let __t6026 = v_Z2236.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t6025, __t6026], - )? - }; - rt::apply_direct( - interp, - "vector->", - &[__t6023, __t6024, __t6027], - )? - } - } else { - { - let __t6028 = v_V2232.clone(); - let __t6031 = { - let __t6029 = v_Z2236.clone(); - let __t6030 = Value::nil(); - rt::cons(&__t6029, &__t6030) - }; - rt::apply_direct( - interp, - "depopulate", - &[__t6028, __t6031], - )? - } - } - }) - }, - vec![v_V2231, v_V2232], - interp, - ) - }; - let __t6036 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2237 = args[0].clone(); - Ok({ - let __t6034 = Value::int(1i64); - let __t6035 = v_Z2237.clone(); - rt::add(&__t6034, &__t6035)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t6037 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2238 = args[0].clone(); - Ok({ - let v_Z2238 = v_Z2238.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2239 = args[0].clone(); - Ok({ - let _ = v_Z2238.clone(); - v_Z2239.clone() - }) - }, - vec![v_Z2238], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t6010, __t6013, __t6033, __t6036, __t6037], - )? - }; - break Ok(v_V2232.clone()); - } - } - } -} - -fn install_vector_x2e_dfilter(interp: &mut Interp) { - interp.register_native("vector.dfilter", 2, aot_vector_x2e_dfilter); - interp.register_aot_direct("vector.dfilter", aot_vector_x2e_dfilter); -} - -/// AOT-compiled from KL `(defun vector.element? ...)` -pub fn aot_vector_x2e_element_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector.element?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2243 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2244 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2245 = { - let __t6038 = v_V2244.clone(); - rt::apply_direct(interp, "limit", &[__t6038])? - }; - { - let v_W2246 = { - let __t6039 = Value::int(1i64); - let __t6042 = { - let v_W2245 = v_W2245.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2247 = args[0].clone(); - Ok({ - let __t6040 = v_Z2247.clone(); - let __t6041 = v_W2245.clone(); - rt::lte(&__t6040, &__t6041)? - }) - }, - vec![v_W2245], - interp, - ) - }; - let __t6052 = { - let v_V2243 = v_V2243.clone(); - let v_V2244 = v_V2244.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2248 = args[0].clone(); - Ok({ - let __t6051 = { - let __t6043 = v_V2244.clone(); - let __t6046 = { - let __t6044 = v_Z2248.clone(); - let __t6045 = Value::nil(); - rt::cons(&__t6044, &__t6045) - }; - rt::apply_direct(interp, "populated?", &[__t6043, __t6046])? - }; - if rt::is_truthy(interp, &__t6051)? { - { - let __t6047 = v_V2243.clone(); - let __t6050 = { - let __t6048 = v_V2244.clone(); - let __t6049 = v_Z2248.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t6048, __t6049], - )? - }; - rt::eq(&__t6047, &__t6050) - } - } else { - Value::bool(false) - } - }) - }, - vec![v_V2243, v_V2244], - interp, - ) - }; - let __t6055 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2249 = args[0].clone(); - Ok({ - let __t6053 = Value::int(1i64); - let __t6054 = v_Z2249.clone(); - rt::add(&__t6053, &__t6054)? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "maths.lazyfor-or", - &[__t6039, __t6042, __t6052, __t6055], - )? - }; - break Ok(v_W2246.clone()); - } - } - } -} - -fn install_vector_x2e_element_x3f_(interp: &mut Interp) { - interp.register_native("vector.element?", 2, aot_vector_x2e_element_x3f_); - interp.register_aot_direct("vector.element?", aot_vector_x2e_element_x3f_); -} - -/// AOT-compiled from KL `(defun vector.map ...)` -pub fn aot_vector_x2e_map(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector.map: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2256 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2257 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2258 = { - let __t6056 = v_V2257.clone(); - rt::apply_direct(interp, "limit", &[__t6056])? - }; - { - let v_W2259 = { - let __t6057 = v_W2258.clone(); - rt::apply_direct(interp, "vector", &[__t6057])? - }; - { - let v_W2260 = { - let __t6058 = Value::int(1i64); - let __t6061 = { - let v_W2258 = v_W2258.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2261 = args[0].clone(); - Ok({ - let __t6059 = v_Z2261.clone(); - let __t6060 = v_W2258.clone(); - rt::lte(&__t6059, &__t6060)? - }) - }, - vec![v_W2258], - interp, - ) - }; - let __t6082 = { - let v_V2256 = v_V2256.clone(); - let v_V2257 = v_V2257.clone(); - let v_W2259 = v_W2259.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2262 = args[0].clone(); - Ok({ - let __t6081 = { - let __t6062 = v_V2257.clone(); - let __t6065 = { - let __t6063 = v_Z2262.clone(); - let __t6064 = Value::nil(); - rt::cons(&__t6063, &__t6064) - }; - rt::apply_direct( - interp, - "populated?", - &[__t6062, __t6065], - )? - }; - if rt::is_truthy(interp, &__t6081)? { - { - let __t6066 = v_W2259.clone(); - let __t6067 = v_Z2262.clone(); - let __t6071 = { - let __t6070 = { - let __t6068 = v_V2257.clone(); - let __t6069 = v_Z2262.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t6068, __t6069], - )? - }; - rt::apply_value( - interp, - v_V2256.clone(), - &[__t6070], - )? - }; - rt::apply_direct( - interp, - "vector->", - &[__t6066, __t6067, __t6071], - )? - } - } else { - match (|| -> ShenResult { - Ok({ - let __t6072 = v_W2259.clone(); - let __t6073 = v_Z2262.clone(); - let __t6076 = { - let __t6074 = v_W2259.clone(); - let __t6075 = v_Z2262.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t6074, __t6075], - )? - }; - rt::apply_direct( - interp, - "vector->", - &[__t6072, __t6073, __t6076], - )? - }) - })() { - Ok(v) => v, - Err(e) => { - let __h = { - let v_W2259 = v_W2259.clone(); - let v_Z2262 = v_Z2262.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2263 = args[0].clone(); - Ok({ - let __t6077 = v_W2259.clone(); - let __t6080 = { - let __t6078 = - v_Z2262.clone(); - let __t6079 = Value::nil(); - rt::cons(&__t6078, &__t6079) - }; - rt::apply_direct( - interp, - "depopulate", - &[__t6077, __t6080], - )? - }) - }, - vec![v_W2259, v_Z2262], - interp, - ) - }; - let __err = Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - } - } - }) - }, - vec![v_V2256, v_V2257, v_W2259], - interp, - ) - }; - let __t6085 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2264 = args[0].clone(); - Ok({ - let __t6083 = Value::int(1i64); - let __t6084 = v_Z2264.clone(); - rt::add(&__t6083, &__t6084)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t6086 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2265 = args[0].clone(); - Ok({ - let v_Z2265 = v_Z2265.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2266 = args[0].clone(); - Ok({ - let _ = v_Z2265.clone(); - v_Z2266.clone() - }) - }, - vec![v_Z2265], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t6058, __t6061, __t6082, __t6085, __t6086], - )? - }; - break Ok(v_W2259.clone()); - } - } - } - } -} - -fn install_vector_x2e_map(interp: &mut Interp) { - interp.register_native("vector.map", 2, aot_vector_x2e_map); - interp.register_aot_direct("vector.map", aot_vector_x2e_map); -} - -/// AOT-compiled from KL `(defun vector.dmap ...)` -pub fn aot_vector_x2e_dmap(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector.dmap: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2273 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2274 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2275 = { - let __t6087 = v_V2274.clone(); - rt::apply_direct(interp, "limit", &[__t6087])? - }; - { - let v_W2276 = { - let __t6088 = Value::int(1i64); - let __t6091 = { - let v_W2275 = v_W2275.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2277 = args[0].clone(); - Ok({ - let __t6089 = v_Z2277.clone(); - let __t6090 = v_W2275.clone(); - rt::lte(&__t6089, &__t6090)? - }) - }, - vec![v_W2275], - interp, - ) - }; - let __t6112 = { - let v_V2273 = v_V2273.clone(); - let v_V2274 = v_V2274.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2278 = args[0].clone(); - Ok({ - let __t6111 = { - let __t6092 = v_V2274.clone(); - let __t6095 = { - let __t6093 = v_Z2278.clone(); - let __t6094 = Value::nil(); - rt::cons(&__t6093, &__t6094) - }; - rt::apply_direct(interp, "populated?", &[__t6092, __t6095])? - }; - if rt::is_truthy(interp, &__t6111)? { - { - let __t6096 = v_V2274.clone(); - let __t6097 = v_Z2278.clone(); - let __t6101 = { - let __t6100 = { - let __t6098 = v_V2274.clone(); - let __t6099 = v_Z2278.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t6098, __t6099], - )? - }; - rt::apply_value( - interp, - v_V2273.clone(), - &[__t6100], - )? - }; - rt::apply_direct( - interp, - "vector->", - &[__t6096, __t6097, __t6101], - )? - } - } else { - match (|| -> ShenResult { - Ok({ - let __t6102 = v_V2274.clone(); - let __t6103 = v_Z2278.clone(); - let __t6106 = { - let __t6104 = v_V2274.clone(); - let __t6105 = v_Z2278.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t6104, __t6105], - )? - }; - rt::apply_direct( - interp, - "vector->", - &[__t6102, __t6103, __t6106], - )? - }) - })() { - Ok(v) => v, - Err(e) => { - let __h = { - let v_V2274 = v_V2274.clone(); - let v_Z2278 = v_Z2278.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2279 = args[0].clone(); - Ok({ - let __t6107 = v_V2274.clone(); - let __t6110 = { - let __t6108 = v_Z2278.clone(); - let __t6109 = Value::nil(); - rt::cons(&__t6108, &__t6109) - }; - rt::apply_direct( - interp, - "depopulate", - &[__t6107, __t6110], - )? - }) - }, - vec![v_V2274, v_Z2278], - interp, - ) - }; - let __err = Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - } - } - }) - }, - vec![v_V2273, v_V2274], - interp, - ) - }; - let __t6115 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2280 = args[0].clone(); - Ok({ - let __t6113 = Value::int(1i64); - let __t6114 = v_Z2280.clone(); - rt::add(&__t6113, &__t6114)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t6116 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2281 = args[0].clone(); - Ok({ - let v_Z2281 = v_Z2281.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2282 = args[0].clone(); - Ok({ - let _ = v_Z2281.clone(); - v_Z2282.clone() - }) - }, - vec![v_Z2281], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t6088, __t6091, __t6112, __t6115, __t6116], - )? - }; - break Ok(v_V2274.clone()); - } - } - } -} - -fn install_vector_x2e_dmap(interp: &mut Interp) { - interp.register_native("vector.dmap", 2, aot_vector_x2e_dmap); - interp.register_aot_direct("vector.dmap", aot_vector_x2e_dmap); -} - -/// AOT-compiled from KL `(defun vector.every? ...)` -pub fn aot_vector_x2e_every_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector.every?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2286 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2287 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2288 = { - let __t6117 = v_V2287.clone(); - rt::apply_direct(interp, "limit", &[__t6117])? - }; - { - let v_W2289 = { - let __t6118 = Value::int(1i64); - let __t6121 = { - let v_W2288 = v_W2288.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2290 = args[0].clone(); - Ok({ - let __t6119 = v_Z2290.clone(); - let __t6120 = v_W2288.clone(); - rt::lte(&__t6119, &__t6120)? - }) - }, - vec![v_W2288], - interp, - ) - }; - let __t6130 = { - let v_V2286 = v_V2286.clone(); - let v_V2287 = v_V2287.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2291 = args[0].clone(); - Ok({ - let __t6129 = { - let __t6122 = v_V2287.clone(); - let __t6125 = { - let __t6123 = v_Z2291.clone(); - let __t6124 = Value::nil(); - rt::cons(&__t6123, &__t6124) - }; - rt::apply_direct(interp, "populated?", &[__t6122, __t6125])? - }; - if rt::is_truthy(interp, &__t6129)? { - { - let __t6128 = { - let __t6126 = v_V2287.clone(); - let __t6127 = v_Z2291.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t6126, __t6127], - )? - }; - rt::apply_value(interp, v_V2286.clone(), &[__t6128])? - } - } else { - Value::bool(true) - } - }) - }, - vec![v_V2286, v_V2287], - interp, - ) - }; - let __t6133 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2292 = args[0].clone(); - Ok({ - let __t6131 = Value::int(1i64); - let __t6132 = v_Z2292.clone(); - rt::add(&__t6131, &__t6132)? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "maths.lazyfor-and", - &[__t6118, __t6121, __t6130, __t6133], - )? - }; - break Ok(v_W2289.clone()); - } - } - } -} - -fn install_vector_x2e_every_x3f_(interp: &mut Interp) { - interp.register_native("vector.every?", 2, aot_vector_x2e_every_x3f_); - interp.register_aot_direct("vector.every?", aot_vector_x2e_every_x3f_); -} - -/// AOT-compiled from KL `(defun vector.some? ...)` -pub fn aot_vector_x2e_some_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector.some?: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2296 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2297 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2298 = { - let __t6134 = v_V2297.clone(); - rt::apply_direct(interp, "limit", &[__t6134])? - }; - { - let v_W2299 = { - let __t6135 = Value::int(1i64); - let __t6138 = { - let v_W2298 = v_W2298.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2300 = args[0].clone(); - Ok({ - let __t6136 = v_Z2300.clone(); - let __t6137 = v_W2298.clone(); - rt::lte(&__t6136, &__t6137)? - }) - }, - vec![v_W2298], - interp, - ) - }; - let __t6147 = { - let v_V2296 = v_V2296.clone(); - let v_V2297 = v_V2297.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2301 = args[0].clone(); - Ok({ - let __t6146 = { - let __t6139 = v_V2297.clone(); - let __t6142 = { - let __t6140 = v_Z2301.clone(); - let __t6141 = Value::nil(); - rt::cons(&__t6140, &__t6141) - }; - rt::apply_direct(interp, "populated?", &[__t6139, __t6142])? - }; - if rt::is_truthy(interp, &__t6146)? { - { - let __t6145 = { - let __t6143 = v_V2297.clone(); - let __t6144 = v_Z2301.clone(); - rt::apply_direct( - interp, - "<-vector", - &[__t6143, __t6144], - )? - }; - rt::apply_value(interp, v_V2296.clone(), &[__t6145])? - } - } else { - Value::bool(false) - } - }) - }, - vec![v_V2296, v_V2297], - interp, - ) - }; - let __t6150 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2302 = args[0].clone(); - Ok({ - let __t6148 = Value::int(1i64); - let __t6149 = v_Z2302.clone(); - rt::add(&__t6148, &__t6149)? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "maths.lazyfor-or", - &[__t6135, __t6138, __t6147, __t6150], - )? - }; - break Ok(v_W2299.clone()); - } - } - } -} - -fn install_vector_x2e_some_x3f_(interp: &mut Interp) { - interp.register_native("vector.some?", 2, aot_vector_x2e_some_x3f_); - interp.register_aot_direct("vector.some?", aot_vector_x2e_some_x3f_); -} - -/// AOT-compiled from KL `(defun vector->list ...)` -pub fn aot_vector_x2d__x3e_list(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "vector->list: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2308 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2309 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6151 = Value::int(1i64); - let __t6155 = { - let v_V2308 = v_V2308.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2310 = args[0].clone(); - Ok({ - let __t6152 = v_Z2310.clone(); - let __t6154 = { - let __t6153 = v_V2308.clone(); - rt::apply_direct(interp, "limit", &[__t6153])? - }; - rt::lte(&__t6152, &__t6154)? - }) - }, - vec![v_V2308], - interp, - ) - }; - let __t6165 = { - let v_V2308 = v_V2308.clone(); - let v_V2309 = v_V2309.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2311 = args[0].clone(); - Ok({ - let __t6164 = { - let __t6156 = v_V2308.clone(); - let __t6159 = { - let __t6157 = v_Z2311.clone(); - let __t6158 = Value::nil(); - rt::cons(&__t6157, &__t6158) - }; - rt::apply_direct(interp, "populated?", &[__t6156, __t6159])? - }; - if rt::is_truthy(interp, &__t6164)? { - { - let __t6162 = { - let __t6160 = v_V2308.clone(); - let __t6161 = v_Z2311.clone(); - rt::apply_direct(interp, "<-vector", &[__t6160, __t6161])? - }; - let __t6163 = Value::nil(); - rt::cons(&__t6162, &__t6163) - } - } else { - v_V2309.clone() - } - }) - }, - vec![v_V2308, v_V2309], - interp, - ) - }; - let __t6168 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2312 = args[0].clone(); - Ok({ - let __t6166 = Value::int(1i64); - let __t6167 = v_Z2312.clone(); - rt::add(&__t6166, &__t6167)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t6171 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2313 = args[0].clone(); - Ok({ - let v_Z2313 = v_Z2313.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2314 = args[0].clone(); - Ok({ - let __t6169 = v_Z2313.clone(); - let __t6170 = v_Z2314.clone(); - rt::apply_direct(interp, "append", &[__t6169, __t6170])? - }) - }, - vec![v_Z2313], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t6151, __t6155, __t6165, __t6168, __t6171], - )? - }); - } -} - -fn install_vector_x2d__x3e_list(interp: &mut Interp) { - interp.register_native("vector->list", 2, aot_vector_x2d__x3e_list); - interp.register_aot_direct("vector->list", aot_vector_x2d__x3e_list); -} - -/// AOT-compiled from KL `(defun list->vector ...)` -pub fn aot_list_x2d__x3e_vector(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "list->vector: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2317 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6172 = v_V2317.clone(); - let __t6173 = Value::int(1i64); - let __t6176 = { - let __t6175 = { - let __t6174 = v_V2317.clone(); - rt::apply_direct(interp, "length", &[__t6174])? - }; - rt::apply_direct(interp, "vector", &[__t6175])? - }; - rt::apply_direct( - interp, - "vector.list->vector-h", - &[__t6172, __t6173, __t6176], - )? - }); - } -} - -fn install_list_x2d__x3e_vector(interp: &mut Interp) { - interp.register_native("list->vector", 1, aot_list_x2d__x3e_vector); - interp.register_aot_direct("list->vector", aot_list_x2d__x3e_vector); -} - -/// AOT-compiled from KL `(defun vector.list->vector-h ...)` -pub fn aot_vector_x2e_list_x2d__x3e_vector_x2d_h( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "vector.list->vector-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2321 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2322 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2323 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6193 = { - let __t6191 = Value::nil(); - let __t6192 = v_V2321.clone(); - rt::eq(&__t6191, &__t6192) - }; - if match rt::is_truthy(interp, &__t6193) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V2323.clone()); - } else { - { - let __t6190 = { - let __t6179 = v_V2321.clone(); - rt::is_cons(&__t6179) - }; - if match rt::is_truthy(interp, &__t6190) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t6181 = { - let __t6180 = v_V2321.clone(); - rt::tl(&__t6180)? - }; - let __t6184 = { - let __t6182 = v_V2322.clone(); - let __t6183 = Value::int(1i64); - rt::add(&__t6182, &__t6183)? - }; - let __t6189 = { - let __t6185 = v_V2323.clone(); - let __t6186 = v_V2322.clone(); - let __t6188 = { - let __t6187 = v_V2321.clone(); - rt::hd(&__t6187)? - }; - rt::apply_direct(interp, "vector->", &[__t6185, __t6186, __t6188])? - }; - v_V2321 = __t6181; - v_V2322 = __t6184; - v_V2323 = __t6189; - continue; - } - } else { - { - let __t6178 = Value::bool(true); - if match rt::is_truthy(interp, &__t6178) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6177 = - Value::sym(interp.intern("vector.list->vector-h")); - rt::apply_direct(interp, "shen.f-error", &[__t6177])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_vector_x2e_list_x2d__x3e_vector_x2d_h(interp: &mut Interp) { - interp.register_native( - "vector.list->vector-h", - 3, - aot_vector_x2e_list_x2d__x3e_vector_x2d_h, - ); - interp.register_aot_direct( - "vector.list->vector-h", - aot_vector_x2e_list_x2d__x3e_vector_x2d_h, - ); -} - -/// AOT-compiled from KL `(defun vacant? ...)` -pub fn aot_vacant_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "vacant?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2328 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6194 = Value::int(1i64); - let __t6198 = { - let v_V2328 = v_V2328.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2329 = args[0].clone(); - Ok({ - let __t6195 = v_Z2329.clone(); - let __t6197 = { - let __t6196 = v_V2328.clone(); - rt::apply_direct(interp, "limit", &[__t6196])? - }; - rt::lte(&__t6195, &__t6197)? - }) - }, - vec![v_V2328], - interp, - ) - }; - let __t6204 = { - let v_V2328 = v_V2328.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2330 = args[0].clone(); - Ok({ - let __t6203 = { - let __t6199 = v_V2328.clone(); - let __t6202 = { - let __t6200 = v_Z2330.clone(); - let __t6201 = Value::nil(); - rt::cons(&__t6200, &__t6201) - }; - rt::apply_direct(interp, "populated?", &[__t6199, __t6202])? - }; - rt::apply_direct(interp, "not", &[__t6203])? - }) - }, - vec![v_V2328], - interp, - ) - }; - let __t6207 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2331 = args[0].clone(); - Ok({ - let __t6205 = Value::int(1i64); - let __t6206 = v_Z2331.clone(); - rt::add(&__t6205, &__t6206)? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "maths.lazyfor-and", - &[__t6194, __t6198, __t6204, __t6207], - )? - }); - } -} - -fn install_vacant_x3f_(interp: &mut Interp) { - interp.register_native("vacant?", 1, aot_vacant_x3f_); - interp.register_aot_direct("vacant?", aot_vacant_x3f_); -} - -/// AOT-compiled from KL `(defun dense? ...)` -pub fn aot_dense_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "dense?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2334 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6208 = Value::int(1i64); - let __t6212 = { - let v_V2334 = v_V2334.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2335 = args[0].clone(); - Ok({ - let __t6209 = v_Z2335.clone(); - let __t6211 = { - let __t6210 = v_V2334.clone(); - rt::apply_direct(interp, "limit", &[__t6210])? - }; - rt::lte(&__t6209, &__t6211)? - }) - }, - vec![v_V2334], - interp, - ) - }; - let __t6217 = { - let v_V2334 = v_V2334.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2336 = args[0].clone(); - Ok({ - let __t6213 = v_V2334.clone(); - let __t6216 = { - let __t6214 = v_Z2336.clone(); - let __t6215 = Value::nil(); - rt::cons(&__t6214, &__t6215) - }; - rt::apply_direct(interp, "populated?", &[__t6213, __t6216])? - }) - }, - vec![v_V2334], - interp, - ) - }; - let __t6220 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2337 = args[0].clone(); - Ok({ - let __t6218 = Value::int(1i64); - let __t6219 = v_Z2337.clone(); - rt::add(&__t6218, &__t6219)? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "maths.lazyfor-and", - &[__t6208, __t6212, __t6217, __t6220], - )? - }); - } -} - -fn install_dense_x3f_(interp: &mut Interp) { - interp.register_native("dense?", 1, aot_dense_x3f_); - interp.register_aot_direct("dense?", aot_dense_x3f_); -} - -/// AOT-compiled from KL `(defun porous? ...)` -pub fn aot_porous_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "porous?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2340 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6221 = Value::int(1i64); - let __t6225 = { - let v_V2340 = v_V2340.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2341 = args[0].clone(); - Ok({ - let __t6222 = v_Z2341.clone(); - let __t6224 = { - let __t6223 = v_V2340.clone(); - rt::apply_direct(interp, "limit", &[__t6223])? - }; - rt::lte(&__t6222, &__t6224)? - }) - }, - vec![v_V2340], - interp, - ) - }; - let __t6231 = { - let v_V2340 = v_V2340.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2342 = args[0].clone(); - Ok({ - let __t6230 = { - let __t6226 = v_V2340.clone(); - let __t6229 = { - let __t6227 = v_Z2342.clone(); - let __t6228 = Value::nil(); - rt::cons(&__t6227, &__t6228) - }; - rt::apply_direct(interp, "populated?", &[__t6226, __t6229])? - }; - rt::apply_direct(interp, "not", &[__t6230])? - }) - }, - vec![v_V2340], - interp, - ) - }; - let __t6234 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2343 = args[0].clone(); - Ok({ - let __t6232 = Value::int(1i64); - let __t6233 = v_Z2343.clone(); - rt::add(&__t6232, &__t6233)? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "maths.lazyfor-or", - &[__t6221, __t6225, __t6231, __t6234], - )? - }); - } -} - -fn install_porous_x3f_(interp: &mut Interp) { - interp.register_native("porous?", 1, aot_porous_x3f_); - interp.register_aot_direct("porous?", aot_porous_x3f_); -} - -/// AOT-compiled from KL `(defun sparse? ...)` -pub fn aot_sparse_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "sparse?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2348 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2349 = { - let __t6235 = v_V2348.clone(); - rt::apply_direct(interp, "limit", &[__t6235])? - }; - { - let v_W2350 = { - let __t6236 = Value::int(1i64); - let __t6240 = { - let v_V2348 = v_V2348.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2351 = args[0].clone(); - Ok({ - let __t6237 = v_Z2351.clone(); - let __t6239 = { - let __t6238 = v_V2348.clone(); - rt::apply_direct(interp, "limit", &[__t6238])? - }; - rt::lte(&__t6237, &__t6239)? - }) - }, - vec![v_V2348], - interp, - ) - }; - let __t6246 = { - let v_V2348 = v_V2348.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2352 = args[0].clone(); - Ok({ - let __t6245 = { - let __t6241 = v_V2348.clone(); - let __t6244 = { - let __t6242 = v_Z2352.clone(); - let __t6243 = Value::nil(); - rt::cons(&__t6242, &__t6243) - }; - rt::apply_direct(interp, "populated?", &[__t6241, __t6244])? - }; - if rt::is_truthy(interp, &__t6245)? { - Value::int(1i64) - } else { - Value::int(0i64) - } - }) - }, - vec![v_V2348], - interp, - ) - }; - let __t6249 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2353 = args[0].clone(); - Ok({ - let __t6247 = Value::int(1i64); - let __t6248 = v_Z2353.clone(); - rt::add(&__t6247, &__t6248)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t6252 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2354 = args[0].clone(); - Ok({ - let v_Z2354 = v_Z2354.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2355 = args[0].clone(); - Ok({ - let __t6250 = v_Z2354.clone(); - let __t6251 = v_Z2355.clone(); - rt::add(&__t6250, &__t6251)? - }) - }, - vec![v_Z2354], - interp, - ) - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct( - interp, - "for", - &[__t6236, __t6240, __t6246, __t6249, __t6252], - )? - }; - { - let v_W2356 = { - let __t6253 = v_W2349.clone(); - let __t6254 = v_W2350.clone(); - rt::sub(&__t6253, &__t6254)? - }; - break Ok({ - let __t6255 = v_W2356.clone(); - let __t6256 = v_W2350.clone(); - rt::gt(&__t6255, &__t6256)? - }); - } - } - } - } -} - -fn install_sparse_x3f_(interp: &mut Interp) { - interp.register_native("sparse?", 1, aot_sparse_x3f_); - interp.register_aot_direct("sparse?", aot_sparse_x3f_); -} - -/// AOT-compiled from KL `(defun v-op1 ...)` -pub fn aot_v_x2d_op1(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "v-op1: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2358 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2359 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2360 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6260 = { - let __t6259 = { - let __t6257 = v_V2359.clone(); - let __t6258 = v_V2360.clone(); - rt::apply_direct(interp, "vector->list", &[__t6257, __t6258])? - }; - rt::apply_value(interp, v_V2358.clone(), &[__t6259])? - }; - rt::apply_direct(interp, "list->vector", &[__t6260])? - }); - } -} - -fn install_v_x2d_op1(interp: &mut Interp) { - interp.register_native("v-op1", 3, aot_v_x2d_op1); - interp.register_aot_direct("v-op1", aot_v_x2d_op1); -} - -/// AOT-compiled from KL `(defun v-op2 ...)` -pub fn aot_v_x2d_op2(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "v-op2: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2364 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2365 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2366 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V2367 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6268 = { - let __t6264 = { - let __t6263 = { - let __t6261 = v_V2365.clone(); - let __t6262 = v_V2367.clone(); - rt::apply_direct(interp, "vector->list", &[__t6261, __t6262])? - }; - rt::apply_value(interp, v_V2364.clone(), &[__t6263])? - }; - let __t6267 = { - let __t6265 = v_V2366.clone(); - let __t6266 = v_V2367.clone(); - rt::apply_direct(interp, "vector->list", &[__t6265, __t6266])? - }; - rt::apply_value(interp, __t6264, &[__t6267])? - }; - rt::apply_direct(interp, "list->vector", &[__t6268])? - }); - } -} - -fn install_v_x2d_op2(interp: &mut Interp) { - interp.register_native("v-op2", 4, aot_v_x2d_op2); - interp.register_aot_direct("v-op2", aot_v_x2d_op2); -} - -/// AOT-compiled from KL `(defun print.pprint-macro ...)` -pub fn aot_print_x2e_pprint_x2d_macro(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "print.pprint-macro: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2453 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6323 = { - let __t6311 = { - let __t6297 = v_V2453.clone(); - rt::is_cons(&__t6297) - }; - if !rt::is_truthy(interp, &__t6311)? { - Value::bool(false) - } else { - let __t6312 = { - let __t6309 = { - let __t6298 = Value::sym(interp.intern("pprint")); - let __t6300 = { - let __t6299 = v_V2453.clone(); - rt::hd(&__t6299)? - }; - rt::eq(&__t6298, &__t6300) - }; - if !rt::is_truthy(interp, &__t6309)? { - Value::bool(false) - } else { - let __t6310 = { - let __t6307 = { - let __t6302 = { - let __t6301 = v_V2453.clone(); - rt::tl(&__t6301)? - }; - rt::is_cons(&__t6302) - }; - if !rt::is_truthy(interp, &__t6307)? { - Value::bool(false) - } else { - let __t6308 = { - let __t6303 = Value::nil(); - let __t6306 = { - let __t6305 = { - let __t6304 = v_V2453.clone(); - rt::tl(&__t6304)? - }; - rt::tl(&__t6305)? - }; - rt::eq(&__t6303, &__t6306) - }; - Value::bool(rt::is_truthy(interp, &__t6308)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6310)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6312)?) - } - }; - if match rt::is_truthy(interp, &__t6323) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6313 = Value::sym(interp.intern("pprint")); - let __t6322 = { - let __t6316 = { - let __t6315 = { - let __t6314 = v_V2453.clone(); - rt::tl(&__t6314)? - }; - rt::hd(&__t6315)? - }; - let __t6321 = { - let __t6319 = { - let __t6317 = Value::sym(interp.intern("stoutput")); - let __t6318 = Value::nil(); - rt::cons(&__t6317, &__t6318) - }; - let __t6320 = Value::nil(); - rt::cons(&__t6319, &__t6320) - }; - rt::cons(&__t6316, &__t6321) - }; - rt::cons(&__t6313, &__t6322) - }); - } else { - { - let __t6296 = { - let __t6284 = { - let __t6270 = v_V2453.clone(); - rt::is_cons(&__t6270) - }; - if !rt::is_truthy(interp, &__t6284)? { - Value::bool(false) - } else { - let __t6285 = { - let __t6282 = { - let __t6271 = Value::sym(interp.intern("pps")); - let __t6273 = { - let __t6272 = v_V2453.clone(); - rt::hd(&__t6272)? - }; - rt::eq(&__t6271, &__t6273) - }; - if !rt::is_truthy(interp, &__t6282)? { - Value::bool(false) - } else { - let __t6283 = { - let __t6280 = { - let __t6275 = { - let __t6274 = v_V2453.clone(); - rt::tl(&__t6274)? - }; - rt::is_cons(&__t6275) - }; - if !rt::is_truthy(interp, &__t6280)? { - Value::bool(false) - } else { - let __t6281 = { - let __t6276 = Value::nil(); - let __t6279 = { - let __t6278 = { - let __t6277 = v_V2453.clone(); - rt::tl(&__t6277)? - }; - rt::tl(&__t6278)? - }; - rt::eq(&__t6276, &__t6279) - }; - Value::bool(rt::is_truthy(interp, &__t6281)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6283)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6285)?) - } - }; - if match rt::is_truthy(interp, &__t6296) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6286 = Value::sym(interp.intern("pps")); - let __t6295 = { - let __t6289 = { - let __t6288 = { - let __t6287 = v_V2453.clone(); - rt::tl(&__t6287)? - }; - rt::hd(&__t6288)? - }; - let __t6294 = { - let __t6292 = { - let __t6290 = Value::sym(interp.intern("stoutput")); - let __t6291 = Value::nil(); - rt::cons(&__t6290, &__t6291) - }; - let __t6293 = Value::nil(); - rt::cons(&__t6292, &__t6293) - }; - rt::cons(&__t6289, &__t6294) - }; - rt::cons(&__t6286, &__t6295) - }); - } else { - { - let __t6269 = Value::bool(true); - if match rt::is_truthy(interp, &__t6269) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V2453.clone()); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_print_x2e_pprint_x2d_macro(interp: &mut Interp) { - interp.register_native("print.pprint-macro", 1, aot_print_x2e_pprint_x2d_macro); - interp.register_aot_direct("print.pprint-macro", aot_print_x2e_pprint_x2d_macro); -} - -/// AOT-compiled from KL `(defun linelength ...)` -pub fn aot_linelength(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "linelength: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6324 = Value::sym(interp.intern("print.*linelength*")); - rt::apply_direct(interp, "value", &[__t6324])? - }); - } -} - -fn install_linelength(interp: &mut Interp) { - interp.register_native("linelength", 0, aot_linelength); - interp.register_aot_direct("linelength", aot_linelength); -} - -/// AOT-compiled from KL `(defun indentation ...)` -pub fn aot_indentation(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "indentation: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6325 = Value::sym(interp.intern("print.*indentation*")); - rt::apply_direct(interp, "value", &[__t6325])? - }); - } -} - -fn install_indentation(interp: &mut Interp) { - interp.register_native("indentation", 0, aot_indentation); - interp.register_aot_direct("indentation", aot_indentation); -} - -/// AOT-compiled from KL `(defun set-linelength ...)` -pub fn aot_set_x2d_linelength(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "set-linelength: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2455 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6334 = { - let __t6330 = { - let __t6328 = v_V2455.clone(); - rt::apply_direct(interp, "positive?", &[__t6328])? - }; - if !rt::is_truthy(interp, &__t6330)? { - Value::bool(false) - } else { - let __t6331 = { - let __t6329 = v_V2455.clone(); - rt::apply_direct(interp, "integer?", &[__t6329])? - }; - Value::bool(rt::is_truthy(interp, &__t6331)?) - } - }; - if match rt::is_truthy(interp, &__t6334) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6332 = Value::sym(interp.intern("print.*linelength*")); - let __t6333 = v_V2455.clone(); - rt::apply_direct(interp, "set", &[__t6332, __t6333])? - }); - } else { - { - let __t6327 = Value::bool(true); - if match rt::is_truthy(interp, &__t6327) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6326 = Value::str("line length must be a positive integer\n"); - rt::apply_direct(interp, "simple-error", &[__t6326])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_set_x2d_linelength(interp: &mut Interp) { - interp.register_native("set-linelength", 1, aot_set_x2d_linelength); - interp.register_aot_direct("set-linelength", aot_set_x2d_linelength); -} - -/// AOT-compiled from KL `(defun set-indentation ...)` -pub fn aot_set_x2d_indentation(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "set-indentation: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2457 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6343 = { - let __t6339 = { - let __t6337 = v_V2457.clone(); - rt::apply_direct(interp, "positive?", &[__t6337])? - }; - if !rt::is_truthy(interp, &__t6339)? { - Value::bool(false) - } else { - let __t6340 = { - let __t6338 = v_V2457.clone(); - rt::apply_direct(interp, "integer?", &[__t6338])? - }; - Value::bool(rt::is_truthy(interp, &__t6340)?) - } - }; - if match rt::is_truthy(interp, &__t6343) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6341 = Value::sym(interp.intern("print.*indentation*")); - let __t6342 = v_V2457.clone(); - rt::apply_direct(interp, "set", &[__t6341, __t6342])? - }); - } else { - { - let __t6336 = Value::bool(true); - if match rt::is_truthy(interp, &__t6336) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6335 = Value::str("indentation must be a positive integer\n"); - rt::apply_direct(interp, "simple-error", &[__t6335])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_set_x2d_indentation(interp: &mut Interp) { - interp.register_native("set-indentation", 1, aot_set_x2d_indentation); - interp.register_aot_direct("set-indentation", aot_set_x2d_indentation); -} - -/// AOT-compiled from KL `(defun pps ...)` -pub fn aot_pps(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "pps: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2459 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2460 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2461 = { - let __t6344 = v_V2459.clone(); - rt::apply_direct(interp, "ps", &[__t6344])? - }; - { - let v_W2462 = { - let __t6345 = v_W2461.clone(); - let __t6346 = Value::str(""); - let __t6347 = Value::sym(interp.intern("shen.r")); - rt::apply_direct(interp, "shen.app", &[__t6345, __t6346, __t6347])? - }; - { - let v_W2463 = { - let __t6348 = v_W2462.clone(); - rt::apply_direct(interp, "pretty-string", &[__t6348])? - }; - { - let v_W2464 = { - let __t6349 = v_W2463.clone(); - let __t6350 = v_V2460.clone(); - rt::apply_direct(interp, "pr", &[__t6349, __t6350])? - }; - { - let v_W2465 = { - let __t6351 = Value::int(1i64); - rt::apply_direct(interp, "nl", &[__t6351])? - }; - break Ok(v_V2459.clone()); - } - } - } - } - } - } -} - -fn install_pps(interp: &mut Interp) { - interp.register_native("pps", 2, aot_pps); - interp.register_aot_direct("pps", aot_pps); -} - -/// AOT-compiled from KL `(defun pprint ...)` -pub fn aot_pprint(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "pprint: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2468 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2469 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2470 = { - let __t6352 = v_V2468.clone(); - let __t6353 = Value::str(""); - let __t6354 = Value::sym(interp.intern("shen.s")); - rt::apply_direct(interp, "shen.app", &[__t6352, __t6353, __t6354])? - }; - { - let v_W2471 = { - let __t6355 = v_W2470.clone(); - rt::apply_direct(interp, "pretty-string", &[__t6355])? - }; - { - let v_W2472 = { - let __t6356 = v_W2471.clone(); - let __t6357 = v_V2469.clone(); - rt::apply_direct(interp, "pr", &[__t6356, __t6357])? - }; - { - let v_W2473 = { - let __t6358 = Value::int(1i64); - rt::apply_direct(interp, "nl", &[__t6358])? - }; - break Ok(v_V2468.clone()); - } - } - } - } - } -} - -fn install_pprint(interp: &mut Interp) { - interp.register_native("pprint", 2, aot_pprint); - interp.register_aot_direct("pprint", aot_pprint); -} - -/// AOT-compiled from KL `(defun pretty-string ...)` -pub fn aot_pretty_x2d_string(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "pretty-string: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2476 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6359 = v_V2476.clone(); - let __t6360 = Value::int(0i64); - let __t6361 = Value::int(0i64); - rt::apply_direct( - interp, - "print.pretty-string-h", - &[__t6359, __t6360, __t6361], - )? - }); - } -} - -fn install_pretty_x2d_string(interp: &mut Interp) { - interp.register_native("pretty-string", 1, aot_pretty_x2d_string); - interp.register_aot_direct("pretty-string", aot_pretty_x2d_string); -} - -/// AOT-compiled from KL `(defun print.pretty-string-h ...)` -pub fn aot_print_x2e_pretty_x2d_string_x2d_h( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "print.pretty-string-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2482 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2483 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2484 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6461 = { - let __t6459 = Value::str(""); - let __t6460 = v_V2482.clone(); - rt::eq(&__t6459, &__t6460) - }; - if match rt::is_truthy(interp, &__t6461) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t6458 = { - let __t6445 = { - let __t6441 = v_V2482.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t6441])? - }; - if !rt::is_truthy(interp, &__t6445)? { - Value::bool(false) - } else { - let __t6446 = { - let __t6442 = Value::str("["); - let __t6444 = { - let __t6443 = v_V2482.clone(); - rt::apply_direct(interp, "hdstr", &[__t6443])? - }; - rt::eq(&__t6442, &__t6444) - }; - Value::bool(rt::is_truthy(interp, &__t6446)?) - } - }; - if match rt::is_truthy(interp, &__t6458) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6448 = { - let __t6447 = v_V2483.clone(); - rt::apply_direct(interp, "print.indent", &[__t6447])? - }; - let __t6457 = { - let __t6449 = Value::str("["); - let __t6456 = { - let __t6451 = { - let __t6450 = v_V2482.clone(); - rt::apply_direct(interp, "tlstr", &[__t6450])? - }; - let __t6454 = { - let __t6452 = v_V2483.clone(); - let __t6453 = Value::int(1i64); - rt::add(&__t6452, &__t6453)? - }; - let __t6455 = Value::int(0i64); - rt::apply_direct( - interp, - "print.pretty-string-h", - &[__t6451, __t6454, __t6455], - )? - }; - rt::apply_direct(interp, "@s", &[__t6449, __t6456])? - }; - rt::apply_direct(interp, "@s", &[__t6448, __t6457])? - }); - } else { - { - let __t6440 = { - let __t6427 = { - let __t6423 = v_V2482.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t6423])? - }; - if !rt::is_truthy(interp, &__t6427)? { - Value::bool(false) - } else { - let __t6428 = { - let __t6424 = Value::str("("); - let __t6426 = { - let __t6425 = v_V2482.clone(); - rt::apply_direct(interp, "hdstr", &[__t6425])? - }; - rt::eq(&__t6424, &__t6426) - }; - Value::bool(rt::is_truthy(interp, &__t6428)?) - } - }; - if match rt::is_truthy(interp, &__t6440) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6430 = { - let __t6429 = v_V2483.clone(); - rt::apply_direct(interp, "print.indent", &[__t6429])? - }; - let __t6439 = { - let __t6431 = Value::str("("); - let __t6438 = { - let __t6433 = { - let __t6432 = v_V2482.clone(); - rt::apply_direct(interp, "tlstr", &[__t6432])? - }; - let __t6436 = { - let __t6434 = v_V2483.clone(); - let __t6435 = Value::int(1i64); - rt::add(&__t6434, &__t6435)? - }; - let __t6437 = Value::int(0i64); - rt::apply_direct( - interp, - "print.pretty-string-h", - &[__t6433, __t6436, __t6437], - )? - }; - rt::apply_direct(interp, "@s", &[__t6431, __t6438])? - }; - rt::apply_direct(interp, "@s", &[__t6430, __t6439])? - }); - } else { - { - let __t6422 = { - let __t6412 = { - let __t6408 = v_V2482.clone(); - rt::apply_direct(interp, "shen.+string?", &[__t6408])? - }; - if !rt::is_truthy(interp, &__t6412)? { - Value::bool(false) - } else { - let __t6413 = { - let __t6409 = Value::str("]"); - let __t6411 = { - let __t6410 = v_V2482.clone(); - rt::apply_direct(interp, "hdstr", &[__t6410])? - }; - rt::eq(&__t6409, &__t6411) - }; - Value::bool(rt::is_truthy(interp, &__t6413)?) - } - }; - if match rt::is_truthy(interp, &__t6422) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6414 = Value::str("]"); - let __t6421 = { - let __t6416 = { - let __t6415 = v_V2482.clone(); - rt::apply_direct(interp, "tlstr", &[__t6415])? - }; - let __t6419 = { - let __t6417 = v_V2483.clone(); - let __t6418 = Value::int(1i64); - rt::sub(&__t6417, &__t6418)? - }; - let __t6420 = Value::int(0i64); - rt::apply_direct( - interp, - "print.pretty-string-h", - &[__t6416, __t6419, __t6420], - )? - }; - rt::apply_direct(interp, "@s", &[__t6414, __t6421])? - }); - } else { - { - let __t6407 = { - let __t6397 = { - let __t6393 = v_V2482.clone(); - rt::apply_direct( - interp, - "shen.+string?", - &[__t6393], - )? - }; - if !rt::is_truthy(interp, &__t6397)? { - Value::bool(false) - } else { - let __t6398 = { - let __t6394 = Value::str(")"); - let __t6396 = { - let __t6395 = v_V2482.clone(); - rt::apply_direct( - interp, - "hdstr", - &[__t6395], - )? - }; - rt::eq(&__t6394, &__t6396) - }; - Value::bool(rt::is_truthy(interp, &__t6398)?) - } - }; - if match rt::is_truthy(interp, &__t6407) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6399 = Value::str(")"); - let __t6406 = { - let __t6401 = { - let __t6400 = v_V2482.clone(); - rt::apply_direct( - interp, - "tlstr", - &[__t6400], - )? - }; - let __t6404 = { - let __t6402 = v_V2483.clone(); - let __t6403 = Value::int(1i64); - rt::sub(&__t6402, &__t6403)? - }; - let __t6405 = Value::int(0i64); - rt::apply_direct( - interp, - "print.pretty-string-h", - &[__t6401, __t6404, __t6405], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t6399, __t6406], - )? - }); - } else { - { - let __t6392 = { - let __t6383 = { - let __t6375 = v_V2482.clone(); - rt::apply_direct( - interp, - "shen.+string?", - &[__t6375], - )? - }; - if !rt::is_truthy(interp, &__t6383)? { - Value::bool(false) - } else { - let __t6384 = { - let __t6381 = { - let __t6376 = Value::str(" "); - let __t6378 = { - let __t6377 = - v_V2482.clone(); - rt::apply_direct( - interp, - "hdstr", - &[__t6377], - )? - }; - rt::eq(&__t6376, &__t6378) - }; - if !rt::is_truthy(interp, &__t6381)? - { - Value::bool(false) - } else { - let __t6382 = { - let __t6379 = - v_V2484.clone(); - let __t6380 = { - rt::apply_direct( - interp, - "linelength", - &[], - )? - }; - rt::gt(&__t6379, &__t6380)? - }; - Value::bool(rt::is_truthy( - interp, &__t6382, - )?) - } - }; - Value::bool(rt::is_truthy( - interp, &__t6384, - )?) - } - }; - if match rt::is_truthy(interp, &__t6392) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6386 = { - let __t6385 = v_V2483.clone(); - rt::apply_direct( - interp, - "print.indent", - &[__t6385], - )? - }; - let __t6391 = { - let __t6388 = { - let __t6387 = v_V2482.clone(); - rt::apply_direct( - interp, - "tlstr", - &[__t6387], - )? - }; - let __t6389 = v_V2483.clone(); - let __t6390 = Value::int(0i64); - rt::apply_direct( - interp, - "print.pretty-string-h", - &[__t6388, __t6389, __t6390], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t6386, __t6391], - )? - }); - } else { - { - let __t6374 = { - let __t6364 = v_V2482.clone(); - rt::apply_direct( - interp, - "shen.+string?", - &[__t6364], - )? - }; - if match rt::is_truthy(interp, &__t6374) - { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6366 = { - let __t6365 = - v_V2482.clone(); - rt::apply_direct( - interp, - "hdstr", - &[__t6365], - )? - }; - let __t6373 = { - let __t6368 = { - let __t6367 = - v_V2482.clone(); - rt::apply_direct( - interp, - "tlstr", - &[__t6367], - )? - }; - let __t6369 = - v_V2483.clone(); - let __t6372 = { - let __t6370 = - v_V2484.clone(); - let __t6371 = - Value::int(1i64); - rt::add( - &__t6370, &__t6371, - )? - }; - rt::apply_direct( - interp, - "print.pretty-string-h", - &[ - __t6368, __t6369, - __t6372, - ], - )? - }; - rt::apply_direct( - interp, - "@s", - &[__t6366, __t6373], - )? - }); - } else { - { - let __t6363 = Value::bool(true); - if match rt::is_truthy( - interp, &__t6363, - ) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6362 = Value::sym(interp.intern("print.pretty-string-h")); - rt::apply_direct( - interp, - "shen.f-error", - &[__t6362], - )? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } -} - -fn install_print_x2e_pretty_x2d_string_x2d_h(interp: &mut Interp) { - interp.register_native( - "print.pretty-string-h", - 3, - aot_print_x2e_pretty_x2d_string_x2d_h, - ); - interp.register_aot_direct( - "print.pretty-string-h", - aot_print_x2e_pretty_x2d_string_x2d_h, - ); -} - -/// AOT-compiled from KL `(defun print.indent ...)` -pub fn aot_print_x2e_indent(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "print.indent: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2488 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6468 = { - let __t6466 = Value::int(0i64); - let __t6467 = v_V2488.clone(); - rt::eq(&__t6466, &__t6467) - }; - if match rt::is_truthy(interp, &__t6468) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t6465 = Value::bool(true); - if match rt::is_truthy(interp, &__t6465) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6462 = Value::str("\n"); - let __t6464 = { - let __t6463 = v_V2488.clone(); - rt::apply_direct(interp, "print.indent-h", &[__t6463])? - }; - rt::apply_direct(interp, "@s", &[__t6462, __t6464])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_print_x2e_indent(interp: &mut Interp) { - interp.register_native("print.indent", 1, aot_print_x2e_indent); - interp.register_aot_direct("print.indent", aot_print_x2e_indent); -} - -/// AOT-compiled from KL `(defun print.indent-h ...)` -pub fn aot_print_x2e_indent_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "print.indent-h: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2490 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6478 = { - let __t6476 = Value::int(0i64); - let __t6477 = v_V2490.clone(); - rt::eq(&__t6476, &__t6477) - }; - if match rt::is_truthy(interp, &__t6478) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t6475 = Value::bool(true); - if match rt::is_truthy(interp, &__t6475) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6470 = { - let __t6469 = { rt::apply_direct(interp, "indentation", &[])? }; - rt::apply_direct(interp, "print.n-space", &[__t6469])? - }; - let __t6474 = { - let __t6473 = { - let __t6471 = v_V2490.clone(); - let __t6472 = Value::int(1i64); - rt::sub(&__t6471, &__t6472)? - }; - rt::apply_direct(interp, "print.indent-h", &[__t6473])? - }; - rt::apply_direct(interp, "cn", &[__t6470, __t6474])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_print_x2e_indent_x2d_h(interp: &mut Interp) { - interp.register_native("print.indent-h", 1, aot_print_x2e_indent_x2d_h); - interp.register_aot_direct("print.indent-h", aot_print_x2e_indent_x2d_h); -} - -/// AOT-compiled from KL `(defun print.n-space ...)` -pub fn aot_print_x2e_n_x2d_space(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "print.n-space: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2492 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6487 = { - let __t6485 = Value::int(0i64); - let __t6486 = v_V2492.clone(); - rt::eq(&__t6485, &__t6486) - }; - if match rt::is_truthy(interp, &__t6487) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::str("")); - } else { - { - let __t6484 = Value::bool(true); - if match rt::is_truthy(interp, &__t6484) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6479 = Value::str(" "); - let __t6483 = { - let __t6482 = { - let __t6480 = v_V2492.clone(); - let __t6481 = Value::int(1i64); - rt::sub(&__t6480, &__t6481)? - }; - rt::apply_direct(interp, "print.n-space", &[__t6482])? - }; - rt::apply_direct(interp, "cn", &[__t6479, __t6483])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_print_x2e_n_x2d_space(interp: &mut Interp) { - interp.register_native("print.n-space", 1, aot_print_x2e_n_x2d_space); - interp.register_aot_direct("print.n-space", aot_print_x2e_n_x2d_space); -} - -/// AOT-compiled from KL `(defun delete-file ...)` -pub fn aot_delete_x2d_file(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "delete-file: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2495 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6490 = { - let __t6488 = { rt::apply_direct(interp, "language", &[])? }; - let __t6489 = Value::str("Common Lisp"); - rt::eq(&__t6488, &__t6489) - }; - if match rt::is_truthy(interp, &__t6490) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6492 = { - let __t6491 = Value::sym(interp.intern("lisp.delete-file")); - rt::apply_direct(interp, "fn", &[__t6491])? - }; - let __t6493 = v_V2495.clone(); - rt::apply_value(interp, __t6492, &[__t6493])? - }); - } else { - break Ok({ - let __t6496 = { - let __t6494 = v_V2495.clone(); - let __t6495 = Value::sym(interp.intern("out")); - rt::apply_direct(interp, "open", &[__t6494, __t6495])? - }; - rt::apply_direct(interp, "close", &[__t6496])? - }); - } - } - } -} - -fn install_delete_x2d_file(interp: &mut Interp) { - interp.register_native("delete-file", 1, aot_delete_x2d_file); - interp.register_aot_direct("delete-file", aot_delete_x2d_file); -} - -/// AOT-compiled from KL `(defun file.file-macro ...)` -pub fn aot_file_x2e_file_x2d_macro(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "file.file-macro: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2523 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6605 = { - let __t6525 = { - let __t6498 = v_V2523.clone(); - rt::is_cons(&__t6498) - }; - if !rt::is_truthy(interp, &__t6525)? { - Value::bool(false) - } else { - let __t6526 = { - let __t6523 = { - let __t6499 = Value::sym(interp.intern("errout")); - let __t6501 = { - let __t6500 = v_V2523.clone(); - rt::hd(&__t6500)? - }; - rt::eq(&__t6499, &__t6501) - }; - if !rt::is_truthy(interp, &__t6523)? { - Value::bool(false) - } else { - let __t6524 = { - let __t6521 = { - let __t6503 = { - let __t6502 = v_V2523.clone(); - rt::tl(&__t6502)? - }; - rt::is_cons(&__t6503) - }; - if !rt::is_truthy(interp, &__t6521)? { - Value::bool(false) - } else { - let __t6522 = { - let __t6519 = { - let __t6506 = { - let __t6505 = { - let __t6504 = v_V2523.clone(); - rt::tl(&__t6504)? - }; - rt::tl(&__t6505)? - }; - rt::is_cons(&__t6506) - }; - if !rt::is_truthy(interp, &__t6519)? { - Value::bool(false) - } else { - let __t6520 = { - let __t6517 = { - let __t6510 = { - let __t6509 = { - let __t6508 = { - let __t6507 = v_V2523.clone(); - rt::tl(&__t6507)? - }; - rt::tl(&__t6508)? - }; - rt::tl(&__t6509)? - }; - rt::is_cons(&__t6510) - }; - if !rt::is_truthy(interp, &__t6517)? { - Value::bool(false) - } else { - let __t6518 = { - let __t6511 = Value::nil(); - let __t6516 = { - let __t6515 = { - let __t6514 = { - let __t6513 = { - let __t6512 = - v_V2523.clone(); - rt::tl(&__t6512)? - }; - rt::tl(&__t6513)? - }; - rt::tl(&__t6514)? - }; - rt::tl(&__t6515)? - }; - rt::eq(&__t6511, &__t6516) - }; - Value::bool(rt::is_truthy(interp, &__t6518)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6520)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6522)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6524)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6526)?) - } - }; - if match rt::is_truthy(interp, &__t6605) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W2524 = { rt::apply_direct(interp, "newv", &[])? }; - { - let v_W2525 = { rt::apply_direct(interp, "newv", &[])? }; - { - let v_W2526 = { rt::apply_direct(interp, "newv", &[])? }; - { - let v_W2527 = { rt::apply_direct(interp, "newv", &[])? }; - { - let v_W2528 = { rt::apply_direct(interp, "newv", &[])? }; - break Ok({ - let __t6527 = Value::sym(interp.intern("trap-error")); - let __t6604 = { - let __t6530 = { - let __t6529 = { - let __t6528 = v_V2523.clone(); - rt::tl(&__t6528)? - }; - rt::hd(&__t6529)? - }; - let __t6603 = { - let __t6601 = { - let __t6531 = Value::sym(interp.intern("/.")); - let __t6600 = { - let __t6532 = v_W2528.clone(); - let __t6599 = { - let __t6597 = { - let __t6533 = Value::sym( - interp.intern("let"), - ); - let __t6596 = { - let __t6534 = v_W2524.clone(); - let __t6595 = { - let __t6539 = { - let __t6535 = Value::sym(interp.intern("error-to-string")); - let __t6538 = { - let __t6536 = - v_W2528.clone(); - let __t6537 = - Value::nil(); - rt::cons( - &__t6536, - &__t6537, - ) - }; - rt::cons( - &__t6535, &__t6538, - ) - }; - let __t6594 = { - let __t6540 = - v_W2525.clone(); - let __t6593 = { - let __t6568 = { - let __t6541 = Value::sym(interp.intern("trap-error")); - let __t6567 = { - let __t6547 = { - let __t6542 = Value::sym(interp.intern("reopen")); - let __t6546 = { - let __t6545 = { let __t6544 = { let __t6543 = v_V2523.clone(); rt::tl(&__t6543)? }; rt::tl(&__t6544)? }; - rt::tl(&__t6545)? - }; - rt::cons(&__t6542, &__t6546) - }; - let __t6566 = { - let __t6564 = { - let __t6548 = Value::sym(interp.intern("/.")); - let __t6563 = { let __t6549 = v_W2528.clone(); let __t6562 = { let __t6560 = { let __t6550 = Value::sym(interp.intern("open")); let __t6559 = { let __t6555 = { let __t6554 = { let __t6553 = { let __t6552 = { let __t6551 = v_V2523.clone(); rt::tl(&__t6551)? }; rt::tl(&__t6552)? }; rt::tl(&__t6553)? }; rt::hd(&__t6554)? }; let __t6558 = { let __t6556 = Value::sym(interp.intern("out")); let __t6557 = Value::nil(); rt::cons(&__t6556, &__t6557) }; rt::cons(&__t6555, &__t6558) }; rt::cons(&__t6550, &__t6559) }; let __t6561 = Value::nil(); rt::cons(&__t6560, &__t6561) }; rt::cons(&__t6549, &__t6562) }; - rt::cons(&__t6548, &__t6563) - }; - let __t6565 = Value::nil(); - rt::cons(&__t6564, &__t6565) - }; - rt::cons(&__t6547, &__t6566) - }; - rt::cons( - &__t6541, - &__t6567, - ) - }; - let __t6592 = { - let __t6569 = - v_W2526 - .clone( - ); - let __t6591 = { - let __t6576 = { - let __t6570 = Value::sym(interp.intern("pr")); - let __t6575 = { - let __t6571 = v_W2524.clone(); - let __t6574 = { let __t6572 = v_W2525.clone(); let __t6573 = Value::nil(); rt::cons(&__t6572, &__t6573) }; - rt::cons(&__t6571, &__t6574) - }; - rt::cons(&__t6570, &__t6575) - }; - let __t6590 = { - let __t6577 = v_W2527.clone(); - let __t6589 = { - let __t6582 = { let __t6578 = Value::sym(interp.intern("close")); let __t6581 = { let __t6579 = v_W2525.clone(); let __t6580 = Value::nil(); rt::cons(&__t6579, &__t6580) }; rt::cons(&__t6578, &__t6581) }; - let __t6588 = { let __t6586 = { let __t6585 = { let __t6584 = { let __t6583 = v_V2523.clone(); rt::tl(&__t6583)? }; rt::tl(&__t6584)? }; rt::hd(&__t6585)? }; let __t6587 = Value::nil(); rt::cons(&__t6586, &__t6587) }; - rt::cons(&__t6582, &__t6588) - }; - rt::cons(&__t6577, &__t6589) - }; - rt::cons(&__t6576, &__t6590) - }; - rt::cons( - &__t6569, - &__t6591, - ) - }; - rt::cons( - &__t6568, - &__t6592, - ) - }; - rt::cons( - &__t6540, &__t6593, - ) - }; - rt::cons(&__t6539, &__t6594) - }; - rt::cons(&__t6534, &__t6595) - }; - rt::cons(&__t6533, &__t6596) - }; - let __t6598 = Value::nil(); - rt::cons(&__t6597, &__t6598) - }; - rt::cons(&__t6532, &__t6599) - }; - rt::cons(&__t6531, &__t6600) - }; - let __t6602 = Value::nil(); - rt::cons(&__t6601, &__t6602) - }; - rt::cons(&__t6530, &__t6603) - }; - rt::cons(&__t6527, &__t6604) - }); - } - } - } - } - } - } else { - { - let __t6497 = Value::bool(true); - if match rt::is_truthy(interp, &__t6497) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V2523.clone()); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_file_x2e_file_x2d_macro(interp: &mut Interp) { - interp.register_native("file.file-macro", 1, aot_file_x2e_file_x2d_macro); - interp.register_aot_direct("file.file-macro", aot_file_x2e_file_x2d_macro); -} - -/// AOT-compiled from KL `(defun append-files ...)` -pub fn aot_append_x2d_files(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "append-files: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2530 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2531 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2532 = { - let __t6606 = v_V2530.clone(); - let __t6607 = v_V2531.clone(); - rt::apply_direct(interp, "append-files-with-open-stream", &[__t6606, __t6607])? - }; - { - let v_W2533 = { - let __t6608 = v_W2532.clone(); - rt::apply_direct(interp, "close", &[__t6608])? - }; - break Ok(v_V2531.clone()); - } - } - } -} - -fn install_append_x2d_files(interp: &mut Interp) { - interp.register_native("append-files", 2, aot_append_x2d_files); - interp.register_aot_direct("append-files", aot_append_x2d_files); -} - -/// AOT-compiled from KL `(defun append-files-with-open-stream ...)` -pub fn aot_append_x2d_files_x2d_with_x2d_open_x2d_stream( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "append-files-with-open-stream: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2536 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2537 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6626 = { - let __t6618 = v_V2537.clone(); - let __t6619 = v_V2536.clone(); - rt::apply_direct(interp, "element?", &[__t6618, __t6619])? - }; - if match rt::is_truthy(interp, &__t6626) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6625 = { - let __t6620 = Value::str("cannot read and write to "); - let __t6624 = { - let __t6621 = v_V2537.clone(); - let __t6622 = Value::str(" at the same time\n"); - let __t6623 = Value::sym(interp.intern("shen.a")); - rt::apply_direct(interp, "shen.app", &[__t6621, __t6622, __t6623])? - }; - rt::apply_direct(interp, "cn", &[__t6620, __t6624])? - }; - rt::apply_direct(interp, "simple-error", &[__t6625])? - }); - } else { - { - let __t6617 = Value::bool(true); - if match rt::is_truthy(interp, &__t6617) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let v_W2538 = { - let __t6609 = v_V2537.clone(); - let __t6610 = Value::sym(interp.intern("out")); - rt::apply_direct(interp, "open", &[__t6609, __t6610])? - }; - { - let v_W2539 = { - let __t6615 = { - let v_W2538 = v_W2538.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2540 = args[0].clone(); - Ok({ - let __t6613 = { - let __t6611 = v_Z2540.clone(); - let __t6612 = - Value::sym(interp.intern("in")); - rt::apply_direct( - interp, - "open", - &[__t6611, __t6612], - )? - }; - let __t6614 = v_W2538.clone(); - rt::apply_direct( - interp, - "file.read&write", - &[__t6613, __t6614], - )? - }) - }, - vec![v_W2538], - interp, - ) - }; - let __t6616 = v_V2536.clone(); - rt::apply_direct(interp, "mapc", &[__t6615, __t6616])? - }; - break Ok(v_W2538.clone()); - } - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_append_x2d_files_x2d_with_x2d_open_x2d_stream(interp: &mut Interp) { - interp.register_native( - "append-files-with-open-stream", - 2, - aot_append_x2d_files_x2d_with_x2d_open_x2d_stream, - ); - interp.register_aot_direct( - "append-files-with-open-stream", - aot_append_x2d_files_x2d_with_x2d_open_x2d_stream, - ); -} - -/// AOT-compiled from KL `(defun file.read&write ...)` -pub fn aot_file_x2e_read_x26_write(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "file.read&write: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2543 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2544 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6628 = { - let __t6627 = v_V2543.clone(); - rt::apply_direct(interp, "read-byte", &[__t6627])? - }; - let __t6629 = v_V2543.clone(); - let __t6630 = v_V2544.clone(); - rt::apply_direct(interp, "file.read&write-h", &[__t6628, __t6629, __t6630])? - }); - } -} - -fn install_file_x2e_read_x26_write(interp: &mut Interp) { - interp.register_native("file.read&write", 2, aot_file_x2e_read_x26_write); - interp.register_aot_direct("file.read&write", aot_file_x2e_read_x26_write); -} - -/// AOT-compiled from KL `(defun file.read&write-h ...)` -pub fn aot_file_x2e_read_x26_write_x2d_h(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "file.read&write-h: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2547 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2548 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2549 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6640 = { - let __t6638 = Value::int(-1i64); - let __t6639 = v_V2547.clone(); - rt::eq(&__t6638, &__t6639) - }; - if match rt::is_truthy(interp, &__t6640) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::int(-1i64)); - } else { - { - let __t6637 = Value::bool(true); - if match rt::is_truthy(interp, &__t6637) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t6632 = { - let __t6631 = v_V2548.clone(); - rt::apply_direct(interp, "read-byte", &[__t6631])? - }; - let __t6633 = v_V2548.clone(); - let __t6636 = { - let _ = { - let __t6634 = v_V2547.clone(); - let __t6635 = v_V2549.clone(); - rt::apply_direct(interp, "write-byte", &[__t6634, __t6635])? - }; - v_V2549.clone() - }; - v_V2547 = __t6632; - v_V2548 = __t6633; - v_V2549 = __t6636; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_file_x2e_read_x26_write_x2d_h(interp: &mut Interp) { - interp.register_native("file.read&write-h", 3, aot_file_x2e_read_x26_write_x2d_h); - interp.register_aot_direct("file.read&write-h", aot_file_x2e_read_x26_write_x2d_h); -} - -/// AOT-compiled from KL `(defun reopen ...)` -pub fn aot_reopen(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "reopen: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2553 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2554 = { - let __t6641 = v_V2553.clone(); - rt::apply_direct(interp, "read-file-as-bytelist", &[__t6641])? - }; - { - let v_W2555 = { - let __t6642 = v_V2553.clone(); - let __t6643 = Value::sym(interp.intern("out")); - rt::apply_direct(interp, "open", &[__t6642, __t6643])? - }; - { - let v_W2556 = { - let __t6646 = { - let v_W2555 = v_W2555.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2557 = args[0].clone(); - Ok({ - let __t6644 = v_Z2557.clone(); - let __t6645 = v_W2555.clone(); - rt::apply_direct(interp, "write-byte", &[__t6644, __t6645])? - }) - }, - vec![v_W2555], - interp, - ) - }; - let __t6647 = v_W2554.clone(); - rt::apply_direct(interp, "mapc", &[__t6646, __t6647])? - }; - break Ok(v_W2555.clone()); - } - } - } - } -} - -fn install_reopen(interp: &mut Interp) { - interp.register_native("reopen", 1, aot_reopen); - interp.register_aot_direct("reopen", aot_reopen); -} - -/// AOT-compiled from KL `(defun copy-file ...)` -pub fn aot_copy_x2d_file(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "copy-file: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2559 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2560 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6650 = { - let __t6648 = v_V2559.clone(); - let __t6649 = Value::nil(); - rt::cons(&__t6648, &__t6649) - }; - let __t6651 = v_V2560.clone(); - rt::apply_direct(interp, "append-files", &[__t6650, __t6651])? - }); - } -} - -fn install_copy_x2d_file(interp: &mut Interp) { - interp.register_native("copy-file", 2, aot_copy_x2d_file); - interp.register_aot_direct("copy-file", aot_copy_x2d_file); -} - -/// AOT-compiled from KL `(defun copy-file-with-open-stream ...)` -pub fn aot_copy_x2d_file_x2d_with_x2d_open_x2d_stream( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "copy-file-with-open-stream: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2563 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2564 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok({ - let __t6654 = { - let __t6652 = v_V2563.clone(); - let __t6653 = Value::nil(); - rt::cons(&__t6652, &__t6653) - }; - let __t6655 = v_V2564.clone(); - rt::apply_direct(interp, "append-files-with-open-stream", &[__t6654, __t6655])? - }); - } -} - -fn install_copy_x2d_file_x2d_with_x2d_open_x2d_stream(interp: &mut Interp) { - interp.register_native( - "copy-file-with-open-stream", - 2, - aot_copy_x2d_file_x2d_with_x2d_open_x2d_stream, - ); - interp.register_aot_direct( - "copy-file-with-open-stream", - aot_copy_x2d_file_x2d_with_x2d_open_x2d_stream, - ); -} - -/// AOT-compiled from KL `(defun file-exists? ...)` -pub fn aot_file_x2d_exists_x3f_(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "file-exists?: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2567 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - break Ok( - match (|| -> ShenResult { - Ok({ - let _ = { - let __t6658 = { - let __t6656 = v_V2567.clone(); - let __t6657 = Value::sym(interp.intern("in")); - rt::apply_direct(interp, "open", &[__t6656, __t6657])? - }; - rt::apply_direct(interp, "close", &[__t6658])? - }; - Value::bool(true) - }) - })() { - Ok(v) => v, - Err(e) => { - let __h = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2568 = args[0].clone(); - Ok(Value::bool(false)) - }, - Vec::new(), - interp, - ) - }; - let __err = Value::err(e.message.clone()); - rt::apply_value(interp, __h, &[__err])? - } - }, - ); - } -} - -fn install_file_x2d_exists_x3f_(interp: &mut Interp) { - interp.register_native("file-exists?", 1, aot_file_x2d_exists_x3f_); - interp.register_aot_direct("file-exists?", aot_file_x2d_exists_x3f_); -} - -/// AOT-compiled from KL `(defun file-size ...)` -pub fn aot_file_x2d_size(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 1 { - return Err(ShenError::new(format!( - "file-size: expected 1 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2570 = args[0].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2571 = { - let __t6659 = v_V2570.clone(); - let __t6660 = Value::sym(interp.intern("in")); - rt::apply_direct(interp, "open", &[__t6659, __t6660])? - }; - { - let v_W2572 = { - let __t6661 = v_W2571.clone(); - let __t6662 = Value::int(0i64); - let __t6664 = { - let __t6663 = v_W2571.clone(); - rt::apply_direct(interp, "read-byte", &[__t6663])? - }; - rt::apply_direct(interp, "file.file-size-loop", &[__t6661, __t6662, __t6664])? - }; - { - let v_W2573 = { - let __t6665 = v_W2571.clone(); - rt::apply_direct(interp, "close", &[__t6665])? - }; - break Ok(v_W2572.clone()); - } - } - } - } -} - -fn install_file_x2d_size(interp: &mut Interp) { - interp.register_native("file-size", 1, aot_file_x2d_size); - interp.register_aot_direct("file-size", aot_file_x2d_size); -} - -/// AOT-compiled from KL `(defun file.file-size-loop ...)` -pub fn aot_file_x2e_file_x2d_size_x2d_loop( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "file.file-size-loop: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2579 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2580 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2581 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6675 = { - let __t6673 = Value::int(-1i64); - let __t6674 = v_V2581.clone(); - rt::eq(&__t6673, &__t6674) - }; - if match rt::is_truthy(interp, &__t6675) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V2580.clone()); - } else { - { - let __t6672 = Value::bool(true); - if match rt::is_truthy(interp, &__t6672) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t6666 = v_V2579.clone(); - let __t6669 = { - let __t6667 = Value::int(1i64); - let __t6668 = v_V2580.clone(); - rt::add(&__t6667, &__t6668)? - }; - let __t6671 = { - let __t6670 = v_V2579.clone(); - rt::apply_direct(interp, "read-byte", &[__t6670])? - }; - v_V2579 = __t6666; - v_V2580 = __t6669; - v_V2581 = __t6671; - continue; - } - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } -} - -fn install_file_x2e_file_x2d_size_x2d_loop(interp: &mut Interp) { - interp.register_native( - "file.file-size-loop", - 3, - aot_file_x2e_file_x2d_size_x2d_loop, - ); - interp.register_aot_direct("file.file-size-loop", aot_file_x2e_file_x2d_size_x2d_loop); -} - -/// AOT-compiled from KL `(defun ascii ...)` -pub fn aot_ascii(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 3 { - return Err(ShenError::new(format!( - "ascii: expected 3 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2585 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2586 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2587 = args[2].clone(); - #[allow(clippy::never_loop)] - loop { - { - let v_W2588 = { - let __t6676 = v_V2587.clone(); - rt::apply_direct(interp, "read-file-as-bytelist", &[__t6676])? - }; - break Ok({ - let __t6677 = v_V2585.clone(); - let __t6678 = v_V2586.clone(); - let __t6679 = v_W2588.clone(); - let __t6680 = Value::str(""); - rt::apply_direct( - interp, - "file.scan-bytes", - &[__t6677, __t6678, __t6679, __t6680], - )? - }); - } - } -} - -fn install_ascii(interp: &mut Interp) { - interp.register_native("ascii", 3, aot_ascii); - interp.register_aot_direct("ascii", aot_ascii); -} - -/// AOT-compiled from KL `(defun file.scan-bytes ...)` -pub fn aot_file_x2e_scan_x2d_bytes(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 4 { - return Err(ShenError::new(format!( - "file.scan-bytes: expected 4 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2594 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2595 = args[1].clone(); - #[allow(unused_mut)] - let mut v_V2596 = args[2].clone(); - #[allow(unused_mut)] - let mut v_V2597 = args[3].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6720 = { - let __t6718 = Value::nil(); - let __t6719 = v_V2596.clone(); - rt::eq(&__t6718, &__t6719) - }; - if match rt::is_truthy(interp, &__t6720) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(v_V2597.clone()); - } else { - { - let __t6717 = { - let __t6706 = { - let __t6697 = v_V2596.clone(); - rt::is_cons(&__t6697) - }; - if !rt::is_truthy(interp, &__t6706)? { - Value::bool(false) - } else { - let __t6707 = { - let __t6704 = { - let __t6699 = { - let __t6698 = v_V2596.clone(); - rt::hd(&__t6698)? - }; - let __t6700 = v_V2594.clone(); - rt::gte(&__t6699, &__t6700)? - }; - if !rt::is_truthy(interp, &__t6704)? { - Value::bool(false) - } else { - let __t6705 = { - let __t6702 = { - let __t6701 = v_V2596.clone(); - rt::hd(&__t6701)? - }; - let __t6703 = v_V2595.clone(); - rt::lte(&__t6702, &__t6703)? - }; - Value::bool(rt::is_truthy(interp, &__t6705)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6707)?) - } - }; - if match rt::is_truthy(interp, &__t6717) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t6708 = v_V2594.clone(); - let __t6709 = v_V2595.clone(); - let __t6711 = { - let __t6710 = v_V2596.clone(); - rt::tl(&__t6710)? - }; - let __t6716 = { - let __t6712 = v_V2597.clone(); - let __t6715 = { - let __t6714 = { - let __t6713 = v_V2596.clone(); - rt::hd(&__t6713)? - }; - rt::apply_direct(interp, "n->string", &[__t6714])? - }; - rt::apply_direct(interp, "cn", &[__t6712, __t6715])? - }; - v_V2594 = __t6708; - v_V2595 = __t6709; - v_V2596 = __t6711; - v_V2597 = __t6716; - continue; - } - } else { - { - let __t6696 = { - let __t6683 = v_V2596.clone(); - rt::is_cons(&__t6683) - }; - if match rt::is_truthy(interp, &__t6696) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6695 = { - let __t6684 = Value::str("character has code "); - let __t6694 = { - let __t6686 = { - let __t6685 = v_V2596.clone(); - rt::hd(&__t6685)? - }; - let __t6692 = { - let __t6687 = Value::str(": parsed to here\n\n"); - let __t6691 = { - let __t6688 = v_V2597.clone(); - let __t6689 = Value::str(""); - let __t6690 = - Value::sym(interp.intern("shen.a")); - rt::apply_direct( - interp, - "shen.app", - &[__t6688, __t6689, __t6690], - )? - }; - rt::apply_direct(interp, "cn", &[__t6687, __t6691])? - }; - let __t6693 = Value::sym(interp.intern("shen.a")); - rt::apply_direct( - interp, - "shen.app", - &[__t6686, __t6692, __t6693], - )? - }; - rt::apply_direct(interp, "cn", &[__t6684, __t6694])? - }; - rt::apply_direct(interp, "simple-error", &[__t6695])? - }); - } else { - { - let __t6682 = Value::bool(true); - if match rt::is_truthy(interp, &__t6682) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6681 = - Value::sym(interp.intern("file.scan-bytes")); - rt::apply_direct(interp, "shen.f-error", &[__t6681])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_file_x2e_scan_x2d_bytes(interp: &mut Interp) { - interp.register_native("file.scan-bytes", 4, aot_file_x2e_scan_x2d_bytes); - interp.register_aot_direct("file.scan-bytes", aot_file_x2e_scan_x2d_bytes); -} - -/// AOT-compiled from KL `(defun pairoff ...)` -pub fn aot_pairoff(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "pairoff: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2616 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2617 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6743 = { - let __t6741 = Value::nil(); - let __t6742 = v_V2616.clone(); - rt::eq(&__t6741, &__t6742) - }; - if match rt::is_truthy(interp, &__t6743) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t6740 = { - let __t6738 = Value::nil(); - let __t6739 = v_V2617.clone(); - rt::eq(&__t6738, &__t6739) - }; - if match rt::is_truthy(interp, &__t6740) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t6737 = { - let __t6725 = { - let __t6723 = v_V2616.clone(); - rt::is_cons(&__t6723) - }; - if !rt::is_truthy(interp, &__t6725)? { - Value::bool(false) - } else { - let __t6726 = { - let __t6724 = v_V2617.clone(); - rt::is_cons(&__t6724) - }; - Value::bool(rt::is_truthy(interp, &__t6726)?) - } - }; - if match rt::is_truthy(interp, &__t6737) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6731 = { - let __t6728 = { - let __t6727 = v_V2616.clone(); - rt::hd(&__t6727)? - }; - let __t6730 = { - let __t6729 = v_V2617.clone(); - rt::hd(&__t6729)? - }; - rt::apply_direct(interp, "@p", &[__t6728, __t6730])? - }; - let __t6736 = { - let __t6733 = { - let __t6732 = v_V2616.clone(); - rt::tl(&__t6732)? - }; - let __t6735 = { - let __t6734 = v_V2617.clone(); - rt::tl(&__t6734)? - }; - rt::apply_direct(interp, "pairoff", &[__t6733, __t6735])? - }; - rt::cons(&__t6731, &__t6736) - }); - } else { - { - let __t6722 = Value::bool(true); - if match rt::is_truthy(interp, &__t6722) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6721 = Value::sym(interp.intern("pairoff")); - rt::apply_direct(interp, "shen.f-error", &[__t6721])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_pairoff(interp: &mut Interp) { - interp.register_native("pairoff", 2, aot_pairoff); - interp.register_aot_direct("pairoff", aot_pairoff); -} - -/// AOT-compiled from KL `(defun assocp ...)` -pub fn aot_assocp(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "assocp: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2627 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2628 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6767 = { - let __t6764 = Value::nil(); - let __t6765 = v_V2628.clone(); - rt::eq(&__t6764, &__t6765) - }; - if match rt::is_truthy(interp, &__t6767) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6766 = Value::str("pair not found\n"); - rt::apply_direct(interp, "simple-error", &[__t6766])? - }); - } else { - { - let __t6763 = { - let __t6760 = { - let __t6751 = v_V2628.clone(); - rt::is_cons(&__t6751) - }; - if !rt::is_truthy(interp, &__t6760)? { - Value::bool(false) - } else { - let __t6761 = { - let __t6758 = { - let __t6753 = { - let __t6752 = v_V2628.clone(); - rt::hd(&__t6752)? - }; - rt::apply_direct(interp, "tuple?", &[__t6753])? - }; - if !rt::is_truthy(interp, &__t6758)? { - Value::bool(false) - } else { - let __t6759 = { - let __t6754 = v_V2627.clone(); - let __t6757 = { - let __t6756 = { - let __t6755 = v_V2628.clone(); - rt::hd(&__t6755)? - }; - rt::apply_direct(interp, "fst", &[__t6756])? - }; - rt::eq(&__t6754, &__t6757) - }; - Value::bool(rt::is_truthy(interp, &__t6759)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6761)?) - } - }; - if match rt::is_truthy(interp, &__t6763) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6762 = v_V2628.clone(); - rt::hd(&__t6762)? - }); - } else { - { - let __t6750 = { - let __t6746 = v_V2628.clone(); - rt::is_cons(&__t6746) - }; - if match rt::is_truthy(interp, &__t6750) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t6747 = v_V2627.clone(); - let __t6749 = { - let __t6748 = v_V2628.clone(); - rt::tl(&__t6748)? - }; - v_V2627 = __t6747; - v_V2628 = __t6749; - continue; - } - } else { - { - let __t6745 = Value::bool(true); - if match rt::is_truthy(interp, &__t6745) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6744 = Value::sym(interp.intern("assocp")); - rt::apply_direct(interp, "shen.f-error", &[__t6744])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_assocp(interp: &mut Interp) { - interp.register_native("assocp", 2, aot_assocp); - interp.register_aot_direct("assocp", aot_assocp); -} - -/// AOT-compiled from KL `(defun cartprodp ...)` -pub fn aot_cartprodp(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "cartprodp: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2633 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2634 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6784 = { - let __t6782 = Value::nil(); - let __t6783 = v_V2633.clone(); - rt::eq(&__t6782, &__t6783) - }; - if match rt::is_truthy(interp, &__t6784) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok(Value::nil()); - } else { - { - let __t6781 = { - let __t6770 = v_V2633.clone(); - rt::is_cons(&__t6770) - }; - if match rt::is_truthy(interp, &__t6781) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6776 = { - let __t6774 = { - let v_V2633 = v_V2633.clone(); - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Z2635 = args[0].clone(); - Ok({ - let __t6772 = { - let __t6771 = v_V2633.clone(); - rt::hd(&__t6771)? - }; - let __t6773 = v_Z2635.clone(); - rt::apply_direct(interp, "@p", &[__t6772, __t6773])? - }) - }, - vec![v_V2633], - interp, - ) - }; - let __t6775 = v_V2634.clone(); - rt::apply_direct(interp, "map", &[__t6774, __t6775])? - }; - let __t6780 = { - let __t6778 = { - let __t6777 = v_V2633.clone(); - rt::tl(&__t6777)? - }; - let __t6779 = v_V2634.clone(); - rt::apply_direct(interp, "cartprodp", &[__t6778, __t6779])? - }; - rt::apply_direct(interp, "append", &[__t6776, __t6780])? - }); - } else { - { - let __t6769 = Value::bool(true); - if match rt::is_truthy(interp, &__t6769) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6768 = Value::sym(interp.intern("cartprodp")); - rt::apply_direct(interp, "shen.f-error", &[__t6768])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } -} - -fn install_cartprodp(interp: &mut Interp) { - interp.register_native("cartprodp", 2, aot_cartprodp); - interp.register_aot_direct("cartprodp", aot_cartprodp); -} - -/// AOT-compiled from KL `(defun assocp-if ...)` -pub fn aot_assocp_x2d_if(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "assocp-if: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2643 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2644 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6807 = { - let __t6804 = Value::nil(); - let __t6805 = v_V2644.clone(); - rt::eq(&__t6804, &__t6805) - }; - if match rt::is_truthy(interp, &__t6807) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6806 = Value::str("pair not found\n"); - rt::apply_direct(interp, "simple-error", &[__t6806])? - }); - } else { - { - let __t6803 = { - let __t6800 = { - let __t6792 = v_V2644.clone(); - rt::is_cons(&__t6792) - }; - if !rt::is_truthy(interp, &__t6800)? { - Value::bool(false) - } else { - let __t6801 = { - let __t6798 = { - let __t6794 = { - let __t6793 = v_V2644.clone(); - rt::hd(&__t6793)? - }; - rt::apply_direct(interp, "tuple?", &[__t6794])? - }; - if !rt::is_truthy(interp, &__t6798)? { - Value::bool(false) - } else { - let __t6799 = { - let __t6797 = { - let __t6796 = { - let __t6795 = v_V2644.clone(); - rt::hd(&__t6795)? - }; - rt::apply_direct(interp, "fst", &[__t6796])? - }; - rt::apply_value(interp, v_V2643.clone(), &[__t6797])? - }; - Value::bool(rt::is_truthy(interp, &__t6799)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6801)?) - } - }; - if match rt::is_truthy(interp, &__t6803) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6802 = v_V2644.clone(); - rt::hd(&__t6802)? - }); - } else { - { - let __t6791 = { - let __t6787 = v_V2644.clone(); - rt::is_cons(&__t6787) - }; - if match rt::is_truthy(interp, &__t6791) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t6788 = v_V2643.clone(); - let __t6790 = { - let __t6789 = v_V2644.clone(); - rt::tl(&__t6789)? - }; - v_V2643 = __t6788; - v_V2644 = __t6790; - continue; - } - } else { - { - let __t6786 = Value::bool(true); - if match rt::is_truthy(interp, &__t6786) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6785 = Value::sym(interp.intern("assocp-if")); - rt::apply_direct(interp, "shen.f-error", &[__t6785])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_assocp_x2d_if(interp: &mut Interp) { - interp.register_native("assocp-if", 2, aot_assocp_x2d_if); - interp.register_aot_direct("assocp-if", aot_assocp_x2d_if); -} - -/// AOT-compiled from KL `(defun assocp-if-not ...)` -pub fn aot_assocp_x2d_if_x2d_not(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 2 { - return Err(ShenError::new(format!( - "assocp-if-not: expected 2 args, got {}", - args.len() - ))); - } - #[allow(unused_mut)] - let mut v_V2652 = args[0].clone(); - #[allow(unused_mut)] - let mut v_V2653 = args[1].clone(); - #[allow(clippy::never_loop)] - loop { - { - let __t6831 = { - let __t6828 = Value::nil(); - let __t6829 = v_V2653.clone(); - rt::eq(&__t6828, &__t6829) - }; - if match rt::is_truthy(interp, &__t6831) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6830 = Value::str("pair not found\n"); - rt::apply_direct(interp, "simple-error", &[__t6830])? - }); - } else { - { - let __t6827 = { - let __t6824 = { - let __t6815 = v_V2653.clone(); - rt::is_cons(&__t6815) - }; - if !rt::is_truthy(interp, &__t6824)? { - Value::bool(false) - } else { - let __t6825 = { - let __t6822 = { - let __t6817 = { - let __t6816 = v_V2653.clone(); - rt::hd(&__t6816)? - }; - rt::apply_direct(interp, "tuple?", &[__t6817])? - }; - if !rt::is_truthy(interp, &__t6822)? { - Value::bool(false) - } else { - let __t6823 = { - let __t6821 = { - let __t6820 = { - let __t6819 = { - let __t6818 = v_V2653.clone(); - rt::hd(&__t6818)? - }; - rt::apply_direct(interp, "fst", &[__t6819])? - }; - rt::apply_value(interp, v_V2652.clone(), &[__t6820])? - }; - rt::apply_direct(interp, "not", &[__t6821])? - }; - Value::bool(rt::is_truthy(interp, &__t6823)?) - } - }; - Value::bool(rt::is_truthy(interp, &__t6825)?) - } - }; - if match rt::is_truthy(interp, &__t6827) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6826 = v_V2653.clone(); - rt::hd(&__t6826)? - }); - } else { - { - let __t6814 = { - let __t6810 = v_V2653.clone(); - rt::is_cons(&__t6810) - }; - if match rt::is_truthy(interp, &__t6814) { - Ok(b) => b, - Err(e) => break Err(e), - } { - { - let __t6811 = v_V2652.clone(); - let __t6813 = { - let __t6812 = v_V2653.clone(); - rt::tl(&__t6812)? - }; - v_V2652 = __t6811; - v_V2653 = __t6813; - continue; - } - } else { - { - let __t6809 = Value::bool(true); - if match rt::is_truthy(interp, &__t6809) { - Ok(b) => b, - Err(e) => break Err(e), - } { - break Ok({ - let __t6808 = - Value::sym(interp.intern("assocp-if-not")); - rt::apply_direct(interp, "shen.f-error", &[__t6808])? - }); - } else { - break Err(ShenError::new("cond: no clause matched")); - } - } - } - } - } - } - } - } - } -} - -fn install_assocp_x2d_if_x2d_not(interp: &mut Interp) { - interp.register_native("assocp-if-not", 2, aot_assocp_x2d_if_x2d_not); - interp.register_aot_direct("assocp-if-not", aot_assocp_x2d_if_x2d_not); -} - -/// AOT-compiled from KL `(defun stlib.initialise-macros ...)` -pub fn aot_stlib_x2e_initialise_x2d_macros( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "stlib.initialise-macros: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - { - let _ = { - let __t6832 = Value::sym(interp.intern("maths.maths-macro")); - let __t6834 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_X = args[0].clone(); - Ok({ - let __t6833 = v_X.clone(); - rt::apply_direct(interp, "maths.maths-macro", &[__t6833])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "shen.record-macro", &[__t6832, __t6834])? - }; - { - let _ = { - let __t6835 = Value::sym(interp.intern("numerals.numeral-macro")); - let __t6837 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_X = args[0].clone(); - Ok({ - let __t6836 = v_X.clone(); - rt::apply_direct(interp, "numerals.numeral-macro", &[__t6836])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "shen.record-macro", &[__t6835, __t6837])? - }; - { - let _ = { - let __t6838 = Value::sym(interp.intern("string-macros")); - let __t6840 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_X = args[0].clone(); - Ok({ - let __t6839 = v_X.clone(); - rt::apply_direct(interp, "string-macros", &[__t6839])? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "shen.record-macro", &[__t6838, __t6840])? - }; - { - let _ = { - let __t6841 = Value::sym(interp.intern("vector.vector-macros")); - let __t6843 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_X = args[0].clone(); - Ok({ - let __t6842 = v_X.clone(); - rt::apply_direct( - interp, - "vector.vector-macros", - &[__t6842], - )? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "shen.record-macro", &[__t6841, __t6843])? - }; - { - let _ = { - let __t6844 = Value::sym(interp.intern("print.pprint-macro")); - let __t6846 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_X = args[0].clone(); - Ok({ - let __t6845 = v_X.clone(); - rt::apply_direct( - interp, - "print.pprint-macro", - &[__t6845], - )? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "shen.record-macro", &[__t6844, __t6846])? - }; - break Ok({ - let __t6847 = Value::sym(interp.intern("file.file-macro")); - let __t6849 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_X = args[0].clone(); - Ok({ - let __t6848 = v_X.clone(); - rt::apply_direct( - interp, - "file.file-macro", - &[__t6848], - )? - }) - }, - Vec::new(), - interp, - ) - }; - rt::apply_direct(interp, "shen.record-macro", &[__t6847, __t6849])? - }); - } - } - } - } - } - } -} - -fn install_stlib_x2e_initialise_x2d_macros(interp: &mut Interp) { - interp.register_native( - "stlib.initialise-macros", - 0, - aot_stlib_x2e_initialise_x2d_macros, - ); - interp.register_aot_direct( - "stlib.initialise-macros", - aot_stlib_x2e_initialise_x2d_macros, - ); -} - -/// AOT-compiled from KL `(defun stlib.initialise-synonyms ...)` -pub fn aot_stlib_x2e_initialise_x2d_synonyms( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "stlib.initialise-synonyms: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - break Ok(Value::nil()); - } -} - -fn install_stlib_x2e_initialise_x2d_synonyms(interp: &mut Interp) { - interp.register_native( - "stlib.initialise-synonyms", - 0, - aot_stlib_x2e_initialise_x2d_synonyms, - ); - interp.register_aot_direct( - "stlib.initialise-synonyms", - aot_stlib_x2e_initialise_x2d_synonyms, - ); -} - -/// AOT-compiled from KL `(defun stlib.initialise-datatypes ...)` -pub fn aot_stlib_x2e_initialise_x2d_datatypes( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "stlib.initialise-datatypes: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - { - let _ = { - let __t6850 = Value::sym(interp.intern("maths.maths")); - let __t6879 = { - let __t6851 = Value::sym(interp.intern("_________________")); - let __t6878 = { - let __t6856 = { - let __t6852 = Value::sym(interp.intern("value")); - let __t6855 = { - let __t6853 = Value::sym(interp.intern("maths.*seed*")); - let __t6854 = Value::nil(); - rt::cons(&__t6853, &__t6854) - }; - rt::cons(&__t6852, &__t6855) - }; - let __t6877 = { - let __t6857 = Value::sym(interp.intern(":")); - let __t6876 = { - let __t6858 = Value::sym(interp.intern("number")); - let __t6875 = { - let __t6859 = Value::sym(interp.intern(";")); - let __t6874 = { - let __t6860 = - Value::sym(interp.intern("_______________________")); - let __t6873 = { - let __t6865 = { - let __t6861 = Value::sym(interp.intern("value")); - let __t6864 = { - let __t6862 = Value::sym( - interp.intern("maths.*tolerance*"), - ); - let __t6863 = Value::nil(); - rt::cons(&__t6862, &__t6863) - }; - rt::cons(&__t6861, &__t6864) - }; - let __t6872 = { - let __t6866 = Value::sym(interp.intern(":")); - let __t6871 = { - let __t6867 = - Value::sym(interp.intern("number")); - let __t6870 = { - let __t6868 = - Value::sym(interp.intern(";")); - let __t6869 = Value::nil(); - rt::cons(&__t6868, &__t6869) - }; - rt::cons(&__t6867, &__t6870) - }; - rt::cons(&__t6866, &__t6871) - }; - rt::cons(&__t6865, &__t6872) - }; - rt::cons(&__t6860, &__t6873) - }; - rt::cons(&__t6859, &__t6874) - }; - rt::cons(&__t6858, &__t6875) - }; - rt::cons(&__t6857, &__t6876) - }; - rt::cons(&__t6856, &__t6877) - }; - rt::cons(&__t6851, &__t6878) - }; - rt::apply_direct(interp, "shen.process-datatype", &[__t6850, __t6879])? - }; - break Ok({ - let __t6880 = Value::sym(interp.intern("print")); - let __t6909 = { - let __t6881 = Value::sym(interp.intern("_______________________________")); - let __t6908 = { - let __t6886 = { - let __t6882 = Value::sym(interp.intern("value")); - let __t6885 = { - let __t6883 = Value::sym(interp.intern("print.*indentation*")); - let __t6884 = Value::nil(); - rt::cons(&__t6883, &__t6884) - }; - rt::cons(&__t6882, &__t6885) - }; - let __t6907 = { - let __t6887 = Value::sym(interp.intern(":")); - let __t6906 = { - let __t6888 = Value::sym(interp.intern("number")); - let __t6905 = { - let __t6889 = Value::sym(interp.intern(";")); - let __t6904 = { - let __t6890 = Value::sym( - interp.intern("_______________________________"), - ); - let __t6903 = { - let __t6895 = { - let __t6891 = Value::sym(interp.intern("value")); - let __t6894 = { - let __t6892 = Value::sym( - interp.intern("print.*linelength*"), - ); - let __t6893 = Value::nil(); - rt::cons(&__t6892, &__t6893) - }; - rt::cons(&__t6891, &__t6894) - }; - let __t6902 = { - let __t6896 = Value::sym(interp.intern(":")); - let __t6901 = { - let __t6897 = - Value::sym(interp.intern("number")); - let __t6900 = { - let __t6898 = - Value::sym(interp.intern(";")); - let __t6899 = Value::nil(); - rt::cons(&__t6898, &__t6899) - }; - rt::cons(&__t6897, &__t6900) - }; - rt::cons(&__t6896, &__t6901) - }; - rt::cons(&__t6895, &__t6902) - }; - rt::cons(&__t6890, &__t6903) - }; - rt::cons(&__t6889, &__t6904) - }; - rt::cons(&__t6888, &__t6905) - }; - rt::cons(&__t6887, &__t6906) - }; - rt::cons(&__t6886, &__t6907) - }; - rt::cons(&__t6881, &__t6908) - }; - rt::apply_direct(interp, "shen.process-datatype", &[__t6880, __t6909])? - }); - } - } -} - -fn install_stlib_x2e_initialise_x2d_datatypes(interp: &mut Interp) { - interp.register_native( - "stlib.initialise-datatypes", - 0, - aot_stlib_x2e_initialise_x2d_datatypes, - ); - interp.register_aot_direct( - "stlib.initialise-datatypes", - aot_stlib_x2e_initialise_x2d_datatypes, - ); -} - -/// AOT-compiled from KL `(defun stlib.initialise-final ...)` -pub fn aot_stlib_x2e_initialise_x2d_final( - interp: &mut Interp, - args: &[Value], -) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "stlib.initialise-final: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - { - let _ = { - let v_External = { - let __t6910 = Value::sym(interp.intern("stlib")); - rt::apply_direct(interp, "external", &[__t6910])? - }; - { - let v_ExternalF = { - let __t6914 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_X = args[0].clone(); - Ok({ - let __t6912 = { - let __t6911 = v_X.clone(); - rt::apply_direct(interp, "arity", &[__t6911])? - }; - let __t6913 = Value::int(-1i64); - rt::gt(&__t6912, &__t6913)? - }) - }, - Vec::new(), - interp, - ) - }; - let __t6915 = v_External.clone(); - rt::apply_direct(interp, "filter", &[__t6914, __t6915])? - }; - { - let v_SystemfResult = { - let __t6917 = { - rt::make_aot_closure( - "", - 1, - move |interp, args| { - let v_Y2657 = args[0].clone(); - Ok({ - let __t6916 = v_Y2657.clone(); - rt::apply_direct(interp, "systemf", &[__t6916])? - }) - }, - Vec::new(), - interp, - ) - }; - let __t6918 = v_ExternalF.clone(); - rt::apply_direct(interp, "map", &[__t6917, __t6918])? - }; - Value::sym(interp.intern("ok")) - } - } - }; - { - let _ = { - let __t6919 = Value::nil(); - rt::apply_direct(interp, "preclude-all-but", &[__t6919])? - }; - { - let _ = { - let __t6920 = Value::sym(interp.intern("shen.*userdefs*")); - let __t6921 = Value::nil(); - rt::apply_direct(interp, "set", &[__t6920, __t6921])? - }; - { - let _ = { - let __t6922 = Value::str(""); - rt::apply_direct(interp, "cd", &[__t6922])? - }; - break Ok({ - let __t6923 = Value::sym(interp.intern("-")); - rt::apply_direct(interp, "tc", &[__t6923])? - }); - } - } - } - } - } -} - -fn install_stlib_x2e_initialise_x2d_final(interp: &mut Interp) { - interp.register_native( - "stlib.initialise-final", - 0, - aot_stlib_x2e_initialise_x2d_final, - ); - interp.register_aot_direct("stlib.initialise-final", aot_stlib_x2e_initialise_x2d_final); -} - -/// AOT-compiled from KL `(defun stlib.initialise ...)` -pub fn aot_stlib_x2e_initialise(interp: &mut Interp, args: &[Value]) -> ShenResult { - if args.len() != 0 { - return Err(ShenError::new(format!( - "stlib.initialise: expected 0 args, got {}", - args.len() - ))); - } - #[allow(clippy::never_loop)] - loop { - { - let _ = { rt::apply_direct(interp, "stlib.initialise-environment", &[])? }; - { - let _ = { rt::apply_direct(interp, "stlib.initialise-arities", &[])? }; - { - let _ = { rt::apply_direct(interp, "stlib.initialise-macros", &[])? }; - { - let _ = { rt::apply_direct(interp, "stlib.initialise-synonyms", &[])? }; - { - let _ = - { rt::apply_direct(interp, "stlib.initialise-datatypes", &[])? }; - { - let _ = - { rt::apply_direct(interp, "stlib.initialise-types", &[])? }; - { - let _ = { - rt::apply_direct(interp, "stlib.initialise-sources", &[])? - }; - break Ok({ - rt::apply_direct(interp, "stlib.initialise-final", &[])? - }); - } - } - } - } - } - } - } - } -} - -fn install_stlib_x2e_initialise(interp: &mut Interp) { - interp.register_native("stlib.initialise", 0, aot_stlib_x2e_initialise); - interp.register_aot_direct("stlib.initialise", aot_stlib_x2e_initialise); -} - -/// Register every AOT-compiled function on `interp`. Call after kernel -/// boot so these names override the tree-walked defuns. -pub fn install(interp: &mut Interp) { - install_concat_x2a_(interp); - install_newv(interp); - install_maths_x2e_maths_x2d_macro(interp); - install_set_x2d_tolerance(interp); - install_tolerance(interp); - install_sq(interp); - install_cube(interp); - install_for(interp); - install_maths_x2e_for_x2d_h(interp); - install_maths_x2e_lazyfor_x2d_and(interp); - install_maths_x2e_lazyfor_x2d_or(interp); - install_max(interp); - install_expt(interp); - install_maths_x2e_n_x2d__x3e_r(interp); - install_maths_x2e_expt_x2d_h(interp); - install_gcd(interp); - install_maths_x2e_gcd_x2d_help(interp); - install_maths_x2e_gcd_x2d_loop(interp); - install_lcd(interp); - install_maths_x2e_lcd_x2d_loop(interp); - install_isqrt(interp); - install_maths_x2e_isqrt_x2d_loop(interp); - install_div(interp); - install_modf(interp); - install_floor(interp); - install_maths_x2e_rounding_x2d_loop(interp); - install_maths_x2e_float_x2d__x3e_pair(interp); - install_ceiling(interp); - install_round(interp); - install_mod(interp); - install_lcm(interp); - install_maths_x2e_greatest(interp); - install_maths_x2e_lcm_x2d_h(interp); - install_maths_x2e_lcm_x3f_(interp); - install_random(interp); - install_min(interp); - install_reseed(interp); - install_maths_x2e_bbs(interp); - install__x7e_(interp); - install_positive_x3f_(interp); - install_negative_x3f_(interp); - install_natural_x3f_(interp); - install_converge(interp); - install_maths_x2e_converge_x2d_help(interp); - install_nthrt(interp); - install_sqrt(interp); - install_maths_x2e_compute_x2d_nthrt(interp); - install_approx(interp); - install_abs(interp); - install_series(interp); - install_maths_x2e_series_x2d_h(interp); - install_product(interp); - install_summation(interp); - install_odd_x3f_(interp); - install_even_x3f_(interp); - install_maths_x2e_compute_x2d_sine(interp); - install_maths_x2e_compute_x2d_cos(interp); - install_cos(interp); - install_sin(interp); - install_tan(interp); - install_radians(interp); - install_g(interp); - install_pi(interp); - install_e(interp); - install_tan30(interp); - install_cos30(interp); - install_cos45(interp); - install_sin45(interp); - install_sqrt2(interp); - install_tan60(interp); - install_maths_x2e_sin60(interp); - install_sin120(interp); - install_tan120(interp); - install_sin135(interp); - install_cos135(interp); - install_cos150(interp); - install_tan150(interp); - install_cos210(interp); - install_tan210(interp); - install_sin225(interp); - install_cos225(interp); - install_sin240(interp); - install_tan240(interp); - install_sin300(interp); - install_tan300(interp); - install_sin315(interp); - install_cos315(interp); - install_cos330(interp); - install_tan330(interp); - install_coth(interp); - install_sinh(interp); - install_cosh(interp); - install_tanh(interp); - install_sech(interp); - install_csch(interp); - install_power(interp); - install_factorial(interp); - install_prime_x3f_(interp); - install_maths_x2e_prime_x2d_h(interp); - install_maths_x2e_sign(interp); - install_log(interp); - install_loge(interp); - install_log2(interp); - install_log10(interp); - install_maths_x2e_log10_x2b_(interp); - install_r_x23_(interp); - install_rational_x2e_print_x2d_rational(interp); - install_rational_x3f_(interp); - install_numerator(interp); - install_denominator(interp); - install_r_x2d_op1(interp); - install_r_x2d_op2(interp); - install_r_x2d__x3e_n(interp); - install_r_x2d__x3e_pair(interp); - install_n_x2d__x3e_r(interp); - install_r_x2d_reduce(interp); - install_rational_x2e_r_x2d_reduce_x2d_help(interp); - install_r_x3d_(interp); - install_r_x3c_(interp); - install_r_x3e_(interp); - install_r_x3e__x3d_(interp); - install_r_x3c__x3d_(interp); - install_r_x2b_(interp); - install_r_x2d_(interp); - install_r_x2a_(interp); - install__x2b__x2d_inverse(interp); - install__x2a__x2d_inverse(interp); - install_r_x2f_(interp); - install_r_x2d_expt(interp); - install_r_x2d_approx(interp); - install_rational_x2e_approx_x2d_r_x2d_h(interp); - install_c_x23_(interp); - install_complex_x2e_print_x2d_complex(interp); - install_complex_x3f_(interp); - install_real(interp); - install_imaginary(interp); - install_c_x2b_(interp); - install_c_x2d_(interp); - install_c_x2a_(interp); - install_c_x2f_(interp); - install_n_x23_(interp); - install_radix(interp); - install_numerals_x2e_numerals(interp); - install_n_x23__x2d__x3e_n(interp); - install_n_x23__x2d__x3e_ns(interp); - install_numerals_x2e_print_x2d_numeral(interp); - install_numerals_x2e_numeric_x2d__x3e_string(interp); - install_numeral_x3f_(interp); - install_numerals_x2e_numeral_x2d_macro(interp); - install_n_x2d_op2(interp); - install_n_x2d_op1(interp); - install_n_x2b_(interp); - install_n_x2a_(interp); - install_n_x2d_(interp); - install_n_x2f_(interp); - install_binary(interp); - install_hex(interp); - install_octal(interp); - install_duodecimal(interp); - install_numerals_x2e_n_x2d__x3e_numeral(interp); - install_numerals_x2e_largest_x2d_expt(interp); - install_numerals_x2e_n_x2d_zeros(interp); - install_numerals_x2e_add(interp); - install_numerals_x2e_add_x2d_h(interp); - install_assoc_x2d_if(interp); - install_assoc_x2d_if_x2d_not(interp); - install_drop(interp); - install_drop_x2d_last(interp); - install_index(interp); - install_list_x2e_index_x2d_h(interp); - install_index_x2d_last(interp); - install_insert(interp); - install_remove_x2d_duplicates(interp); - install_trim_x2d_left_x2d_if(interp); - install_trim_x2d_right_x2d_if(interp); - install_trim_x2d_if(interp); - install_trim_x2d_left(interp); - install_trim_x2d_right(interp); - install_trim(interp); - install_prefix_x3f_(interp); - install_infix_x3f_(interp); - install_suffix_x3f_(interp); - install_subset_x3f_(interp); - install_set_x3d__x3f_(interp); - install_set_x3f_(interp); - install_n_x2d_times(interp); - install_list_x2e_n_x2d_times_x2d_h(interp); - install_subbag_x3f_(interp); - install_bag_x3d__x3f_(interp); - install_mapc(interp); - install_permute(interp); - install_count_x2d_if(interp); - install_count(interp); - install_some_x3f_(interp); - install_every_x3f_(interp); - install_sort(interp); - install_find(interp); - install_foldr(interp); - install_foldl(interp); - install_mapf(interp); - install_filter(interp); - install_remove_x2d_if(interp); - install_list_x2e_reduce(interp); - install_take(interp); - install_take_x2d_last(interp); - install_cartprod(interp); - install_powerset(interp); - install_partition(interp); - install_transitive_x2d_closure(interp); - install_list_x2e_transitive_x2d_pass(interp); - install_list_x2e_find_x2d_trans(interp); - install_x_x2d__x3e_ascii(interp); - install_splice(interp); - install_string_x2d_macros(interp); - install_string_x2d__x3e_list(interp); - install_string_x2e_s_x2d__x3e_l_x2d_h(interp); - install_list_x2d__x3e_string(interp); - install_s_x2d_op1(interp); - install_s_x2d_op2(interp); - install_string_x2e_count(interp); - install_string_x2e_reverse(interp); - install_string_x2e_element_x3f_(interp); - install_string_x2e_prefix_x3f_(interp); - install_string_x2e_infix_x3f_(interp); - install_string_x2e_suffix_x3f_(interp); - install_string_x2e_subset_x3f_(interp); - install_string_x2e_set_x3d__x3f_(interp); - install_string_x2e_set_x3f_(interp); - install_file_x2d_extension(interp); - install_strip_x2d_extension(interp); - install_string_x2e_length(interp); - install_string_x2e_trim(interp); - install_string_x2e_trim_x2d_if(interp); - install_string_x2e_trim_x2d_right_x2d_if(interp); - install_string_x2e_trim_x2d_left_x2d_if(interp); - install_string_x2e_trim_x2d_right(interp); - install_string_x2e_trim_x2d_left(interp); - install_string_x2e_some_x3f_(interp); - install_string_x2e_every_x3f_(interp); - install_string_x2e_difference(interp); - install_string_x2e_intersection(interp); - install_string_x2e_nth(interp); - install_whitespace_x3f_(interp); - install_uppercase_x3f_(interp); - install_lowercase_x3f_(interp); - install_digit_x3f_(interp); - install_alpha_x3f_(interp); - install_alphanum_x3f_(interp); - install_tokenise(interp); - install_string_x2e_tokenise_x2d_h(interp); - install_uppercase(interp); - install_lowercase(interp); - install_string_x2e_map(interp); - install_spell_x2d_number(interp); - install_string_x2e_digit(interp); - install_string_x2e_triples(interp); - install_string_x2e_triples_x2d_h(interp); - install_string_x2e_digits(interp); - install_string_x2e_tens(interp); - install_string_x2e_scale(interp); - install_string_x2e_units(interp); - install_string_x3e__x3f_(interp); - install_string_x3c__x3f_(interp); - install_string_x3e__x3d__x3f_(interp); - install_string_x3c__x3d__x3f_(interp); - install_render_x2d_file(interp); - install_string_x2e_bytes_x2d__x3e_strings(interp); - install_render(interp); - install_string_x2e_rendered_x3f_(interp); - install_string_x2e__x3c_render_x3e_(interp); - install_string_x2e__x3c_renderchar_x3e_(interp); - install_string_x2e_recapply(interp); - install_string_x2e__x3c_args_x3e_(interp); - install_string_x2e__x3c_arg_x3e_(interp); - install_string_x2e__x3c_argchar_x3e_(interp); - install_string_x2e__x3c_ws_x3e_(interp); - install_string_x2e__x3c_fn_x3e_(interp); - install_string_x2e__x3c_fnchar_x3e_(interp); - install_vector_x2e_vector_x2d_macros(interp); - install_vector_x2e_key(interp); - install_vector_x2e_build_x2d_array(interp); - install_depopulate(interp); - install_populated_x3f_(interp); - install_vector_x2e_unfold_x2d_populate(interp); - install_populate(interp); - install_vector_x2e__x3c__x2d_array(interp); - install_vector_x2e_array_x2d__x3e_(interp); - install_vector_x2e_unfold_x2d_vector_x2d_assignment(interp); - install_compress(interp); - install_vector_x2e_copy(interp); - install_vector_x2e_reverse(interp); - install_vector_x2e_append(interp); - install_vector_x2e_dfilter(interp); - install_vector_x2e_element_x3f_(interp); - install_vector_x2e_map(interp); - install_vector_x2e_dmap(interp); - install_vector_x2e_every_x3f_(interp); - install_vector_x2e_some_x3f_(interp); - install_vector_x2d__x3e_list(interp); - install_list_x2d__x3e_vector(interp); - install_vector_x2e_list_x2d__x3e_vector_x2d_h(interp); - install_vacant_x3f_(interp); - install_dense_x3f_(interp); - install_porous_x3f_(interp); - install_sparse_x3f_(interp); - install_v_x2d_op1(interp); - install_v_x2d_op2(interp); - install_print_x2e_pprint_x2d_macro(interp); - install_linelength(interp); - install_indentation(interp); - install_set_x2d_linelength(interp); - install_set_x2d_indentation(interp); - install_pps(interp); - install_pprint(interp); - install_pretty_x2d_string(interp); - install_print_x2e_pretty_x2d_string_x2d_h(interp); - install_print_x2e_indent(interp); - install_print_x2e_indent_x2d_h(interp); - install_print_x2e_n_x2d_space(interp); - install_delete_x2d_file(interp); - install_file_x2e_file_x2d_macro(interp); - install_append_x2d_files(interp); - install_append_x2d_files_x2d_with_x2d_open_x2d_stream(interp); - install_file_x2e_read_x26_write(interp); - install_file_x2e_read_x26_write_x2d_h(interp); - install_reopen(interp); - install_copy_x2d_file(interp); - install_copy_x2d_file_x2d_with_x2d_open_x2d_stream(interp); - install_file_x2d_exists_x3f_(interp); - install_file_x2d_size(interp); - install_file_x2e_file_x2d_size_x2d_loop(interp); - install_ascii(interp); - install_file_x2e_scan_x2d_bytes(interp); - install_pairoff(interp); - install_assocp(interp); - install_cartprodp(interp); - install_assocp_x2d_if(interp); - install_assocp_x2d_if_x2d_not(interp); - install_stlib_x2e_initialise_x2d_macros(interp); - install_stlib_x2e_initialise_x2d_synonyms(interp); - install_stlib_x2e_initialise_x2d_datatypes(interp); - install_stlib_x2e_initialise_x2d_final(interp); - install_stlib_x2e_initialise(interp); -} diff --git a/crates/shen-rust/src/interp/boot.rs b/crates/shen-rust/src/interp/boot.rs index b6bf87a..c0b1237 100644 --- a/crates/shen-rust/src/interp/boot.rs +++ b/crates/shen-rust/src/interp/boot.rs @@ -40,10 +40,12 @@ use crate::value::{Stream, Value}; /// upstream loads it as precompiled `backend.lsp` (the CL compiler), and /// it is dead weight for a Rust port. See `kernel/klambda/PROVENANCE.md`. /// -/// `stlib.kl` (the standard library) and the community extensions are -/// retained and loaded on top: upstream now ships StLib as separate -/// lazy Shen sources rather than a kernel `.kl`, but the port's -/// conformance suite and Ratatoskr stage-1 launcher still need them. +/// The standard library is no longer a kernel `.kl`. Upstream ships it as +/// separate Shen sources under `Lib/StLib`; this port vendors them under +/// `kernel/stlib/` and loads them after the kernel via `load_stlib` +/// (running upstream's `install.shen`), retiring the old community +/// `stlib.kl` overlay. The community extensions are still loaded on top: +/// the conformance suite and Ratatoskr stage-1 launcher need them. const KERNEL_FILES: &[&str] = &[ "sys.kl", "writer.kl", @@ -59,7 +61,6 @@ const KERNEL_FILES: &[&str] = &[ "t-star.kl", "yacc.kl", "types.kl", - "stlib.kl", "extension-features.kl", "extension-expand-dynamic.kl", "extension-launcher.kl", @@ -214,9 +215,94 @@ pub fn boot_with_kernel(interp: &mut Interp, kernel_dir: &Path) -> ShenResult<() // land over the AOT registrations above. See `interp::tc_cache`. crate::interp::tc_cache::install_from_env(interp, kernel_dir); + // Load the standard library from the vendored `Lib/StLib` Shen + // sources (replacing the old community `stlib.kl` overlay). Done last, + // over the fully-installed kernel, so `load`/`tc`/`define` are live — + // going through the real `load` path is what registers correct + // arities (the overlay left them at -1, so `(fn filter)` failed). + load_stlib(interp, kernel_dir)?; + Ok(()) } +/// Load the standard library by running upstream's `install.shen` over the +/// vendored `kernel/stlib/` sources. Sibling of `kernel/klambda/` +/// (`kernel_dir` is `.../kernel/klambda`). A no-op when the directory is +/// absent — shaken/embedded boots that don't ship StLib on disk just skip +/// it. +/// +/// `install.shen` drives the load with **relative** `(load "Maths/…")` +/// paths, and `shen-rust`'s file I/O resolves relative paths against the +/// process cwd (its `cd` only sets `*home-directory*`). Mutating the +/// process cwd is not an option: `Interp` is single-threaded but multiple +/// interpreters can boot concurrently (the test harness does), and cwd is +/// process-global — a chdir in one boot corrupts another's relative loads. +/// So instead we materialise a temp copy of `install.shen` with every +/// `(load "REL")` rewritten to an absolute path under the StLib dir, and +/// load that by absolute path. No cwd mutation, fully re-entrant. +/// +/// `*hush*` (a per-interpreter global) is set for the duration so the +/// per-file "…loaded" / type-signature chatter stays off the boot path +/// (file writes, if any, are unaffected). +fn load_stlib(interp: &mut Interp, kernel_dir: &Path) -> ShenResult<()> { + let Some(stlib_dir) = kernel_dir.parent().map(|p| p.join("stlib")) else { + return Ok(()); + }; + let install = stlib_dir.join("install.shen"); + if !install.exists() { + return Ok(()); + } + let stlib_abs = stlib_dir + .canonicalize() + .map_err(|e| ShenError::new(format!("stlib: canonicalize {stlib_dir:?}: {e}")))?; + let base = stlib_abs.to_string_lossy(); + + // Rewrite `(load "REL")` -> `(load "/REL")` so the whole install + // sequence resolves without touching the process cwd (re-entrant). + // install.shen is otherwise run verbatim — including its per-module + // `(tc +/-)` toggles — matching the shen-cl reference. (The type-checked + // load recurses deeply; the boot thread and `RUST_MIN_STACK` provide the + // stack. See `.cargo/config.toml` and `bin/shen-rust/src/main.rs`.) + let src = fs::read_to_string(&install) + .map_err(|e| ShenError::new(format!("read {install:?}: {e}")))?; + let rewritten = src.replace("(load \"", &format!("(load \"{base}/")); + + // Unique temp path per boot (pid + monotonic counter): concurrent boots + // must not share a file. + static SEQ: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); + let n = SEQ.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + let tmp = std::env::temp_dir().join(format!( + "shen-rust-stlib-install-{}-{}.shen", + std::process::id(), + n + )); + fs::write(&tmp, rewritten).map_err(|e| ShenError::new(format!("write {tmp:?}: {e}")))?; + + let load_sym = interp.intern("load"); + let Some(load_fn) = interp.env.get_fn(load_sym).cloned() else { + let _ = fs::remove_file(&tmp); + return Err(ShenError::new("load not defined; cannot install stlib")); + }; + let hush = interp.intern("*hush*"); + let prev_hush = interp.env.get_global(hush).cloned(); + + interp.env.set_global(hush, Value::bool(true)); + let result = interp + .apply( + load_fn, + vec![Value::str(Rc::from(tmp.to_string_lossy().as_ref()))], + ) + .map(|_| ()) + .map_err(|e| ShenError::new(format!("stlib install.shen: {e}"))); + + match prev_hush { + Some(v) => interp.env.set_global(hush, v), + None => interp.env.set_global(hush, Value::bool(false)), + } + let _ = fs::remove_file(&tmp); + result +} + /// Boot-from-subset (Ratatoskr stage 2): bring up an interpreter from a /// single shaken `kernel.kl` (KL source text) instead of the 21 vendored /// kernel files. The sequence mirrors `boot_with_kernel` exactly, minus diff --git a/crates/shen-rust/tests/library.rs b/crates/shen-rust/tests/library.rs index 6629094..e48c1a9 100644 --- a/crates/shen-rust/tests/library.rs +++ b/crates/shen-rust/tests/library.rs @@ -103,9 +103,14 @@ fn append_concatenates() { fn map_applies_to_each() { let mut i = fresh_booted(); // Define a named unary function and map it (Shen's `map` wants a - // function value; a defined name curries cleanly). - eval(&mut i, "(define sq X -> (* X X))"); - let v = eval(&mut i, "(map (function sq) (cons 1 (cons 2 (cons 3 ()))))"); + // function value; a defined name curries cleanly). Uses a port-local + // name — `sq` is now a real StLib function (Maths/maths.shen), and the + // kernel refuses to redefine a system function. + eval(&mut i, "(define my-square X -> (* X X))"); + let v = eval( + &mut i, + "(map (function my-square) (cons 1 (cons 2 (cons 3 ()))))", + ); assert_eq!(ints(&v), vec![1, 4, 9]); } @@ -183,3 +188,46 @@ fn reverse_of_nested_lists() { let inner = *v.tail().unwrap().head().unwrap(); assert_eq!(ints(&inner), vec![1, 2, 3]); } + +#[test] +fn stdlib_loaded_from_source_has_real_arities() { + // Regression for the retired community `stlib.kl` overlay: it installed + // the stdlib as pre-compiled KLambda defuns, bypassing the kernel's + // `load`/`define` path, so functions like `filter` ended up with the + // "unknown" arity -1. That broke `(fn filter)` and top-level + // `(filter ...)` ("fn: filter is undefined"). The S41.2-refresh port + // loads StLib from the `Lib/StLib` Shen sources through the real `load`, + // which registers correct arities. See kernel/stlib/PROVENANCE.md. + let mut i = fresh_booted(); + + // `filter` has a known (non -1) arity now. + let arity = eval(&mut i, "(arity filter)") + .as_int() + .expect("arity is int"); + assert!( + arity >= 0, + "filter arity should be >= 0 (was -1 with the overlay), got {arity}" + ); + + // `(fn filter)` resolves to a closure instead of raising "undefined". + let f = eval(&mut i, "(fn filter)"); + assert!( + f.as_int().is_none() && !f.is_nil(), + "(fn filter) should be a closure, got {f:?}" + ); + + // And filter actually filters (predicate keeps elements > 2). + let v = eval( + &mut i, + "(filter (lambda X (> X 2)) (cons 1 (cons 2 (cons 3 (cons 4 ())))))", + ); + assert_eq!(ints(&v), vec![3, 4]); + + // A package-internal (non-exported) stdlib fn is namespaced, not global: + // `reduce` lives in `(package list ...)` and is reachable as `list.reduce`. + let r = eval( + &mut i, + "(list.reduce (lambda X (lambda Acc (+ X Acc))) 0 (cons 1 (cons 2 (cons 3 ()))))", + ); + assert_eq!(r.as_int(), Some(6)); +} diff --git a/crates/shen-rust/tests/parse_kernel.rs b/crates/shen-rust/tests/parse_kernel.rs index 12075c7..f69df26 100644 --- a/crates/shen-rust/tests/parse_kernel.rs +++ b/crates/shen-rust/tests/parse_kernel.rs @@ -43,10 +43,12 @@ fn parses_every_kernel_file() { total_forms += forms.len(); } - // The ShenOSKernel-41.2 klambda set is around 3000+ top-level forms; - // exact number changes between releases. We just want a sanity floor. + // The S41.2-refresh klambda set is ~900 top-level forms (the standard + // library moved out to kernel/stlib/ Shen sources, so it is no longer + // counted here); exact number changes between releases. We just want a + // sanity floor that a real content-loss regression would trip. assert!( - total_forms > 1000, + total_forms > 500, "only {total_forms} forms parsed across {} files — parser likely losing content", entries.len() ); diff --git a/crates/shenffi/src/lib.rs b/crates/shenffi/src/lib.rs index 3dded0e..96b73be 100644 --- a/crates/shenffi/src/lib.rs +++ b/crates/shenffi/src/lib.rs @@ -35,9 +35,14 @@ pub struct ShenCtx { /// The Shen kernel `.kl` sources, embedded into the binary at compile time in /// shen-rust's boot order (must match `interp::boot::KERNEL_FILES`). Lets -/// `shen_boot_embedded` bring up the full kernel with **no filesystem -/// access** — the iOS-friendly path (no bundled resources, no sandbox path -/// juggling). See `kernel/klambda/PROVENANCE.md` for the S41.2 refresh set. +/// `shen_boot_embedded` bring up the kernel with **no filesystem access** — +/// the iOS-friendly path (no bundled resources, no sandbox path juggling). +/// See `kernel/klambda/PROVENANCE.md` for the S41.2 refresh set. +/// +/// NOTE: the standard library is no longer a kernel `.kl` (it loads from the +/// vendored `kernel/stlib/` Shen sources via `boot::load_stlib`, which needs a +/// filesystem). So this no-fs embedded boot brings up the kernel WITHOUT the +/// stdlib; embedding the StLib sources for the no-fs path is follow-up work. const KERNEL_PARTS: &[&str] = &[ include_str!("../../../kernel/klambda/sys.kl"), include_str!("../../../kernel/klambda/writer.kl"), @@ -53,7 +58,6 @@ const KERNEL_PARTS: &[&str] = &[ include_str!("../../../kernel/klambda/t-star.kl"), include_str!("../../../kernel/klambda/yacc.kl"), include_str!("../../../kernel/klambda/types.kl"), - include_str!("../../../kernel/klambda/stlib.kl"), include_str!("../../../kernel/klambda/extension-features.kl"), include_str!("../../../kernel/klambda/extension-expand-dynamic.kl"), include_str!("../../../kernel/klambda/extension-launcher.kl"), diff --git a/kernel/klambda/PROVENANCE.md b/kernel/klambda/PROVENANCE.md index d428174..20d876b 100644 --- a/kernel/klambda/PROVENANCE.md +++ b/kernel/klambda/PROVENANCE.md @@ -68,18 +68,15 @@ order). Order is load-bearing now: `declarations.kl` and `macros.kl` must precede `types.kl` (whose 161 top-level `(declare …)` forms invoke the type checker), and `types.kl` loads last. -## Standard library overlay — `stlib.kl` (retained, community 41.2) - -- SHA-256: `a39047000027a1754f66a4ccf5c822f95d7adb7fd3c7e5df3860e554605df43f` +## Standard library — now loaded from source (`stlib.kl` retired) Tarver's refresh no longer ships the standard library as a kernel `.kl`; -it lives under `Lib/StLib/` as separately-loaded Shen sources. To keep the -conformance suite and the Ratatoskr stage-1 launcher working without first -porting the StLib source-load path, the community `ShenOSKernel-41.2` -`stlib.kl` (348 defuns, no references to any removed kernel symbol) is -**retained and loaded on top** of the refreshed kernel. It is *not* part -of Tarver's S41.2 kernel. Migrating to the upstream `Lib/StLib` sources is -tracked as follow-up work. +it lives under `Lib/StLib/` as separately-loaded Shen sources. This port +now follows upstream: the community `ShenOSKernel-41.2` `stlib.kl` overlay +has been **removed**, and the stdlib loads from the vendored S-lineage +sources under `../stlib/` at boot (`boot::load_stlib` runs upstream's +`install.shen`). See `../stlib/PROVENANCE.md`. This also fixes the +arity `-1` quirk the pre-compiled overlay caused (`(fn filter)` failing). ## Extensions (retained, community additions) diff --git a/kernel/klambda/stlib.kl b/kernel/klambda/stlib.kl deleted file mode 100644 index f634847..0000000 --- a/kernel/klambda/stlib.kl +++ /dev/null @@ -1,738 +0,0 @@ -(defun concat* (V3 V4) (let W5 (concat V3 V4) (if (symbol? W5) W5 (simple-error (cn "'" (shen.app W5 "' is not a symbol -" shen.a)))))) - -(defun newv () (gensym X)) - -(defun maths.maths-macro (V8) (cond ((and (cons? V8) (and (= log10 (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons log10 (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= log2 (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons log2 (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= loge (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons loge (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= log (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (= () (tl (tl (tl V8)))))))) (cons log (cons (hd (tl V8)) (cons (hd (tl (tl V8))) (cons (cons tolerance ()) ()))))) ((and (cons? V8) (and (= sin (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons sin (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= tan (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons tan (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= cos (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons cos (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= tanh (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons tanh (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= cosh (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons cosh (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= sinh (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons sinh (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= sech (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons sech (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= csch (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons csch (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= coth (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons coth (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= nthrt (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (= () (tl (tl (tl V8)))))))) (cons nthrt (cons (hd (tl V8)) (cons (hd (tl (tl V8))) (cons (cons tolerance ()) ()))))) ((and (cons? V8) (and (= sqrt (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons sqrt (cons (hd (tl V8)) (cons (cons tolerance ()) ())))) ((and (cons? V8) (and (= expt (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (= () (tl (tl (tl V8)))))))) (cons expt (cons (hd (tl V8)) (cons (hd (tl (tl V8))) (cons (cons tolerance ()) ()))))) ((and (cons? V8) (and (= max (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (cons? (tl (tl (tl V8)))))))) (cons max (cons (hd (tl V8)) (cons (cons max (tl (tl V8))) ())))) ((and (cons? V8) (and (= min (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (cons? (tl (tl (tl V8)))))))) (cons min (cons (hd (tl V8)) (cons (cons min (tl (tl V8))) ())))) ((and (cons? V8) (and (= tolerance (hd V8)) (and (cons? (tl V8)) (= () (tl (tl V8)))))) (cons maths.tolerance=n (tl V8))) ((and (cons? V8) (and (= for (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (and (= = (hd (tl (tl V8)))) (and (cons? (tl (tl (tl V8)))) (and (cons? (tl (tl (tl (tl V8))))) (and (cons? (tl (tl (tl (tl (tl V8)))))) (and (cons? (tl (tl (tl (tl (tl (tl V8))))))) (and (cons? (tl (tl (tl (tl (tl (tl (tl V8)))))))) (and (= and (hd (tl (tl (tl (tl (tl (tl (tl V8))))))))) (= () (tl (tl (tl (tl (tl (tl (tl (tl V8)))))))))))))))))))) (let W9 (lambda Z10 (lambda Z11 (if (> (occurrences Z10 Z11) 0) (cons /. (cons Z10 (cons Z11 ()))) Z11))) (cons maths.lazyfor-and (cons (hd (tl (tl (tl V8)))) (cons ((W9 (hd (tl V8))) (hd (tl (tl (tl (tl V8)))))) (cons ((W9 (hd (tl V8))) (hd (tl (tl (tl (tl (tl V8))))))) (cons (hd (tl (tl (tl (tl (tl (tl V8))))))) ()))))))) ((and (cons? V8) (and (= for (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (and (= = (hd (tl (tl V8)))) (and (cons? (tl (tl (tl V8)))) (and (cons? (tl (tl (tl (tl V8))))) (and (cons? (tl (tl (tl (tl (tl V8)))))) (and (cons? (tl (tl (tl (tl (tl (tl V8))))))) (and (cons? (tl (tl (tl (tl (tl (tl (tl V8)))))))) (and (= or (hd (tl (tl (tl (tl (tl (tl (tl V8))))))))) (= () (tl (tl (tl (tl (tl (tl (tl (tl V8)))))))))))))))))))) (let W12 (lambda Z13 (lambda Z14 (if (> (occurrences Z13 Z14) 0) (cons /. (cons Z13 (cons Z14 ()))) Z14))) (cons maths.lazyfor-or (cons (hd (tl (tl (tl V8)))) (cons ((W12 (hd (tl V8))) (hd (tl (tl (tl (tl V8)))))) (cons ((W12 (hd (tl V8))) (hd (tl (tl (tl (tl (tl V8))))))) (cons (hd (tl (tl (tl (tl (tl (tl V8))))))) ()))))))) ((and (cons? V8) (and (= for (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (and (= = (hd (tl (tl V8)))) (and (cons? (tl (tl (tl V8)))) (and (cons? (tl (tl (tl (tl V8))))) (and (cons? (tl (tl (tl (tl (tl V8)))))) (and (cons? (tl (tl (tl (tl (tl (tl V8))))))) (and (cons? (tl (tl (tl (tl (tl (tl (tl V8)))))))) (= () (tl (tl (tl (tl (tl (tl (tl (tl V8))))))))))))))))))) (let W15 (lambda Z16 (lambda Z17 (if (> (occurrences Z16 Z17) 0) (cons /. (cons Z16 (cons Z17 ()))) Z17))) (cons for (cons (hd (tl (tl (tl V8)))) (cons ((W15 (hd (tl V8))) (hd (tl (tl (tl (tl V8)))))) (cons ((W15 (hd (tl V8))) (hd (tl (tl (tl (tl (tl V8))))))) (tl (tl (tl (tl (tl (tl V8)))))))))))) ((and (cons? V8) (and (= for (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (and (= = (hd (tl (tl V8)))) (and (cons? (tl (tl (tl V8)))) (and (cons? (tl (tl (tl (tl V8))))) (and (cons? (tl (tl (tl (tl (tl V8)))))) (and (cons? (tl (tl (tl (tl (tl (tl V8))))))) (= () (tl (tl (tl (tl (tl (tl (tl V8))))))))))))))))) (let W18 (lambda Z19 (lambda Z20 (if (> (occurrences Z19 Z20) 0) (cons /. (cons Z19 (cons Z20 ()))) Z20))) (cons for (cons (hd (tl (tl (tl V8)))) (cons ((W18 (hd (tl V8))) (hd (tl (tl (tl (tl V8)))))) (cons ((W18 (hd (tl V8))) (hd (tl (tl (tl (tl (tl V8))))))) (cons (hd (tl (tl (tl (tl (tl (tl V8))))))) (cons (cons fn (cons do ())) ())))))))) ((and (cons? V8) (and (= for (hd V8)) (and (cons? (tl V8)) (and (cons? (tl (tl V8))) (and (= = (hd (tl (tl V8)))) (and (cons? (tl (tl (tl V8)))) (and (cons? (tl (tl (tl (tl V8))))) (and (cons? (tl (tl (tl (tl (tl V8)))))) (= () (tl (tl (tl (tl (tl (tl V8))))))))))))))) (let W21 (lambda Z22 (lambda Z23 (if (> (occurrences Z22 Z23) 0) (cons /. (cons Z22 (cons Z23 ()))) Z23))) (cons for (cons (hd (tl (tl (tl V8)))) (cons ((W21 (hd (tl V8))) (hd (tl (tl (tl (tl V8)))))) (cons (cons /. (cons (hd (tl V8)) (tl (tl (tl (tl (tl V8))))))) (cons (cons + (cons 1 ())) (cons (cons fn (cons do ())) ())))))))) (true V8))) - -(defun set-tolerance (V249) (set maths.*tolerance* V249)) - -(defun tolerance () (value maths.*tolerance*)) - -(defun sq (V251) (* V251 V251)) - -(defun cube (V253) (* V253 (* V253 V253))) - -(defun for (V255 V256 V257 V258 V259) (maths.for-h (V258 V255) V256 V257 V258 V259 (V257 V255))) - -(defun maths.for-h (V268 V269 V270 V271 V272 V273) (cond ((not (V269 V268)) V273) (true (maths.for-h (V271 V268) V269 V270 V271 V272 ((V272 V273) (V270 V268)))))) - -(defun maths.lazyfor-and (V290 V291 V292 V293) (cond ((not (V291 V290)) true) ((V292 V290) (maths.lazyfor-and (V293 V290) V291 V292 V293)) (true false))) - -(defun maths.lazyfor-or (V300 V301 V302 V303) (cond ((not (V301 V300)) false) ((V302 V300) true) (true (maths.lazyfor-or (V303 V300) V301 V302 V303)))) - -(defun max (V310 V311) (cond ((> V311 V310) V311) (true V310))) - -(defun min (V316 V317) (cond ((< V317 V316) V317) (true V316))) - -(defun expt (V320 V321 V322) (if (= V321 0) 1 (if (positive? V321) (maths.expt-h V320 (maths.n->r V321 1) V322) (/ 1 (maths.expt-h V320 (maths.n->r (~ V321) 1) V322))))) - -(defun maths.n->r (V326 V327) (cond ((integer? V326) (@p V326 V327)) (true (maths.n->r (* V326 10) (* V327 10))))) - -(defun maths.expt-h (V330 V331 V332) (cond ((tuple? V331) (power (nthrt V330 (snd V331) V332) (fst V331))) (true (shen.f-error maths.expt-h)))) - -(defun gcd (V336 V337) (if (and (integer? V336) (integer? V337)) (let W338 (abs V336) (let W339 (abs V337) (if (> W338 W339) (maths.gcd-help (- W338 W339) W339) (maths.gcd-help W338 (- W339 W338))))) (simple-error "gcd expects integer inputs"))) - -(defun maths.gcd-help (V342 V343) (if (> V342 V343) (maths.gcd-loop V342 V343 V343) (maths.gcd-loop V342 V343 V342))) - -(defun maths.gcd-loop (V350 V351 V352) (cond ((= 1 V352) 1) ((and (integer? (/ V350 V352)) (integer? (/ V351 V352))) V352) (true (maths.gcd-loop V350 V351 (- V352 1))))) - -(defun lcd (V356 V357) (cond ((and (even? V356) (even? V357)) 2) (true (maths.lcd-loop V356 V357 (if (> V356 V357) V357 V356) 3)))) - -(defun maths.lcd-loop (V363 V364 V365 V366) (cond ((> V366 V365) 1) ((and (integer? (/ V363 V366)) (integer? (/ V364 V366))) V366) (true (maths.lcd-loop V363 V364 V365 (+ 2 V366))))) - -(defun isqrt (V371) (maths.isqrt-loop V371 0)) - -(defun maths.isqrt-loop (V373 V374) (cond ((= (* V374 V374) V373) V374) ((> (* V374 V374) V373) (- V374 1)) (true (maths.isqrt-loop V373 (+ V374 1))))) - -(defun div (V377 V378) (floor (/ V377 V378))) - -(defun modf (V381) (let W382 (floor V381) (@p W382 (- V381 W382)))) - -(defun floor (V384) (cond ((negative? V384) (~ (ceiling (~ V384)))) (true (maths.rounding-loop floor V384 15 0)))) - -(defun maths.rounding-loop (V389 V390 V391 V392) (cond ((and (= 0 V391) (= V390 V392)) V392) ((and (= 0 V391) (> V392 V390)) (if (= V389 floor) (- V392 1) (if (= V389 ceiling) V392 (if (= V389 round) (let W393 (- V392 V390) (let W394 (- V390 (- V392 1)) (if (> W393 W394) (- V392 1) V392))) (simple-error "error: cases exhausted"))))) ((> V390 V392) (maths.rounding-loop V389 V390 V391 (+ V392 (power 10 V391)))) (true (maths.rounding-loop V389 V390 (- V391 1) (- V392 (power 10 V391)))))) - -(defun maths.float->pair (V399) (let W400 (floor V399) (@p W400 (- V399 W400)))) - -(defun ceiling (V402) (cond ((negative? V402) (~ (floor (~ V402)))) (true (maths.rounding-loop ceiling V402 15 0)))) - -(defun round (V404) (cond ((negative? V404) (~ (round (~ V404)))) (true (maths.rounding-loop round V404 15 0)))) - -(defun mod (V406 V407) (let W408 (/ V406 V407) (let W409 (floor W408) (if (and (integer? V406) (integer? V407)) (round (* V407 (- W408 W409))) (* V407 (- W408 W409)))))) - -(defun lcm (V412) (let W413 (maths.greatest V412) (maths.lcm-h W413 W413 V412))) - -(defun maths.greatest (V417) (cond ((and (cons? V417) (= () (tl V417))) (hd V417)) ((and (cons? V417) (and (cons? (tl V417)) (> (hd V417) (hd (tl V417))))) (maths.greatest (cons (hd V417) (tl (tl V417))))) ((and (cons? V417) (cons? (tl V417))) (maths.greatest (tl V417))) (true (shen.f-error maths.greatest)))) - -(defun maths.lcm-h (V419 V420 V421) (cond ((maths.lcm? V419 V421) V419) (true (maths.lcm-h (+ V419 V420) V420 V421)))) - -(defun maths.lcm? (V427 V428) (cond ((= () V428) true) ((cons? V428) (and (integer? (/ V427 (hd V428))) (maths.lcm? V427 (tl V428)))) (true (shen.f-error maths.lcm?)))) - -(defun random (V431 V432) (let W433 (maths.bbs (value maths.*seed*)) (let W434 (set maths.*seed* W433) (let W435 (min V431 V432) (+ W435 (mod W434 (abs (+ 1 (- V432 V431))))))))) - -(defun min (V440 V441) (cond ((> V440 V441) V441) (true V440))) - -(defun reseed () (set maths.*seed* (get-time unix))) - -(defun maths.bbs (V444) (let W445 (* 1201 1213) (mod (* V444 V444) W445))) - -(defun ~ (V447) (- 0 V447)) - -(defun positive? (V449) (> V449 0)) - -(defun negative? (V451) (< V451 0)) - -(defun natural? (V453) (cond ((= 0 V453) true) (true (and (integer? V453) (positive? V453))))) - -(defun converge (V455 V456 V457) (maths.converge-help V456 (V456 V455) V455 V457)) - -(defun maths.converge-help (V464 V465 V466 V467) (cond (((V467 V466) V465) V465) (true (maths.converge-help V464 (V464 V465) V465 V467)))) - -(defun nthrt (V476 V477 V478) (cond ((positive? V476) (converge V476 (lambda Z479 (maths.compute-nthrt V476 Z479 V477 V478)) (approx V478))) (true (simple-error (cn "nthrt: negA must be a positive numberneg%" ""))))) - -(defun sqrt (V483 V484) (nthrt V483 2 V484)) - -(defun maths.compute-nthrt (V487 V488 V489 V490) (let W491 (/ 1 V489) (let W492 (* (- V489 1) V488) (let W493 (expt V488 (- V489 1) V490) (let W494 (/ V487 W493) (let W495 (+ W492 W494) (* W491 W495))))))) - -(defun approx (V500) (lambda Z501 (lambda Z502 (let W503 (- Z501 Z502) (>= V500 (abs W503)))))) - -(defun abs (V505) (if (>= V505 0) V505 (- 0 V505))) - -(defun series (V507 V508 V509 V510) (maths.series-h (+ V507 1) V509 V508 (V508 V507) V510)) - -(defun maths.series-h (V515 V516 V517 V518 V519) (let W520 ((V519 (V517 V515)) V518) (if (<= (abs (- V518 W520)) V516) W520 (maths.series-h (+ V515 1) V516 V517 W520 V519)))) - -(defun product (V528 V529 V530) (series V528 V529 V530 (lambda Z531 (lambda Z532 (* Z531 Z532))))) - -(defun summation (V538 V539 V540) (series V538 V539 V540 (lambda Z541 (lambda Z542 (+ Z541 Z542))))) - -(defun odd? (V546) (and (integer? V546) (not (integer? (/ V546 2))))) - -(defun even? (V548) (and (integer? V548) (integer? (/ V548 2)))) - -(defun maths.compute-sine (V550 V551) (let W552 (+ (* 2 V551) 1) (let W553 (* (power -1 V551) (power V550 W552)) (let W554 (factorial W552) (/ W553 W554))))) - -(defun maths.compute-cos (V557 V558) (let W559 (* 2 V558) (let W560 (* (power -1 V558) (power V557 W559)) (let W561 (factorial W559) (/ W560 W561))))) - -(defun cos (V565 V566) (let W567 (radians V565) (summation 0 (lambda Z568 (maths.compute-cos W567 Z568)) V566))) - -(defun sin (V572 V573) (let W574 (radians V572) (summation 0 (lambda Z575 (maths.compute-sine W574 Z575)) V573))) - -(defun tan (V578 V579) (/ (sin V578 V579) (cos V578 V579))) - -(defun radians (V582) (* (/ V582 180) (pi))) - -(defun g () 1.6180339887498) - -(defun pi () 3.1415926535897) - -(defun e () 2.7182818284590002) - -(defun tan30 () 0.5773502691896) - -(defun cos30 () 0.8660254037844001) - -(defun cos45 () 0.70710678118651) - -(defun sin45 () 0.7071067811865) - -(defun sqrt2 () 1.4142135623731) - -(defun tan60 () 1.7320508075692) - -(defun maths.sin60 () 0.8660254037844001) - -(defun sin120 () 0.8660254037844001) - -(defun tan120 () -1.7320508075692) - -(defun sin135 () 0.7071067811865) - -(defun cos135 () -0.7071067811865) - -(defun cos150 () -0.8660254037844001) - -(defun tan150 () -0.5773502691905) - -(defun cos210 () -0.8660254037844001) - -(defun tan210 () 0.5773502691905) - -(defun sin225 () -0.7071067811865) - -(defun cos225 () -0.7071067811865) - -(defun sin240 () -0.8660254037844001) - -(defun tan240 () 1.7320508075692) - -(defun sin300 () -0.8660254037844001) - -(defun tan300 () -1.7320508075692) - -(defun sin315 () -0.7071067811865) - -(defun cos315 () 0.7071067811865) - -(defun cos330 () 0.8660254037844001) - -(defun tan330 () -0.5773502691905) - -(defun coth (V584 V585) (let W586 (e) (let W587 (expt W586 (~ (* 2 V584)) V585) (/ (+ 1 W587) (- 1 W587))))) - -(defun sinh (V590 V591) (let W592 (e) (let W593 (expt W592 V590 V591) (let W594 (expt W592 (~ V590) V591) (let W595 (- W593 W594) (/ W595 2)))))) - -(defun cosh (V598 V599) (let W600 (e) (let W601 (expt W600 V598 V599) (let W602 (expt W600 (~ V598) V599) (let W603 (+ W601 W602) (/ W603 2)))))) - -(defun tanh (V606 V607) (/ (sinh V606 V607) (cosh V606 V607))) - -(defun sech (V610 V611) (/ 1 (cosh V610 V611))) - -(defun csch (V614 V615) (/ 1 (sinh V614 V615))) - -(defun power (V620 V621) (cond ((= 0 V621) 1) (true (* V620 (power V620 (- V621 1)))))) - -(defun factorial (V624) (cond ((= 0 V624) 1) (true (* V624 (factorial (- V624 1)))))) - -(defun prime? (V626) (cond ((= 2 V626) true) ((even? V626) false) (true (maths.prime-h V626 (isqrt V626) 3)))) - -(defun maths.prime-h (V629 V630 V631) (cond ((> V631 V630) true) ((integer? (/ V629 V631)) false) (true (maths.prime-h V629 V630 (+ V631 2))))) - -(defun maths.sign (V637) (cond ((= 0 V637) 0) ((positive? V637) 1) (true -1))) - -(defun log (V639 V640 V641) (/ (log10 V639 V641) (log10 V640 V641))) - -(defun loge (V645 V646) (log V645 (e) V646)) - -(defun log2 (V649 V650) (log V649 2 V650)) - -(defun log10 (V653 V654) (if (>= V653 1) (maths.log10+ V653 V654) (~ (maths.log10+ (/ 1 V653) V654)))) - -(defun maths.log10+ (V657 V658) (cond ((<= (abs V657) V658) 0) ((>= V657 10) (+ 1 (maths.log10+ (/ V657 10) V658))) (true (* 0.1 (maths.log10+ (power V657 10) (* 10 V658)))))) - -(defun r# (V667 V668) (cond ((and (integer? V667) (integer? V668)) (let W669 (absvector 3) (let W670 (address-> W669 0 rational.print-rational) (let W671 (address-> W669 1 V667) (let W672 (address-> W669 2 V668) W669))))) (true (simple-error (cn "numerator " (shen.app V667 (cn " and divisor " (shen.app V668 " must be integers -" shen.s)) shen.s)))))) - -(defun rational.print-rational (V675) (shen.app (<-address V675 1) (cn "/" (shen.app (<-address V675 2) "" shen.s)) shen.s)) - -(defun rational? (V677) (trap-error (and (absvector? V677) (and (= (<-address V677 0) rational.print-rational) (and (integer? (<-address V677 1)) (integer? (<-address V677 2))))) (lambda Z678 false))) - -(defun numerator (V680) (<-address V680 1)) - -(defun denominator (V682) (<-address V682 2)) - -(defun r-op1 (V722 V723) (n->r (V722 (r->n V723)))) - -(defun r-op2 (V726 V727 V728) (n->r ((V726 (r->n V727)) (r->n V728)))) - -(defun r->n (V732) (/ (numerator V732) (denominator V732))) - -(defun r->pair (V734) (@p (numerator V734) (denominator V734))) - -(defun n->r (V736) (let W737 (maths.n->r V736 1) (r# (fst W737) (snd W737)))) - -(defun r-reduce (V739) (rational.r-reduce-help (numerator V739) (denominator V739))) - -(defun rational.r-reduce-help (V741 V742) (let W743 (lcd V741 V742) (if (= W743 1) (r# V741 V742) (rational.r-reduce-help (/ V741 W743) (/ V742 W743))))) - -(defun r= (V746 V747) (let W748 (numerator V746) (let W749 (denominator V746) (let W750 (numerator V747) (let W751 (denominator V747) (= (* W748 W751) (* W749 W750))))))) - -(defun r< (V754 V755) (let W756 (numerator V754) (let W757 (denominator V754) (let W758 (numerator V755) (let W759 (denominator V755) (< (* W756 W759) (* W757 W758))))))) - -(defun r> (V762 V763) (not (or (r= V762 V763) (r< V762 V763)))) - -(defun r>= (V766 V767) (or (r= V766 V767) (r> V766 V767))) - -(defun r<= (V770 V771) (or (r= V770 V771) (r< V770 V771))) - -(defun r+ (V774 V775) (let W776 (numerator V774) (let W777 (denominator V774) (let W778 (numerator V775) (let W779 (denominator V775) (r# (+ (* W776 W779) (* W777 W778)) (* W777 W779))))))) - -(defun r- (V782 V783) (let W784 (numerator V782) (let W785 (denominator V782) (let W786 (numerator V783) (let W787 (denominator V783) (r# (- (* W784 W787) (* W785 W786)) (* W785 W787))))))) - -(defun r* (V790 V791) (let W792 (numerator V790) (let W793 (denominator V790) (let W794 (numerator V791) (let W795 (denominator V791) (r# (* W792 W794) (* W793 W795))))))) - -(defun +-inverse (V798) (let W799 (numerator V798) (let W800 (denominator V798) (r# (~ W799) W800)))) - -(defun *-inverse (V802) (let W803 (numerator V802) (let W804 (denominator V802) (r# W804 W803)))) - -(defun r/ (V806 V807) (r* V806 (*-inverse V807))) - -(defun r-expt (V812 V813) (cond ((natural? V813) (let W814 (numerator V812) (let W815 (denominator V812) (r# (power W814 V813) (power W815 V813))))) ((and (integer? V813) (negative? V813)) (let W816 (numerator V812) (let W817 (denominator V812) (r# (power W817 (~ V813)) (power W816 (~ V813)))))) (true (simple-error (cn "cannot exponentiate a rational by a non-integer " (shen.app V813 " -" shen.a)))))) - -(defun r-approx (V820 V821) (rational.approx-r-h (r->n V820) V821 0)) - -(defun rational.approx-r-h (V824 V825 V826) (cond ((> (/ V826 V825) V824) (r# V826 V825)) (true (rational.approx-r-h V824 V825 (+ V826 1))))) - -(defun c# (V836 V837) (cond ((and (number? V836) (number? V837)) (let W838 (absvector 3) (let W839 (address-> W838 0 complex.print-complex) (let W840 (address-> W838 1 V836) (let W841 (address-> W838 2 V837) W838))))) (true (simple-error (cn "real " (shen.app V836 (cn " and imaginary " (shen.app V837 " must be numbers -" shen.a)) shen.a)))))) - -(defun complex.print-complex (V844) (shen.insert (<-address V844 2) (shen.insert (<-address V844 1) (shen.proc-nl (cn "(c" "# ~A ~A)"))))) - -(defun complex? (V846) (trap-error (and (absvector? V846) (and (= (<-address V846 0) complex.print-complex) (and (number? (<-address V846 1)) (number? (<-address V846 2))))) (lambda Z847 false))) - -(defun real (V849) (<-address V849 1)) - -(defun imaginary (V851) (<-address V851 2)) - -(defun c+ (V861 V862) (let W863 (real V861) (let W864 (imaginary V861) (let W865 (real V862) (let W866 (imaginary V862) (c# (+ W863 W865) (+ W864 W866))))))) - -(defun c- (V869 V870) (let W871 (real V869) (let W872 (imaginary V869) (let W873 (real V870) (let W874 (imaginary V870) (c# (- W871 W873) (- W872 W874))))))) - -(defun c* (V877 V878) (let W879 (real V877) (let W880 (imaginary V877) (let W881 (real V878) (let W882 (imaginary V878) (c# (- (* W879 W881) (* W880 W882)) (+ (* W880 W881) (* W879 W882)))))))) - -(defun c/ (V885 V886) (let W887 (real V885) (let W888 (imaginary V885) (let W889 (real V886) (let W890 (imaginary V886) (c# (/ (+ (* W887 W889) (* W888 W890)) (+ (* W889 W889) (* W890 W890))) (/ (- (* W888 W889) (* W887 W890)) (+ (* W889 W889) (* W890 W890))))))))) - -(defun n# (V903 V904) (cond ((and (natural? V903) (and (natural? V904) (> V904 0))) (let W905 (absvector 4) (let W906 (address-> W905 0 numerals.print-numeral) (let W907 (address-> W905 1 (((fn numerals.n->numeral) V903) V904)) (let W908 (address-> W905 2 V904) (let W909 (address-> W905 3 V903) W905)))))) (true (simple-error (cn "N = " (shen.app V903 (cn ", Radix = " (shen.app V904 "; N and Radix must be natural numbers where Radix > 0 -" shen.a)) shen.a)))))) - -(defun radix (V912) (<-address V912 2)) - -(defun numerals.numerals (V914) (<-address V914 1)) - -(defun n#->n (V916) (<-address V916 3)) - -(defun n#->ns (V918) (<-address V918 1)) - -(defun numerals.print-numeral (V920) (let W921 (radix V920) (let W922 (numerals.numerals V920) (@s (numerals.numeric->string W922 W921) (@s "#" (str W921)))))) - -(defun numerals.numeric->string (V926 V927) (cond ((= () V926) "") ((cons? V926) (let W928 (if (< (hd V926) 10) (str (hd V926)) (if (> V927 36) (cn (str (hd V926)) " ") (n->string (+ (hd V926) 55)))) (cn W928 (numerals.numeric->string (tl V926) V927)))) (true (shen.f-error numerals.numeric->string)))) - -(defun numeral? (V931) (and (absvector? V931) (= numerals.print-numeral (<-address V931 0)))) - -(defun numerals.numeral-macro (V969) (cond ((and (cons? V969) (and (= n-op2 (hd V969)) (and (cons? (tl V969)) (and (cons? (tl (tl V969))) (and (cons? (tl (tl (tl V969)))) (= () (tl (tl (tl (tl V969)))))))))) (cons n-op2 (cons (hd (tl V969)) (cons (hd (tl (tl V969))) (cons (hd (tl (tl (tl V969)))) (cons (cons radix (cons (hd (tl (tl V969))) ())) ())))))) ((and (cons? V969) (and (= n-op1 (hd V969)) (and (cons? (tl V969)) (and (cons? (tl (tl V969))) (= () (tl (tl (tl V969)))))))) (cons n-op1 (cons (hd (tl V969)) (cons (hd (tl (tl V969))) (cons (cons radix (tl (tl V969))) ()))))) ((and (cons? V969) (and (= n+ (hd V969)) (and (cons? (tl V969)) (and (cons? (tl (tl V969))) (= () (tl (tl (tl V969)))))))) (cons n+ (cons (hd (tl V969)) (cons (hd (tl (tl V969))) (cons (cons radix (cons (hd (tl V969)) ())) ()))))) ((and (cons? V969) (and (= n- (hd V969)) (and (cons? (tl V969)) (and (cons? (tl (tl V969))) (= () (tl (tl (tl V969)))))))) (cons n- (cons (hd (tl V969)) (cons (hd (tl (tl V969))) (cons (cons radix (cons (hd (tl V969)) ())) ()))))) ((and (cons? V969) (and (= n* (hd V969)) (and (cons? (tl V969)) (and (cons? (tl (tl V969))) (= () (tl (tl (tl V969)))))))) (cons n* (cons (hd (tl V969)) (cons (hd (tl (tl V969))) (cons (cons radix (cons (hd (tl V969)) ())) ()))))) ((and (cons? V969) (and (= n/ (hd V969)) (and (cons? (tl V969)) (and (cons? (tl (tl V969))) (= () (tl (tl (tl V969)))))))) (cons n/ (cons (hd (tl V969)) (cons (hd (tl (tl V969))) (cons (cons radix (cons (hd (tl V969)) ())) ()))))) (true V969))) - -(defun n-op2 (V971 V972 V973 V974) (n# ((V971 (n#->n V972)) (n#->n V973)) V974)) - -(defun n-op1 (V979 V980 V981) (n# (V979 (n#->n V980)) V981)) - -(defun n+ (V987 V988 V989) (n-op2 (lambda Z990 (lambda Z991 (+ Z990 Z991))) V987 V988 V989)) - -(defun n* (V997 V998 V999) (n-op2 (lambda Z1000 (lambda Z1001 (* Z1000 Z1001))) V997 V998 V999)) - -(defun n- (V1007 V1008 V1009) (n-op2 (lambda Z1010 (lambda Z1011 (- Z1010 Z1011))) V1007 V1008 V1009)) - -(defun n/ (V1017 V1018 V1019) (n-op2 (lambda Z1020 (lambda Z1021 (/ Z1020 Z1021))) V1017 V1018 V1019)) - -(defun binary (V1025) (n# V1025 2)) - -(defun hex (V1027) (n# V1027 16)) - -(defun octal (V1029) (n# V1029 8)) - -(defun duodecimal (V1031) (n# V1031 12)) - -(defun numerals.n->numeral (V1033 V1034) (cond ((> V1034 V1033) (cons V1033 ())) (true (let W1035 (numerals.largest-expt V1033 V1034 0) (let W1036 (power V1034 W1035) (let W1037 (div V1033 W1036) (let W1038 (cons W1037 (numerals.n-zeros W1035)) (let W1039 (- V1033 (* W1037 W1036)) (numerals.add W1038 (numerals.n->numeral W1039 V1034) V1034))))))))) - -(defun numerals.largest-expt (V1042 V1043 V1044) (cond ((> (power V1043 V1044) V1042) (- V1044 1)) (true (numerals.largest-expt V1042 V1043 (+ V1044 1))))) - -(defun numerals.n-zeros (V1048) (cond ((= 0 V1048) ()) (true (cons 0 (numerals.n-zeros (- V1048 1)))))) - -(defun numerals.add (V1050 V1051 V1052) (reverse (numerals.add-h (reverse V1050) (reverse V1051) V1052 0))) - -(defun numerals.add-h (V1060 V1061 V1062 V1063) (cond ((and (= () V1060) (and (= () V1061) (= 0 V1063))) ()) ((and (= () V1060) (= () V1061)) (cons V1063 ())) ((= () V1060) (numerals.add-h (cons 0 ()) V1061 V1062 V1063)) ((= () V1061) (numerals.add-h V1060 (cons 0 ()) V1062 V1063)) ((and (cons? V1060) (cons? V1061)) (let W1064 (+ (hd V1060) (+ (hd V1061) V1063)) (if (< W1064 V1062) (cons W1064 (numerals.add-h (tl V1060) (tl V1061) V1062 0)) (cons (- V1062 W1064) (numerals.add-h (tl V1060) (tl V1061) V1062 1))))) (true (shen.f-error numerals.add-h)))) - -(defun assoc-if (V1175 V1176) (cond ((= () V1176) ()) ((and (cons? V1176) (and (cons? (hd V1176)) (V1175 (hd (hd V1176))))) (hd V1176)) ((cons? V1176) (assoc-if V1175 (tl V1176))) (true (shen.f-error assoc-if)))) - -(defun assoc-if-not (V1184 V1185) (cond ((= () V1185) ()) ((and (cons? V1185) (and (cons? (hd V1185)) (not (V1184 (hd (hd V1185)))))) (hd V1185)) ((cons? V1185) (assoc-if V1184 (tl V1185))) (true (shen.f-error assoc-if-not)))) - -(defun drop (V1190 V1191) (cond ((= 0 V1190) V1191) ((cons? V1191) (drop (- V1190 1) (tl V1191))) (true (shen.f-error drop)))) - -(defun drop-last (V1194 V1195) (reverse (drop V1194 (reverse V1195)))) - -(defun index (V1198 V1199) (list.index-h V1198 V1199 1)) - -(defun list.index-h (V1211 V1212 V1213) (cond ((= () V1212) -1) ((and (cons? V1212) (= V1211 (hd V1212))) V1213) ((cons? V1212) (list.index-h V1211 (tl V1212) (+ V1213 1))) (true (shen.f-error list.index-h)))) - -(defun index-last (V1217 V1218) (let W1219 (length V1218) (let W1220 (index V1217 (reverse V1218)) (if (= W1220 -1) W1220 (+ (- W1219 W1220) 1))))) - -(defun insert (V1225 V1226 V1227) (cond ((= () V1227) (simple-error (cn "cannot insert " (shen.app V1226 " into list: index out of range -" shen.s)))) ((= 1 V1225) (cons V1226 V1227)) ((cons? V1227) (cons (hd V1227) (insert (- V1225 1) V1226 (tl V1227)))) (true (shen.f-error insert)))) - -(defun remove-duplicates (V1231) (cond ((= () V1231) ()) ((and (cons? V1231) (element? (hd V1231) (tl V1231))) (remove-duplicates (tl V1231))) ((cons? V1231) (cons (hd V1231) (remove-duplicates (tl V1231)))) (true (shen.f-error remove-duplicates)))) - -(defun trim-left-if (V1237 V1238) (cond ((= () V1238) ()) ((and (cons? V1238) (V1237 (hd V1238))) (trim-left-if V1237 (tl V1238))) (true V1238))) - -(defun trim-right-if (V1241 V1242) (reverse (trim-left-if V1241 (reverse V1242)))) - -(defun trim-if (V1245 V1246) (trim-right-if V1245 (trim-left-if V1245 V1246))) - -(defun trim-left (V1253 V1254) (cond ((= () V1254) ()) ((and (cons? V1254) (element? (hd V1254) V1253)) (trim-left V1253 (tl V1254))) (true V1254))) - -(defun trim-right (V1257 V1258) (reverse (trim-left V1257 (reverse V1258)))) - -(defun trim (V1261 V1262) (trim-right V1261 (trim-left V1261 V1262))) - -(defun prefix? (V1272 V1273) (cond ((= () V1272) true) ((and (cons? V1272) (and (cons? V1273) (= (hd V1272) (hd V1273)))) (prefix? (tl V1272) (tl V1273))) (true false))) - -(defun infix? (V1280 V1281) (cond ((prefix? V1280 V1281) true) ((= () V1281) false) ((cons? V1281) (infix? V1280 (tl V1281))) (true (shen.f-error infix?)))) - -(defun suffix? (V1284 V1285) (prefix? (reverse V1284) (reverse V1285))) - -(defun subset? (V1294 V1295) (cond ((= () V1294) true) ((and (cons? V1294) (element? (hd V1294) V1295)) (subset? (tl V1294) V1295)) (true false))) - -(defun set=? (V1298 V1299) (and (subset? V1298 V1299) (subset? V1299 V1298))) - -(defun set? (V1304) (cond ((= () V1304) true) ((and (cons? V1304) (element? (hd V1304) (tl V1304))) false) ((cons? V1304) (set? (tl V1304))) (true (shen.f-error set?)))) - -(defun n-times (V1306 V1307) (list.n-times-h V1307 V1306 ())) - -(defun list.n-times-h (V1310 V1311 V1312) (cond ((= 0 V1310) V1312) (true (list.n-times-h (- V1310 1) V1311 (cons V1311 V1312))))) - -(defun subbag? (V1316 V1317) (every? (lambda Z1318 (= (count Z1318 V1316) (count Z1318 V1317))) V1316)) - -(defun bag=? (V1321 V1322) (and (subbag? V1321 V1322) (subbag? V1322 V1321))) - -(defun mapc (V1327 V1328) (cond ((= () V1328) ()) ((cons? V1328) (mapc (do (V1327 (hd V1328)) V1327) (tl V1328))) (true (shen.f-error mapc)))) - -(defun permute (V1331) (cond ((= () V1331) (cons () ())) (true (mapcan (lambda Z1332 (map (lambda Z1333 (cons Z1332 Z1333)) (permute (remove Z1332 V1331)))) V1331)))) - -(defun count-if (V1335 V1336) (length (mapcan (lambda Z1337 (if (V1335 Z1337) (cons Z1337 ()) ())) V1336))) - -(defun count (V1341 V1342) (count-if (lambda Z1343 (= V1341 Z1343)) V1342)) - -(defun some? (V1351 V1352) (cond ((= () V1352) false) ((and (cons? V1352) (V1351 (hd V1352))) true) ((cons? V1352) (some? V1351 (tl V1352))) (true (shen.f-error some?)))) - -(defun every? (V1361 V1362) (cond ((= () V1362) true) ((and (cons? V1362) (V1361 (hd V1362))) (every? V1361 (tl V1362))) (true false))) - -(defun sort (V1369 V1370) (cond ((= () V1370) ()) ((and (cons? V1370) (= () (tl V1370))) V1370) ((cons? V1370) (let W1371 (mapcan (lambda Z1372 (if ((V1369 Z1372) (hd V1370)) (cons Z1372 ()) ())) (tl V1370)) (let W1373 (mapcan (lambda Z1374 (if (not ((V1369 Z1374) (hd V1370))) (cons Z1374 ()) ())) (tl V1370)) (append (sort V1369 W1371) (append (cons (hd V1370) ()) (sort V1369 W1373)))))) (true (shen.f-error sort)))) - -(defun find (V1382 V1383) (cond ((= () V1383) (simple-error "find has found no element -")) ((and (cons? V1383) (V1382 (hd V1383))) (hd V1383)) ((cons? V1383) (find V1382 (tl V1383))) (true (shen.f-error find)))) - -(defun foldr (V1388 V1389 V1390) (cond ((= () V1390) V1389) ((cons? V1390) (foldr V1388 ((V1388 (hd V1390)) V1389) (tl V1390))) (true (shen.f-error foldr)))) - -(defun foldl (V1396 V1397 V1398) (cond ((= () V1398) V1397) ((cons? V1398) (foldl V1396 ((V1396 V1397) (hd V1398)) (tl V1398))) (true (shen.f-error foldl)))) - -(defun mapf (V1406 V1407 V1408) (cond ((= () V1407) ()) ((cons? V1407) ((V1408 (V1406 (hd V1407))) (mapf V1406 (tl V1407) V1408))) (true (shen.f-error mapf)))) - -(defun filter (V1414 V1415) (cond ((= () V1415) ()) ((cons? V1415) (if (V1414 (hd V1415)) (cons (hd V1415) (filter V1414 (tl V1415))) (filter V1414 (tl V1415)))) (true (shen.f-error filter)))) - -(defun remove-if (V1420 V1421) (cond ((= () V1421) ()) ((cons? V1421) (if (V1420 (hd V1421)) (remove-if V1420 (tl V1421)) (cons (hd V1421) (remove-if V1420 (tl V1421))))) (true (shen.f-error remove-if)))) - -(defun list.reduce (V1424 V1425 V1426) (cond ((= () V1426) V1425) ((cons? V1426) (list.reduce V1424 ((V1424 V1425) (hd V1426)) (tl V1426))) (true (shen.f-error list.reduce)))) - -(defun take (V1434 V1435) (cond ((= 0 V1434) ()) ((= () V1435) ()) ((cons? V1435) (cons (hd V1435) (take (- V1434 1) (tl V1435)))) (true (shen.f-error take)))) - -(defun take-last (V1438 V1439) (reverse (take V1438 (reverse V1439)))) - -(defun cartprod (V1444 V1445) (cond ((= () V1444) ()) ((cons? V1444) (append (map (lambda Z1446 (cons (hd V1444) (cons Z1446 ()))) V1445) (cartprod (tl V1444) V1445))) (true (shen.f-error cartprod)))) - -(defun powerset (V1449) (cond ((= () V1449) (cons () ())) ((cons? V1449) (let W1450 (powerset (tl V1449)) (append W1450 (map (lambda Z1451 (cons (hd V1449) Z1451)) W1450)))) (true (shen.f-error powerset)))) - -(defun partition (V1459 V1460) (cond ((= () V1460) ()) ((cons? V1460) (let W1461 (mapcan (lambda Z1462 (if ((V1459 (hd V1460)) Z1462) (cons Z1462 ()) ())) V1460) (let W1463 (difference V1460 W1461) (cons W1461 (partition V1459 W1463))))) (true (simple-error "partition equires a list")))) - -(defun transitive-closure (V1466) (let W1467 (list.transitive-pass V1466 V1466) (if (= W1467 V1466) W1467 (list.transitive-pass W1467 W1467)))) - -(defun list.transitive-pass (V1469 V1470) (cond ((= () V1469) V1470) ((and (cons? V1469) (tuple? (hd V1469))) (let W1471 (list.find-trans (fst (hd V1469)) (snd (hd V1469)) V1470) (union W1471 (list.transitive-pass (tl V1469) V1470)))) (true (shen.f-error list.transitive-pass)))) - -(defun list.find-trans (V1481 V1482 V1483) (cond ((= () V1483) ()) ((and (cons? V1483) (and (tuple? (hd V1483)) (= V1482 (fst (hd V1483))))) (cons (@p V1481 (snd (hd V1483))) (list.find-trans V1481 (fst (hd V1483)) (tl V1483)))) ((cons? V1483) (list.find-trans V1481 V1482 (tl V1483))) (true (shen.f-error list.find-trans)))) - -(defun x->ascii (V1488) (map (lambda Z1489 (string->n Z1489)) (explode V1488))) - -(defun splice (V1491 V1492 V1493) (cond ((= 1 V1491) (append V1492 V1493)) ((cons? V1493) (cons (hd V1493) (splice (- V1491 1) V1492 (tl V1493)))) (true (shen.f-error splice)))) - -(defun string-macros (V1497) (cond ((and (cons? V1497) (and (= s-op1 (hd V1497)) (and (cons? (tl V1497)) (and (cons? (tl (tl V1497))) (= () (tl (tl (tl V1497)))))))) (cons s-op1 (cons (hd (tl V1497)) (cons (hd (tl (tl V1497))) (cons (cons /. (cons X (cons X ()))) ()))))) ((and (cons? V1497) (and (= s-op2 (hd V1497)) (and (cons? (tl V1497)) (and (cons? (tl (tl V1497))) (and (cons? (tl (tl (tl V1497)))) (= () (tl (tl (tl (tl V1497)))))))))) (cons s-op2 (cons (hd (tl V1497)) (cons (hd (tl (tl V1497))) (cons (hd (tl (tl (tl V1497)))) (cons (cons /. (cons X (cons X ()))) ())))))) (true V1497))) - -(defun string->list (V1587) (cond ((= "" V1587) ()) (true (string.s->l-h V1587 1 (pos V1587 0) ())))) - -(defun string.s->l-h (V1589 V1590 V1591 V1592) (cond ((= "" V1591) (reverse V1592)) (true (string.s->l-h V1589 (+ V1590 1) (trap-error (pos V1589 V1590) (lambda Z1593 "")) (cons V1591 V1592))))) - -(defun list->string (V1598) (cond ((= () V1598) "") ((cons? V1598) (cn (hd V1598) (list->string (tl V1598)))) (true (shen.f-error list->string)))) - -(defun s-op1 (V1600 V1601 V1602) (V1602 (V1600 (string->list V1601)))) - -(defun s-op2 (V1606 V1607 V1608 V1609) (V1609 ((V1606 (string->list V1607)) (string->list V1608)))) - -(defun string.count (V1619 V1620) (cond ((= "" V1620) 0) ((and (shen.+string? V1620) (= V1619 (hdstr V1620))) (+ 1 (string.count (hdstr V1620) (tlstr V1620)))) ((shen.+string? V1620) (string.count V1619 (tlstr V1620))) (true (shen.f-error string.count)))) - -(defun string.reverse (V1625) (s-op1 (lambda Z1626 (reverse Z1626)) V1625 (lambda Z1627 (list->string Z1627)))) - -(defun string.element? (V1629 V1630) (s-op1 (lambda Z1631 (element? V1629 Z1631)) V1630 (lambda Z1632 Z1632))) - -(defun string.prefix? (V1637 V1638) (s-op2 (lambda Z1639 (lambda Z1640 (prefix? Z1639 Z1640))) V1637 V1638 (lambda Z1641 Z1641))) - -(defun string.infix? (V1646 V1647) (s-op2 (lambda Z1648 (lambda Z1649 (infix? Z1648 Z1649))) V1646 V1647 (lambda Z1650 Z1650))) - -(defun string.suffix? (V1655 V1656) (s-op2 (lambda Z1657 (lambda Z1658 (suffix? Z1657 Z1658))) V1655 V1656 (lambda Z1659 Z1659))) - -(defun string.subset? (V1664 V1665) (s-op2 (lambda Z1666 (lambda Z1667 (subset? Z1666 Z1667))) V1664 V1665 (lambda Z1668 Z1668))) - -(defun string.set=? (V1673 V1674) (s-op2 (lambda Z1675 (lambda Z1676 (set=? Z1675 Z1676))) V1673 V1674 (lambda Z1677 Z1677))) - -(defun string.set? (V1681) (s-op1 (lambda Z1682 (set? Z1682)) V1681 (lambda Z1683 Z1683))) - -(defun file-extension (V1685 V1686) (cn (strip-extension V1685) V1686)) - -(defun strip-extension (V1691) (cond ((= "" V1691) "") ((and (shen.+string? V1691) (= "." (hdstr V1691))) "") ((shen.+string? V1691) (@s (hdstr V1691) (strip-extension (tlstr V1691)))) (true (shen.f-error strip-extension)))) - -(defun string.length (V1694) (s-op1 (lambda Z1695 (length Z1695)) V1694 (lambda Z1696 Z1696))) - -(defun string.trim (V1700 V1701) (s-op1 (lambda Z1702 (trim V1700 Z1702)) V1701 (lambda Z1703 (list->string Z1703)))) - -(defun string.trim-if (V1708 V1709) (s-op1 (lambda Z1710 (trim-if V1708 Z1710)) V1709 (lambda Z1711 (list->string Z1711)))) - -(defun string.trim-right-if (V1716 V1717) (s-op1 (lambda Z1718 (trim-right-if V1716 Z1718)) V1717 (lambda Z1719 (list->string Z1719)))) - -(defun string.trim-left-if (V1724 V1725) (s-op1 (lambda Z1726 (trim-left-if V1724 Z1726)) V1725 (lambda Z1727 (list->string Z1727)))) - -(defun string.trim-right (V1732 V1733) (s-op1 (lambda Z1734 (trim-right V1732 Z1734)) V1733 (lambda Z1735 (list->string Z1735)))) - -(defun string.trim-left (V1740 V1741) (s-op1 (lambda Z1742 (trim-left V1740 Z1742)) V1741 (lambda Z1743 (list->string Z1743)))) - -(defun string.some? (V1748 V1749) (cond ((= "" V1749) false) ((shen.+string? V1749) (or (V1748 (hdstr V1749)) (string.some? V1748 (tlstr V1749)))) (true (shen.f-error string.some?)))) - -(defun string.every? (V1754 V1755) (cond ((= "" V1755) true) ((shen.+string? V1755) (and (V1754 (hdstr V1755)) (string.every? V1754 (tlstr V1755)))) (true (shen.f-error string.every?)))) - -(defun string.difference (V1761 V1762) (s-op2 (lambda Z1763 (lambda Z1764 (difference Z1763 Z1764))) V1761 V1762 (lambda Z1765 (list->string Z1765)))) - -(defun string.intersection (V1771 V1772) (s-op2 (lambda Z1773 (lambda Z1774 (intersection Z1773 Z1774))) V1771 V1772 (lambda Z1775 (list->string Z1775)))) - -(defun string.nth (V1778 V1779) (pos V1779 (+ V1778 1))) - -(defun whitespace? (V1784) (cond ((shen.+string? V1784) (let W1785 (string->n (hdstr V1784)) (element? W1785 (cons 9 (cons 10 (cons 13 (cons 32 ()))))))) (true (shen.f-error whitespace?)))) - -(defun uppercase? (V1789) (cond ((shen.+string? V1789) (let W1790 (string->n (hdstr V1789)) (and (> W1790 64) (< W1790 91)))) (true (shen.f-error uppercase?)))) - -(defun lowercase? (V1794) (cond ((shen.+string? V1794) (let W1795 (string->n (hdstr V1794)) (and (> W1795 96) (< W1795 123)))) (true (shen.f-error lowercase?)))) - -(defun digit? (V1799) (cond ((shen.+string? V1799) (let W1800 (string->n (hdstr V1799)) (and (> W1800 47) (< W1800 58)))) (true (shen.f-error digit?)))) - -(defun alpha? (V1806) (cond ((shen.+string? V1806) (let W1807 (string->n (hdstr V1806)) (or (and (> W1807 64) (< W1807 91)) (and (> W1807 96) (< W1807 123))))) (true false))) - -(defun alphanum? (V1813) (cond ((shen.+string? V1813) (let W1814 (string->n (hdstr V1813)) (or (and (> W1814 64) (< W1814 91)) (or (and (> W1814 96) (< W1814 123)) (and (> W1814 47) (< W1814 58)))))) (true false))) - -(defun tokenise (V1816 V1817) (string.tokenise-h V1816 V1817 "")) - -(defun string.tokenise-h (V1822 V1823 V1824) (cond ((= "" V1823) (cons V1824 ())) ((and (shen.+string? V1823) (V1822 (hdstr V1823))) (cons V1824 (string.tokenise-h V1822 (tlstr V1823) ""))) ((shen.+string? V1823) (string.tokenise-h V1822 (tlstr V1823) (@s V1824 (hdstr V1823)))) (true (shen.f-error string.tokenise-h)))) - -(defun uppercase (V1828) (cond ((shen.+string? V1828) (if (lowercase? (hdstr V1828)) (@s (n->string (- (string->n (hdstr V1828)) 32)) (tlstr V1828)) V1828)) (true (shen.f-error uppercase)))) - -(defun lowercase (V1830) (cond ((shen.+string? V1830) (if (uppercase? (hdstr V1830)) (@s (n->string (+ (string->n (hdstr V1830)) 32)) (tlstr V1830)) V1830)) (true (shen.f-error lowercase)))) - -(defun string.map (V1834 V1835) (cond ((= "" V1835) "") ((shen.+string? V1835) (@s (V1834 (hdstr V1835)) (string.map V1834 (tlstr V1835)))) (true (shen.f-error string.map)))) - -(defun spell-number (V1839) (cond ((= 0 V1839) "zero") (true (string.scale (map (lambda Z1840 (string.digits Z1840)) (string.triples (explode V1839))))))) - -(defun string.digit (V1842) (cond ((= "0" V1842) "") ((= "1" V1842) "one") ((= "2" V1842) "two") ((= "3" V1842) "three") ((= "4" V1842) "four") ((= "5" V1842) "five") ((= "6" V1842) "six") ((= "7" V1842) "seven") ((= "8" V1842) "eight") ((= "9" V1842) "nine") (true (shen.f-error string.digit)))) - -(defun string.triples (V1844) (string.triples-h (reverse V1844) ())) - -(defun string.triples-h (V1846 V1847) (cond ((and (cons? V1846) (and (cons? (tl V1846)) (cons? (tl (tl V1846))))) (string.triples-h (tl (tl (tl V1846))) (cons (reverse (cons (hd V1846) (cons (hd (tl V1846)) (cons (hd (tl (tl V1846))) ())))) V1847))) (true (cons (reverse V1846) V1847)))) - -(defun string.digits (V1850) (cond ((and (cons? V1850) (and (= "0" (hd V1850)) (and (cons? (tl V1850)) (and (= "0" (hd (tl V1850))) (and (cons? (tl (tl V1850))) (and (= "0" (hd (tl (tl V1850)))) (= () (tl (tl (tl V1850)))))))))) "") ((and (cons? V1850) (and (cons? (tl V1850)) (and (= "0" (hd (tl V1850))) (and (cons? (tl (tl V1850))) (and (= "0" (hd (tl (tl V1850)))) (= () (tl (tl (tl V1850))))))))) (@s (string.digit (hd V1850)) (@s " " "hundred"))) ((and (cons? V1850) (and (= "0" (hd V1850)) (and (cons? (tl V1850)) (and (= "0" (hd (tl V1850))) (and (cons? (tl (tl V1850))) (= () (tl (tl (tl V1850))))))))) (@s "a" (@s "n" (@s "d" (@s " " (string.digit (hd (tl (tl V1850))))))))) ((and (cons? V1850) (and (= "0" (hd V1850)) (and (cons? (tl V1850)) (and (cons? (tl (tl V1850))) (= () (tl (tl (tl V1850)))))))) (@s "a" (@s "n" (@s "d" (@s " " (string.tens (hd (tl V1850)) (hd (tl (tl V1850))))))))) ((and (cons? V1850) (and (cons? (tl V1850)) (and (= "0" (hd (tl V1850))) (and (cons? (tl (tl V1850))) (= () (tl (tl (tl V1850)))))))) (@s (string.digit (hd V1850)) (@s " " (@s "h" (@s "u" (@s "n" (@s "d" (@s "r" (@s "e" (@s "d" (@s " " (@s "a" (@s "n" (@s "d" (@s " " (string.digit (hd (tl (tl V1850))))))))))))))))))) ((and (cons? V1850) (and (cons? (tl V1850)) (and (cons? (tl (tl V1850))) (= () (tl (tl (tl V1850))))))) (@s (string.digit (hd V1850)) (@s " " (@s "h" (@s "u" (@s "n" (@s "d" (@s "r" (@s "e" (@s "d" (@s " " (@s "a" (@s "n" (@s "d" (@s " " (string.tens (hd (tl V1850)) (hd (tl (tl V1850))))))))))))))))))) ((and (cons? V1850) (and (cons? (tl V1850)) (= () (tl (tl V1850))))) (string.tens (hd V1850) (hd (tl V1850)))) ((and (cons? V1850) (= () (tl V1850))) (string.digit (hd V1850))) ((= () V1850) "") (true (shen.f-error string.digits)))) - -(defun string.tens (V1852 V1853) (cond ((= "1" V1852) (if (= V1853 "0") "ten" (if (= V1853 "1") "eleven" (if (= V1853 "2") "twelve" (if (= V1853 "3") "thirteen" (if (= V1853 "4") "fourteen" (if (= V1853 "5") "fifteen" (if (= V1853 "6") "sixteen" (if (= V1853 "7") "seventeen" (if (= V1853 "8") "eighteen" (if (= V1853 "9") "nineteen" (simple-error "error: cases exhausted")))))))))))) ((= "2" V1852) (@s "t" (@s "w" (@s "e" (@s "n" (@s "t" (@s "y" (@s " " (string.digit V1853))))))))) ((= "3" V1852) (@s "t" (@s "h" (@s "i" (@s "r" (@s "t" (@s "y" (@s " " (string.digit V1853))))))))) ((= "4" V1852) (@s "f" (@s "o" (@s "r" (@s "t" (@s "y" (@s " " (string.digit V1853)))))))) ((= "5" V1852) (@s "f" (@s "i" (@s "f" (@s "t" (@s "y" (@s " " (string.digit V1853)))))))) ((= "6" V1852) (@s "s" (@s "i" (@s "x" (@s "t" (@s "y" (@s " " (string.digit V1853)))))))) ((= "7" V1852) (@s "s" (@s "e" (@s "v" (@s "e" (@s "n" (@s "t" (@s "y" (@s " " (string.digit V1853)))))))))) ((= "8" V1852) (@s "e" (@s "i" (@s "g" (@s "h" (@s "t" (@s "y" (@s " " (string.digit V1853))))))))) ((= "9" V1852) (@s "n" (@s "i" (@s "n" (@s "e" (@s "t" (@s "y" (@s " " (string.digit V1853))))))))) (true (shen.f-error string.tens)))) - -(defun string.scale (V1856) (cond ((and (cons? V1856) (= () (tl V1856))) (hd V1856)) ((and (cons? V1856) (= "" (hd V1856))) (string.scale (tl V1856))) ((cons? V1856) (@s (hd V1856) (@s (string.units (length V1856)) (string.scale (tl V1856))))) (true (shen.f-error string.scale)))) - -(defun string.units (V1860) (cond ((= 2 V1860) " thousand ") ((= 3 V1860) " million ") ((= 4 V1860) " billion ") ((= 5 V1860) " trillion ") (true (simple-error "this number has a magnitude beyond our text representation")))) - -(defun string>? (V1866 V1867) (cond ((= "" V1866) false) ((= "" V1867) true) ((and (shen.+string? V1866) (shen.+string? V1867)) (let W1868 (string->n (hdstr V1866)) (let W1869 (string->n (hdstr V1867)) (if (> W1868 W1869) true (if (< W1868 W1869) false (string>? (tlstr V1866) (tlstr V1867))))))) (true (shen.f-error string>?)))) - -(defun stringn (hdstr V1876)) (let W1879 (string->n (hdstr V1877)) (if (< W1878 W1879) true (if (> W1878 W1879) false (string=? (V1882 V1883) (or (= V1882 V1883) (string>? V1882 V1883))) - -(defun string<=? (V1886 V1887) (or (= V1886 V1887) (stringstrings W1900 ()) (let W1902 (compile (fn string.) W1901) (let W1903 (file-extension V1898 V1899) (let W1904 (write-to-file W1903 W1902) W1903)))))) - -(defun string.bytes->strings (V1907 V1908) (cond ((= () V1907) (reverse V1908)) ((cons? V1907) (string.bytes->strings (tl V1907) (cons (n->string (hd V1907)) V1908))) (true (shen.f-error string.bytes->strings)))) - -(defun render (V1911) (compile (fn string.) (string->list V1911))) - -(defun string.rendered? (V1917) (cond ((= "" V1917) true) ((and (shen.+string? V1917) (= "{" (hdstr V1917))) false) ((shen.+string? V1917) (string.rendered? (tlstr V1917))) (true (shen.f-error string.rendered?)))) - -(defun string. (V1924) (let W1925 (if (shen.hds=? V1924 "{") (let W1926 (tail V1924) (let W1927 ((fn string.) W1926) (if (shen.parse-failure? W1927) (shen.parse-failure) (let W1928 (shen.<-out W1927) (let W1929 (shen.in-> W1927) (let W1930 ((fn string.) W1929) (if (shen.parse-failure? W1930) (shen.parse-failure) (let W1931 (shen.in-> W1930) (let W1932 ((fn string.) W1931) (if (shen.parse-failure? W1932) (shen.parse-failure) (let W1933 (shen.<-out W1932) (let W1934 (shen.in-> W1932) (if (shen.hds=? W1934 "}") (let W1935 (tail W1934) (let W1936 ((fn string.) W1935) (if (shen.parse-failure? W1936) (shen.parse-failure) (let W1937 (shen.<-out W1936) (let W1938 (shen.in-> W1936) (shen.comb W1938 (cn (string.recapply (fn (intern W1928)) W1933) W1937))))))) (shen.parse-failure)))))))))))))) (shen.parse-failure)) (if (shen.parse-failure? W1925) (let W1939 (if (shen.hds=? V1924 "{") (let W1940 (tail V1924) (let W1941 ((fn string.) W1940) (if (shen.parse-failure? W1941) (shen.parse-failure) (let W1942 (shen.<-out W1941) (let W1943 (shen.in-> W1941) (if (shen.hds=? W1943 "}") (let W1944 (tail W1943) (let W1945 ((fn string.) W1944) (if (shen.parse-failure? W1945) (shen.parse-failure) (let W1946 (shen.<-out W1945) (let W1947 (shen.in-> W1945) (shen.comb W1947 (cn ((intern W1942)) W1946))))))) (shen.parse-failure))))))) (shen.parse-failure)) (if (shen.parse-failure? W1939) (let W1948 (let W1949 ((fn string.) V1924) (if (shen.parse-failure? W1949) (shen.parse-failure) (let W1950 (shen.<-out W1949) (let W1951 (shen.in-> W1949) (let W1952 ((fn string.) W1951) (if (shen.parse-failure? W1952) (shen.parse-failure) (let W1953 (shen.<-out W1952) (let W1954 (shen.in-> W1952) (shen.comb W1954 (cn W1950 W1953)))))))))) (if (shen.parse-failure? W1948) (let W1955 (let W1956 ( V1924) (if (shen.parse-failure? W1956) (shen.parse-failure) (let W1957 (shen.in-> W1956) (shen.comb W1957 "")))) (if (shen.parse-failure? W1955) (shen.parse-failure) W1955)) W1948)) W1939)) W1925))) - -(defun string. (V1961) (let W1962 (if (cons? V1961) (let W1963 (head V1961) (let W1964 (tail V1961) (if (and (not (= W1963 "}")) (not (= W1963 "\"))) (shen.comb W1964 W1963) (shen.parse-failure)))) (shen.parse-failure)) (if (shen.parse-failure? W1962) (shen.parse-failure) W1962))) - -(defun string.recapply (V1966 V1967) (cond ((= () V1967) V1966) ((cons? V1967) (string.recapply (V1966 (hd V1967)) (tl V1967))) (true (shen.f-error string.recapply)))) - -(defun string. (V1972) (let W1973 (let W1974 ((fn string.) V1972) (if (shen.parse-failure? W1974) (shen.parse-failure) (let W1975 (shen.<-out W1974) (let W1976 (shen.in-> W1974) (if (shen.hds=? W1976 "\") (let W1977 (tail W1976) (let W1978 ((fn string.) W1977) (if (shen.parse-failure? W1978) (shen.parse-failure) (let W1979 (shen.<-out W1978) (let W1980 (shen.in-> W1978) (shen.comb W1980 (cons W1975 W1979))))))) (shen.parse-failure)))))) (if (shen.parse-failure? W1973) (let W1981 (let W1982 ((fn string.) V1972) (if (shen.parse-failure? W1982) (shen.parse-failure) (let W1983 (shen.<-out W1982) (let W1984 (shen.in-> W1982) (shen.comb W1984 (cons W1983 ())))))) (if (shen.parse-failure? W1981) (shen.parse-failure) W1981)) W1973))) - -(defun string. (V1987) (let W1988 (let W1989 (string. V1987) (if (shen.parse-failure? W1989) (shen.parse-failure) (let W1990 (shen.<-out W1989) (let W1991 (shen.in-> W1989) (shen.comb W1991 W1990))))) (if (shen.parse-failure? W1988) (shen.parse-failure) W1988))) - -(defun string. (V1995) (let W1996 (if (cons? V1995) (let W1997 (head V1995) (let W1998 (tail V1995) (if (and (not (= W1997 "}")) (not (= W1997 "\"))) (shen.comb W1998 W1997) (shen.parse-failure)))) (shen.parse-failure)) (if (shen.parse-failure? W1996) (shen.parse-failure) W1996))) - -(defun string. (V2002) (let W2003 (if (cons? V2002) (let W2004 (head V2002) (let W2005 (tail V2002) (if (whitespace? W2004) (shen.comb W2005 string.skip) (shen.parse-failure)))) (shen.parse-failure)) (if (shen.parse-failure? W2003) (shen.parse-failure) W2003))) - -(defun string. (V2008) (let W2009 (let W2010 ((fn string.) V2008) (if (shen.parse-failure? W2010) (shen.parse-failure) (let W2011 (shen.<-out W2010) (let W2012 (shen.in-> W2010) (let W2013 ((fn string.) W2012) (if (shen.parse-failure? W2013) (shen.parse-failure) (let W2014 (shen.<-out W2013) (let W2015 (shen.in-> W2013) (shen.comb W2015 (cn W2011 W2014)))))))))) (if (shen.parse-failure? W2009) (let W2016 (let W2017 ( V2008) (if (shen.parse-failure? W2017) (shen.parse-failure) (let W2018 (shen.in-> W2017) (shen.comb W2018 "")))) (if (shen.parse-failure? W2016) (shen.parse-failure) W2016)) W2009))) - -(defun string. (V2022) (let W2023 (if (cons? V2022) (let W2024 (head V2022) (let W2025 (tail V2022) (if (and (not (= W2024 "}")) (and (not (= W2024 "\")) (not (whitespace? W2024)))) (shen.comb W2025 W2024) (shen.parse-failure)))) (shen.parse-failure)) (if (shen.parse-failure? W2023) (shen.parse-failure) W2023))) - -(defun vector.vector-macros (V2049) (cond ((and (cons? V2049) (and (= := (hd V2049)) (and (cons? (tl V2049)) (and (cons? (tl (tl V2049))) (= () (tl (tl (tl V2049)))))))) (vector.<-array (hd (tl V2049)) (hd (tl (tl V2049))))) ((and (cons? V2049) (and (cons? (tl V2049)) (and (cons? (tl (tl V2049))) (and (= := (hd (tl (tl V2049)))) (and (cons? (tl (tl (tl V2049)))) (cons? (tl (tl (tl (tl V2049)))))))))) (vector.key (hd V2049) (hd (tl V2049)) (vector.array-> (hd V2049) (hd (tl V2049)) (vector.<-array (hd (tl (tl (tl V2049)))) (hd (tl (tl (tl (tl V2049))))))) (tl (tl (tl (tl (tl V2049))))))) ((and (cons? V2049) (and (cons? (tl V2049)) (and (cons? (tl (tl V2049))) (and (= := (hd (tl (tl V2049)))) (cons? (tl (tl (tl V2049)))))))) (vector.key (hd V2049) (hd (tl V2049)) (vector.array-> (hd V2049) (hd (tl V2049)) (hd (tl (tl (tl V2049))))) (tl (tl (tl (tl V2049)))))) ((and (cons? V2049) (and (= vector.array-> (hd V2049)) (and (cons? (tl V2049)) (and (cons? (tl (tl V2049))) (and (cons? (tl (tl (tl V2049)))) (= () (tl (tl (tl (tl V2049)))))))))) (vector.array-> (hd (tl V2049)) (hd (tl (tl V2049))) (hd (tl (tl (tl V2049)))))) ((and (cons? V2049) (and (= array (hd V2049)) (and (cons? (tl V2049)) (= () (tl (tl V2049)))))) (vector.build-array (hd (tl V2049)))) ((and (cons? V2049) (and (= populate (hd V2049)) (and (cons? (tl V2049)) (and (cons? (tl (tl V2049))) (and (cons? (hd (tl (tl V2049)))) (and (= cons (hd (hd (tl (tl V2049))))) (and (cons? (tl (hd (tl (tl V2049))))) (and (cons? (tl (tl (hd (tl (tl V2049)))))) (and (= () (tl (tl (tl (hd (tl (tl V2049))))))) (= () (tl (tl (tl V2049))))))))))))) (vector.unfold-populate (hd (tl V2049)) (hd (tl (tl V2049))))) ((and (cons? V2049) (and (= vector->list (hd V2049)) (and (cons? (tl V2049)) (= () (tl (tl V2049)))))) (cons vector->list (cons (hd (tl V2049)) (cons () ())))) ((and (cons? V2049) (and (= v-op1 (hd V2049)) (and (cons? (tl V2049)) (and (cons? (tl (tl V2049))) (= () (tl (tl (tl V2049)))))))) (cons v-op1 (cons (hd (tl V2049)) (cons (hd (tl (tl V2049))) (cons () ()))))) ((and (cons? V2049) (and (= v-op2 (hd V2049)) (and (cons? (tl V2049)) (and (cons? (tl (tl V2049))) (and (cons? (tl (tl (tl V2049)))) (= () (tl (tl (tl (tl V2049)))))))))) (cons v-op2 (cons (hd (tl V2049)) (cons (hd (tl (tl V2049))) (cons (hd (tl (tl (tl V2049)))) (cons () ())))))) (true V2049))) - -(defun vector.key (V2065 V2066 V2067 V2068) (cond ((= () V2068) V2067) ((and (cons? V2068) (and (= error (hd V2068)) (= () (tl V2068)))) V2067) ((and (cons? V2068) (and (= ignore (hd V2068)) (= () (tl V2068)))) (cons trap-error (cons V2067 (cons (cons /. (cons (newv) (cons V2065 ()))) ())))) ((and (cons? V2068) (and (= insert (hd V2068)) (and (cons? (tl V2068)) (= () (tl (tl V2068)))))) (cons trap-error (cons V2067 (cons (cons /. (cons (newv) (cons (cons V2065 (cons V2066 (cons := (tl V2068)))) ()))) ())))) ((and (cons? V2068) (and (= overwrite (hd V2068)) (= () (tl V2068)))) (cons trap-error (cons V2067 (cons (cons /. (cons (newv) (cons (cons depopulate (cons V2065 (cons V2066 ()))) ()))) ())))) (true (simple-error (cn "key not recognised " (shen.app V2068 " -" shen.a)))))) - -(defun vector.build-array (V2073) (cond ((and (cons? V2073) (and (= cons (hd V2073)) (and (cons? (tl V2073)) (and (cons? (tl (tl V2073))) (and (= () (hd (tl (tl V2073)))) (= () (tl (tl (tl V2073))))))))) (cons vector (cons (hd (tl V2073)) ()))) ((and (cons? V2073) (and (= cons (hd V2073)) (and (cons? (tl V2073)) (and (cons? (tl (tl V2073))) (= () (tl (tl (tl V2073)))))))) (let W2074 (newv) (let W2075 (newv) (cons let (cons W2075 (cons (cons vector (cons (hd (tl V2073)) ())) (cons (cons for (cons W2074 (cons = (cons 1 (cons (cons <= (cons W2074 (cons (hd (tl V2073)) ()))) (cons (cons vector-> (cons W2075 (cons W2074 (cons (vector.build-array (hd (tl (tl V2073)))) ())))) ())))))) ()))))))) (true (simple-error (cn "array cannot macro expand the dimensional argument " (shen.app V2073 " -" shen.r)))))) - -(defun depopulate (V2079 V2080) (cond ((and (cons? V2080) (= () (tl V2080))) (address-> V2079 (hd V2080) (fail))) ((cons? V2080) (do (depopulate (<-vector V2079 (hd V2080)) (tl V2080)) V2079)) (true (simple-error (cn "depopulate cannot use the dimensional argument " (shen.app V2080 " -" shen.s)))))) - -(defun populated? (V2083 V2084) (cond ((and (cons? V2084) (= () (tl V2084))) (not (= (<-address V2083 (hd V2084)) (fail)))) ((cons? V2084) (populated? (<-address V2083 (hd V2084)) (tl V2084))) (true (shen.f-error populated?)))) - -(defun vector.unfold-populate (V2087 V2088) (cond ((and (cons? V2088) (and (= cons (hd V2088)) (and (cons? (tl V2088)) (and (cons? (tl (tl V2088))) (and (= () (hd (tl (tl V2088)))) (= () (tl (tl (tl V2088))))))))) (cons populate (cons V2087 (cons (hd (tl V2088)) ())))) ((and (cons? V2088) (and (= cons (hd V2088)) (and (cons? (tl V2088)) (and (cons? (tl (tl V2088))) (= () (tl (tl (tl V2088)))))))) (cons populate (cons (cons /. (cons (newv) (cons (vector.unfold-populate V2087 (hd (tl (tl V2088)))) ()))) (cons (hd (tl V2088)) ())))) (true (shen.f-error vector.unfold-populate)))) - -(defun populate (V2094 V2095) (let W2096 (absvector (+ V2095 1)) (let W2097 (address-> W2096 0 V2095) (for 1 (lambda Z2098 (<= Z2098 V2095)) (lambda Z2099 (address-> W2096 Z2099 (V2094 Z2099))) (lambda Z2100 (+ 1 Z2100)) (lambda Z2101 (lambda Z2102 (do Z2101 Z2102))))))) - -(defun vector.<-array (V2107 V2108) (cond ((and (cons? V2108) (and (= cons (hd V2108)) (and (cons? (tl V2108)) (and (cons? (tl (tl V2108))) (and (= () (hd (tl (tl V2108)))) (= () (tl (tl (tl V2108))))))))) (cons <-vector (cons V2107 (cons (hd (tl V2108)) ())))) ((and (cons? V2108) (and (= cons (hd V2108)) (and (cons? (tl V2108)) (and (cons? (tl (tl V2108))) (= () (tl (tl (tl V2108)))))))) (vector.<-array (cons <-vector (cons V2107 (cons (hd (tl V2108)) ()))) (hd (tl (tl V2108))))) (true (simple-error (cn "cannot macro expand the dimensional argument " (shen.app V2108 " -" shen.r)))))) - -(defun vector.array-> (V2111 V2112 V2113) (cond ((and (cons? V2112) (and (= cons (hd V2112)) (and (cons? (tl V2112)) (and (cons? (tl (tl V2112))) (and (= () (hd (tl (tl V2112)))) (= () (tl (tl (tl V2112))))))))) (cons vector-> (cons V2111 (cons (hd (tl V2112)) (cons V2113 ()))))) (true (let W2114 (newv) (cons let (cons W2114 (cons V2111 (cons (vector.unfold-vector-assignment W2114 W2114 V2112 V2113) ())))))))) - -(defun vector.unfold-vector-assignment (V2124 V2125 V2126 V2127) (cond ((and (cons? V2126) (and (= cons (hd V2126)) (and (cons? (tl V2126)) (and (cons? (tl (tl V2126))) (and (= () (hd (tl (tl V2126)))) (= () (tl (tl (tl V2126))))))))) (let W2128 (newv) (cons let (cons W2128 (cons (cons vector-> (cons V2125 (cons (hd (tl V2126)) (cons V2127 ())))) (cons V2124 ())))))) ((and (cons? V2126) (and (= cons (hd V2126)) (and (cons? (tl V2126)) (and (cons? (tl (tl V2126))) (= () (tl (tl (tl V2126)))))))) (let W2129 (newv) (cons let (cons W2129 (cons (cons <-vector (cons V2125 (cons (hd (tl V2126)) ()))) (cons (vector.unfold-vector-assignment V2124 W2129 (hd (tl (tl V2126))) V2127) ())))))) (true (simple-error (cn "cannot macro expand the dimensional argument " (shen.app V2126 " -" shen.r)))))) - -(defun compress (V2168) (list->vector (vector->list V2168 ()))) - -(defun vector.copy (V2174) (let W2175 (limit V2174) (let W2176 (vector W2175) (for 1 (lambda Z2177 (<= Z2177 W2175)) (lambda Z2178 (trap-error (vector-> W2176 Z2178 (<-vector V2174 Z2178)) (lambda Z2179 (depopulate W2176 (cons Z2178 ()))))) (lambda Z2180 (+ 1 Z2180)) (lambda Z2181 (lambda Z2182 (do Z2181 Z2182))))))) - -(defun vector.reverse (V2187) (let W2188 (limit V2187) (let W2189 (vector W2188) (let W2190 (for W2188 (lambda Z2191 (> Z2191 0)) (lambda Z2192 (trap-error (vector-> W2189 Z2192 (<-vector V2187 (+ 1 (- W2188 Z2192)))) (lambda Z2193 (depopulate W2189 (cons Z2192 ()))))) (lambda Z2194 (- Z2194 1)) (lambda Z2195 (lambda Z2196 (do Z2195 Z2196)))) W2189)))) - -(defun vector.append (V2206 V2207) (let W2208 (limit V2206) (let W2209 (limit V2207) (let W2210 (+ W2208 W2209) (let W2211 (vector W2210) (let W2212 (for 1 (lambda Z2213 (<= Z2213 W2208)) (lambda Z2214 (trap-error (vector-> W2211 Z2214 (<-vector V2206 Z2214)) (lambda Z2215 (depopulate W2211 (cons Z2214 ()))))) (lambda Z2216 (+ 1 Z2216)) (lambda Z2217 (lambda Z2218 (do Z2217 Z2218)))) (let W2219 (for (+ W2208 1) (lambda Z2220 (<= Z2220 W2210)) (lambda Z2221 (trap-error (vector-> W2211 Z2221 (<-vector V2207 Z2221)) (lambda Z2222 (depopulate W2211 (cons Z2221 ()))))) (lambda Z2223 (+ 1 Z2223)) (lambda Z2224 (lambda Z2225 (do Z2224 Z2225)))) W2211))))))) - -(defun vector.dfilter (V2231 V2232) (let W2233 (limit V2232) (let W2234 (for 1 (lambda Z2235 (<= Z2235 W2233)) (lambda Z2236 (if (and (populated? V2232 (cons Z2236 ())) (V2231 (<-vector V2232 Z2236))) (vector-> V2232 Z2236 (<-vector V2232 Z2236)) (depopulate V2232 (cons Z2236 ())))) (lambda Z2237 (+ 1 Z2237)) (lambda Z2238 (lambda Z2239 (do Z2238 Z2239)))) V2232))) - -(defun vector.element? (V2243 V2244) (let W2245 (limit V2244) (let W2246 (maths.lazyfor-or 1 (lambda Z2247 (<= Z2247 W2245)) (lambda Z2248 (if (populated? V2244 (cons Z2248 ())) (= V2243 (<-vector V2244 Z2248)) false)) (lambda Z2249 (+ 1 Z2249))) W2246))) - -(defun vector.map (V2256 V2257) (let W2258 (limit V2257) (let W2259 (vector W2258) (let W2260 (for 1 (lambda Z2261 (<= Z2261 W2258)) (lambda Z2262 (if (populated? V2257 (cons Z2262 ())) (vector-> W2259 Z2262 (V2256 (<-vector V2257 Z2262))) (trap-error (vector-> W2259 Z2262 (<-vector W2259 Z2262)) (lambda Z2263 (depopulate W2259 (cons Z2262 ())))))) (lambda Z2264 (+ 1 Z2264)) (lambda Z2265 (lambda Z2266 (do Z2265 Z2266)))) W2259)))) - -(defun vector.dmap (V2273 V2274) (let W2275 (limit V2274) (let W2276 (for 1 (lambda Z2277 (<= Z2277 W2275)) (lambda Z2278 (if (populated? V2274 (cons Z2278 ())) (vector-> V2274 Z2278 (V2273 (<-vector V2274 Z2278))) (trap-error (vector-> V2274 Z2278 (<-vector V2274 Z2278)) (lambda Z2279 (depopulate V2274 (cons Z2278 ())))))) (lambda Z2280 (+ 1 Z2280)) (lambda Z2281 (lambda Z2282 (do Z2281 Z2282)))) V2274))) - -(defun vector.every? (V2286 V2287) (let W2288 (limit V2287) (let W2289 (maths.lazyfor-and 1 (lambda Z2290 (<= Z2290 W2288)) (lambda Z2291 (if (populated? V2287 (cons Z2291 ())) (V2286 (<-vector V2287 Z2291)) true)) (lambda Z2292 (+ 1 Z2292))) W2289))) - -(defun vector.some? (V2296 V2297) (let W2298 (limit V2297) (let W2299 (maths.lazyfor-or 1 (lambda Z2300 (<= Z2300 W2298)) (lambda Z2301 (if (populated? V2297 (cons Z2301 ())) (V2296 (<-vector V2297 Z2301)) false)) (lambda Z2302 (+ 1 Z2302))) W2299))) - -(defun vector->list (V2308 V2309) (for 1 (lambda Z2310 (<= Z2310 (limit V2308))) (lambda Z2311 (if (populated? V2308 (cons Z2311 ())) (cons (<-vector V2308 Z2311) ()) V2309)) (lambda Z2312 (+ 1 Z2312)) (lambda Z2313 (lambda Z2314 (append Z2313 Z2314))))) - -(defun list->vector (V2317) (vector.list->vector-h V2317 1 (vector (length V2317)))) - -(defun vector.list->vector-h (V2321 V2322 V2323) (cond ((= () V2321) V2323) ((cons? V2321) (vector.list->vector-h (tl V2321) (+ V2322 1) (vector-> V2323 V2322 (hd V2321)))) (true (shen.f-error vector.list->vector-h)))) - -(defun vacant? (V2328) (maths.lazyfor-and 1 (lambda Z2329 (<= Z2329 (limit V2328))) (lambda Z2330 (not (populated? V2328 (cons Z2330 ())))) (lambda Z2331 (+ 1 Z2331)))) - -(defun dense? (V2334) (maths.lazyfor-and 1 (lambda Z2335 (<= Z2335 (limit V2334))) (lambda Z2336 (populated? V2334 (cons Z2336 ()))) (lambda Z2337 (+ 1 Z2337)))) - -(defun porous? (V2340) (maths.lazyfor-or 1 (lambda Z2341 (<= Z2341 (limit V2340))) (lambda Z2342 (not (populated? V2340 (cons Z2342 ())))) (lambda Z2343 (+ 1 Z2343)))) - -(defun sparse? (V2348) (let W2349 (limit V2348) (let W2350 (for 1 (lambda Z2351 (<= Z2351 (limit V2348))) (lambda Z2352 (if (populated? V2348 (cons Z2352 ())) 1 0)) (lambda Z2353 (+ 1 Z2353)) (lambda Z2354 (lambda Z2355 (+ Z2354 Z2355)))) (let W2356 (- W2349 W2350) (> W2356 W2350))))) - -(defun v-op1 (V2358 V2359 V2360) (list->vector (V2358 (vector->list V2359 V2360)))) - -(defun v-op2 (V2364 V2365 V2366 V2367) (list->vector ((V2364 (vector->list V2365 V2367)) (vector->list V2366 V2367)))) - -(defun print.pprint-macro (V2453) (cond ((and (cons? V2453) (and (= pprint (hd V2453)) (and (cons? (tl V2453)) (= () (tl (tl V2453)))))) (cons pprint (cons (hd (tl V2453)) (cons (cons stoutput ()) ())))) ((and (cons? V2453) (and (= pps (hd V2453)) (and (cons? (tl V2453)) (= () (tl (tl V2453)))))) (cons pps (cons (hd (tl V2453)) (cons (cons stoutput ()) ())))) (true V2453))) - -(defun linelength () (value print.*linelength*)) - -(defun indentation () (value print.*indentation*)) - -(defun set-linelength (V2455) (cond ((and (positive? V2455) (integer? V2455)) (set print.*linelength* V2455)) (true (simple-error "line length must be a positive integer -")))) - -(defun set-indentation (V2457) (cond ((and (positive? V2457) (integer? V2457)) (set print.*indentation* V2457)) (true (simple-error "indentation must be a positive integer -")))) - -(defun pps (V2459 V2460) (let W2461 (ps V2459) (let W2462 (shen.app W2461 "" shen.r) (let W2463 (pretty-string W2462) (let W2464 (pr W2463 V2460) (let W2465 (nl 1) V2459)))))) - -(defun pprint (V2468 V2469) (let W2470 (shen.app V2468 "" shen.s) (let W2471 (pretty-string W2470) (let W2472 (pr W2471 V2469) (let W2473 (nl 1) V2468))))) - -(defun pretty-string (V2476) (print.pretty-string-h V2476 0 0)) - -(defun print.pretty-string-h (V2482 V2483 V2484) (cond ((= "" V2482) "") ((and (shen.+string? V2482) (= "[" (hdstr V2482))) (@s (print.indent V2483) (@s "[" (print.pretty-string-h (tlstr V2482) (+ V2483 1) 0)))) ((and (shen.+string? V2482) (= "(" (hdstr V2482))) (@s (print.indent V2483) (@s "(" (print.pretty-string-h (tlstr V2482) (+ V2483 1) 0)))) ((and (shen.+string? V2482) (= "]" (hdstr V2482))) (@s "]" (print.pretty-string-h (tlstr V2482) (- V2483 1) 0))) ((and (shen.+string? V2482) (= ")" (hdstr V2482))) (@s ")" (print.pretty-string-h (tlstr V2482) (- V2483 1) 0))) ((and (shen.+string? V2482) (and (= " " (hdstr V2482)) (> V2484 (linelength)))) (@s (print.indent V2483) (print.pretty-string-h (tlstr V2482) V2483 0))) ((shen.+string? V2482) (@s (hdstr V2482) (print.pretty-string-h (tlstr V2482) V2483 (+ V2484 1)))) (true (shen.f-error print.pretty-string-h)))) - -(defun print.indent (V2488) (cond ((= 0 V2488) "") (true (@s " -" (print.indent-h V2488))))) - -(defun print.indent-h (V2490) (cond ((= 0 V2490) "") (true (cn (print.n-space (indentation)) (print.indent-h (- V2490 1)))))) - -(defun print.n-space (V2492) (cond ((= 0 V2492) "") (true (cn " " (print.n-space (- V2492 1)))))) - -(defun delete-file (V2495) (if (= (language) "Common Lisp") ((fn lisp.delete-file) V2495) (close (open V2495 out)))) - -(defun file.file-macro (V2523) (cond ((and (cons? V2523) (and (= errout (hd V2523)) (and (cons? (tl V2523)) (and (cons? (tl (tl V2523))) (and (cons? (tl (tl (tl V2523)))) (= () (tl (tl (tl (tl V2523)))))))))) (let W2524 (newv) (let W2525 (newv) (let W2526 (newv) (let W2527 (newv) (let W2528 (newv) (cons trap-error (cons (hd (tl V2523)) (cons (cons /. (cons W2528 (cons (cons let (cons W2524 (cons (cons error-to-string (cons W2528 ())) (cons W2525 (cons (cons trap-error (cons (cons reopen (tl (tl (tl V2523)))) (cons (cons /. (cons W2528 (cons (cons open (cons (hd (tl (tl (tl V2523)))) (cons out ()))) ()))) ()))) (cons W2526 (cons (cons pr (cons W2524 (cons W2525 ()))) (cons W2527 (cons (cons close (cons W2525 ())) (cons (hd (tl (tl V2523))) ())))))))))) ()))) ()))))))))) (true V2523))) - -(defun append-files (V2530 V2531) (let W2532 (append-files-with-open-stream V2530 V2531) (let W2533 (close W2532) V2531))) - -(defun append-files-with-open-stream (V2536 V2537) (cond ((element? V2537 V2536) (simple-error (cn "cannot read and write to " (shen.app V2537 " at the same time -" shen.a)))) (true (let W2538 (open V2537 out) (let W2539 (mapc (lambda Z2540 (file.read&write (open Z2540 in) W2538)) V2536) W2538))))) - -(defun file.read&write (V2543 V2544) (file.read&write-h (read-byte V2543) V2543 V2544)) - -(defun file.read&write-h (V2547 V2548 V2549) (cond ((= -1 V2547) -1) (true (file.read&write-h (read-byte V2548) V2548 (do (write-byte V2547 V2549) V2549))))) - -(defun reopen (V2553) (let W2554 (read-file-as-bytelist V2553) (let W2555 (open V2553 out) (let W2556 (mapc (lambda Z2557 (write-byte Z2557 W2555)) W2554) W2555)))) - -(defun copy-file (V2559 V2560) (append-files (cons V2559 ()) V2560)) - -(defun copy-file-with-open-stream (V2563 V2564) (append-files-with-open-stream (cons V2563 ()) V2564)) - -(defun file-exists? (V2567) (trap-error (do (close (open V2567 in)) true) (lambda Z2568 false))) - -(defun file-size (V2570) (let W2571 (open V2570 in) (let W2572 (file.file-size-loop W2571 0 (read-byte W2571)) (let W2573 (close W2571) W2572)))) - -(defun file.file-size-loop (V2579 V2580 V2581) (cond ((= -1 V2581) V2580) (true (file.file-size-loop V2579 (+ 1 V2580) (read-byte V2579))))) - -(defun ascii (V2585 V2586 V2587) (let W2588 (read-file-as-bytelist V2587) (file.scan-bytes V2585 V2586 W2588 ""))) - -(defun file.scan-bytes (V2594 V2595 V2596 V2597) (cond ((= () V2596) V2597) ((and (cons? V2596) (and (>= (hd V2596) V2594) (<= (hd V2596) V2595))) (file.scan-bytes V2594 V2595 (tl V2596) (cn V2597 (n->string (hd V2596))))) ((cons? V2596) (simple-error (cn "character has code " (shen.app (hd V2596) (cn ": parsed to here - -" (shen.app V2597 "" shen.a)) shen.a)))) (true (shen.f-error file.scan-bytes)))) - -(defun pairoff (V2616 V2617) (cond ((= () V2616) ()) ((= () V2617) ()) ((and (cons? V2616) (cons? V2617)) (cons (@p (hd V2616) (hd V2617)) (pairoff (tl V2616) (tl V2617)))) (true (shen.f-error pairoff)))) - -(defun assocp (V2627 V2628) (cond ((= () V2628) (simple-error "pair not found -")) ((and (cons? V2628) (and (tuple? (hd V2628)) (= V2627 (fst (hd V2628))))) (hd V2628)) ((cons? V2628) (assocp V2627 (tl V2628))) (true (shen.f-error assocp)))) - -(defun cartprodp (V2633 V2634) (cond ((= () V2633) ()) ((cons? V2633) (append (map (lambda Z2635 (@p (hd V2633) Z2635)) V2634) (cartprodp (tl V2633) V2634))) (true (shen.f-error cartprodp)))) - -(defun assocp-if (V2643 V2644) (cond ((= () V2644) (simple-error "pair not found -")) ((and (cons? V2644) (and (tuple? (hd V2644)) (V2643 (fst (hd V2644))))) (hd V2644)) ((cons? V2644) (assocp-if V2643 (tl V2644))) (true (shen.f-error assocp-if)))) - -(defun assocp-if-not (V2652 V2653) (cond ((= () V2653) (simple-error "pair not found -")) ((and (cons? V2653) (and (tuple? (hd V2653)) (not (V2652 (fst (hd V2653)))))) (hd V2653)) ((cons? V2653) (assocp-if-not V2652 (tl V2653))) (true (shen.f-error assocp-if-not)))) - -(defun stlib.initialise-environment () (do (set maths.*seed* 95795) (do (set maths.*tolerance* 1e-4) (do (set print.*indentation* 1) (do (set print.*linelength* 60) (do (preclude (cons print ())) (do stlib.void (do (put symbol shen.external-symbols (cons newv (cons concat* ())) (value *property-vector*)) (do (put symbol shen.internal-symbols () (value *property-vector*)) (do (put maths shen.external-symbols (cons expt (cons =r (cons gcd (cons lcd (cons isqrt (cons sqrt (cons nthrt (cons floor (cons ceiling (cons round (cons mod (cons lcm (cons random (cons min (cons max (cons reseed (cons ~ (cons positive? (cons negative? (cons natural? (cons converge (cons series (cons odd? (cons even? (cons cos (cons sin (cons tan (cons radians (cons pi (cons e (cons tan30 (cons cos30 (cons cos45 (cons sin45 (cons sqrt2 (cons tan60 (cons sin120 (cons tan120 (cons sin135 (cons cos135 (cons cos150 (cons tan150 (cons cos210 (cons tan210 (cons sin225 (cons cos225 (cons sin240 (cons tan240 (cons sin300 (cons tan300 (cons sin315 (cons cos315 (cons cos330 (cons tan330 (cons sinh (cons cosh (cons tanh (cons sech (cons csch (cons power (cons factorial (cons prime? (cons unix (cons div (cons modf (cons product (cons summation (cons set-tolerance (cons tolerance (cons coth (cons for (cons sq (cons cube (cons newv (cons abs (cons approx (cons log (cons log2 (cons loge (cons log10 (cons g ()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (value *property-vector*)) (do (put maths shen.internal-symbols (cons maths.maths (cons maths.*tolerance* (cons maths.for-h (cons maths.n->r (cons maths.expt-h (cons maths.gcd-help (cons maths.gcd-loop (cons maths.lcd-loop (cons maths.isqrt-loop (cons maths.float->pair (cons maths.rounding-loop (cons maths.greatest (cons maths.lcm-h (cons maths.lcm? (cons maths.*seed* (cons maths.bbs (cons maths.converge-help (cons maths.compute-nthrt (cons maths.series-h (cons maths.compute-cos (cons maths.compute-sine (cons maths.sin60 (cons maths.prime-h (cons maths.sign (cons maths.log10+ (cons maths.maths-macro (cons maths.tolerance=n (cons maths.lazyfor-and (cons maths.lazyfor-or ()))))))))))))))))))))))))))))) (value *property-vector*)) (do (put rational shen.external-symbols (cons r-reduce (cons r= (cons r< (cons r> (cons r>= (cons r<= (cons r+ (cons r- (cons r* (cons r/ (cons r-expr (cons +-inverse (cons *-inverse (cons r-expt (cons r->n (cons r->pair (cons n->r (cons maths.n->r (cons r-approx (cons maths.lcd-loop (cons r-op1 (cons r-op2 (cons expt (cons =r (cons gcd (cons lcd (cons isqrt (cons sqrt (cons nthrt (cons floor (cons ceiling (cons round (cons mod (cons lcm (cons random (cons min (cons max (cons reseed (cons ~ (cons positive? (cons negative? (cons natural? (cons converge (cons series (cons odd? (cons even? (cons cos (cons sin (cons tan (cons radians (cons pi (cons e (cons tan30 (cons cos30 (cons cos45 (cons sin45 (cons sqrt2 (cons tan60 (cons sin120 (cons tan120 (cons sin135 (cons cos135 (cons cos150 (cons tan150 (cons cos210 (cons tan210 (cons sin225 (cons cos225 (cons sin240 (cons tan240 (cons sin300 (cons tan300 (cons sin315 (cons cos315 (cons cos330 (cons tan330 (cons sinh (cons cosh (cons tanh (cons sech (cons csch (cons power (cons factorial (cons prime? (cons unix (cons div (cons modf (cons product (cons summation (cons set-tolerance (cons tolerance (cons coth (cons for (cons sq (cons cube (cons newv (cons abs (cons approx (cons log (cons log2 (cons loge (cons log10 (cons g (cons r# (cons rational? (cons rational (cons numerator (cons denominator ())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (value *property-vector*)) (do (put rational shen.internal-symbols (cons rational.r-reduce-help (cons rational.approx-r-h (cons rational.print-rational ()))) (value *property-vector*)) (do (put complex shen.external-symbols (cons c+ (cons c- (cons c* (cons c/ (cons expt (cons =r (cons gcd (cons lcd (cons isqrt (cons sqrt (cons nthrt (cons floor (cons ceiling (cons round (cons mod (cons lcm (cons random (cons min (cons max (cons reseed (cons ~ (cons positive? (cons negative? (cons natural? (cons converge (cons series (cons odd? (cons even? (cons cos (cons sin (cons tan (cons radians (cons pi (cons e (cons tan30 (cons cos30 (cons cos45 (cons sin45 (cons sqrt2 (cons tan60 (cons sin120 (cons tan120 (cons sin135 (cons cos135 (cons cos150 (cons tan150 (cons cos210 (cons tan210 (cons sin225 (cons cos225 (cons sin240 (cons tan240 (cons sin300 (cons tan300 (cons sin315 (cons cos315 (cons cos330 (cons tan330 (cons sinh (cons cosh (cons tanh (cons sech (cons csch (cons power (cons factorial (cons prime? (cons unix (cons div (cons modf (cons product (cons summation (cons set-tolerance (cons tolerance (cons coth (cons for (cons sq (cons cube (cons newv (cons abs (cons approx (cons log (cons log2 (cons loge (cons log10 (cons g (cons c# (cons complex? (cons real (cons imaginary (cons complex ())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (value *property-vector*)) (do (put complex shen.internal-symbols (cons complex.print-complex ()) (value *property-vector*)) (do (put numerals shen.external-symbols (cons hex (cons octal (cons duodecimal (cons binary (cons n-op2 (cons n-op1 (cons n+ (cons n- (cons n* (cons n/ (cons expt (cons =r (cons gcd (cons lcd (cons isqrt (cons sqrt (cons nthrt (cons floor (cons ceiling (cons round (cons mod (cons lcm (cons random (cons min (cons max (cons reseed (cons ~ (cons positive? (cons negative? (cons natural? (cons converge (cons series (cons odd? (cons even? (cons cos (cons sin (cons tan (cons radians (cons pi (cons e (cons tan30 (cons cos30 (cons cos45 (cons sin45 (cons sqrt2 (cons tan60 (cons sin120 (cons tan120 (cons sin135 (cons cos135 (cons cos150 (cons tan150 (cons cos210 (cons tan210 (cons sin225 (cons cos225 (cons sin240 (cons tan240 (cons sin300 (cons tan300 (cons sin315 (cons cos315 (cons cos330 (cons tan330 (cons sinh (cons cosh (cons tanh (cons sech (cons csch (cons power (cons factorial (cons prime? (cons unix (cons div (cons modf (cons product (cons summation (cons set-tolerance (cons tolerance (cons coth (cons for (cons sq (cons cube (cons newv (cons abs (cons approx (cons log (cons log2 (cons loge (cons log10 (cons g (cons numeral? (cons numeral (cons radix (cons n#->ns (cons n# (cons n#->n ()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (value *property-vector*)) (do (put numerals shen.internal-symbols (cons numerals.numeral-macro (cons numerals.largest-expt (cons numerals.n-zeros (cons numerals.add (cons numerals.add-h (cons numerals.n->numeral (cons numerals.numerals (cons numerals.numeric->string (cons numerals.print-numeral ()))))))))) (value *property-vector*)) (do (put list shen.external-symbols (cons prefix? (cons suffix? (cons subset? (cons set=? (cons set? (cons permute (cons nthhd (cons cartprod (cons powerset (cons subbag? (cons bag=? (cons n-times (cons trim-right (cons trim-left (cons trim (cons trim-right-if (cons trim-left-if (cons trim-if (cons assoc-if (cons assoc-if-not (cons infix? (cons count-if (cons count (cons remove-duplicates (cons foldr (cons foldl (cons find (cons mapf (cons remove-if (cons some? (cons every? (cons mapc (cons filter (cons transitive-closure (cons x->ascii (cons take (cons take-last (cons drop (cons drop-last (cons index (cons index-last (cons insert (cons splice (cons sort (cons partition ()))))))))))))))))))))))))))))))))))))))))))))) (value *property-vector*)) (do (put list shen.internal-symbols (cons list.index-h (cons list.n-times-h (cons list.reduce (cons list.transitive-pass (cons list.find-trans ()))))) (value *property-vector*)) (do (put string shen.external-symbols (cons render-file (cons render (cons s-op1 (cons s-op2 (cons string.reverse (cons string.element? (cons string.infix? (cons string.suffix? (cons string.prefix? (cons string.length (cons string.difference (cons string.intersection (cons string.nth (cons whitespace? (cons lowercase? (cons uppercase? (cons digit? (cons alpha? (cons alphanum? (cons string.subset? (cons string.set=? (cons string.set? (cons string.nth (cons string.trim (cons string.trim-right (cons string.trim-left (cons tokenise (cons list->string (cons string->list (cons string.trim-left-if (cons string.trim-right-if (cons string.trim-if (cons uppercase (cons lowercase (cons string.map (cons file-extension (cons strip-extension (cons string.count (cons spell-number (cons string>? (cons string=? (cons string<=? (cons string.some? (cons string.every? (cons prefix? (cons suffix? (cons subset? (cons set=? (cons set? (cons permute (cons nthhd (cons cartprod (cons powerset (cons subbag? (cons bag=? (cons n-times (cons trim-right (cons trim-left (cons trim (cons trim-right-if (cons trim-left-if (cons trim-if (cons assoc-if (cons assoc-if-not (cons infix? (cons count-if (cons count (cons remove-duplicates (cons foldr (cons foldl (cons find (cons mapf (cons remove-if (cons some? (cons every? (cons mapc (cons filter (cons transitive-closure (cons x->ascii (cons take (cons take-last (cons drop (cons drop-last (cons index (cons index-last (cons insert (cons splice (cons sort (cons partition ())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (value *property-vector*)) (do (put string shen.internal-symbols (cons string.bytes->strings (cons string.rendered? (cons string. (cons string.recapply (cons string. (cons string. (cons string. (cons string. (cons string. (cons string.skip (cons string. (cons string. (cons string.s->l-h (cons string.tokenise-h (cons string.triples (cons string.triples-h (cons string.digits (cons string.tens (cons string.digit (cons string.scale (cons string.units ()))))))))))))))))))))) (value *property-vector*)) (do (put vector shen.external-symbols (cons expt (cons =r (cons gcd (cons lcd (cons isqrt (cons sqrt (cons nthrt (cons floor (cons ceiling (cons round (cons mod (cons lcm (cons random (cons min (cons max (cons reseed (cons ~ (cons positive? (cons negative? (cons natural? (cons converge (cons series (cons odd? (cons even? (cons cos (cons sin (cons tan (cons radians (cons pi (cons e (cons tan30 (cons cos30 (cons cos45 (cons sin45 (cons sqrt2 (cons tan60 (cons sin120 (cons tan120 (cons sin135 (cons cos135 (cons cos150 (cons tan150 (cons cos210 (cons tan210 (cons sin225 (cons cos225 (cons sin240 (cons tan240 (cons sin300 (cons tan300 (cons sin315 (cons cos315 (cons cos330 (cons tan330 (cons sinh (cons cosh (cons tanh (cons sech (cons csch (cons power (cons factorial (cons prime? (cons unix (cons div (cons modf (cons product (cons summation (cons set-tolerance (cons tolerance (cons coth (cons sq (cons cube (cons abs (cons approx (cons log (cons log2 (cons loge (cons log10 (cons g (cons list->vector (cons dense? (cons porous? (cons vector.reverse (cons vector.append (cons vector.dfilter (cons vector.element? (cons sparse? (cons vacant? (cons vector.some? (cons vector.map (cons vector.dmap (cons vector.every? (cons maths.lazyfor-and (cons maths.lazyfor-or (cons compress (cons newv (cons for (cons overwrite (cons insert (cons ignore (cons depopulate (cons populate (cons populated? (cons vector->list (cons v-op1 (cons v-op2 (cons array ()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (value *property-vector*)) (do (put vector shen.internal-symbols (cons vector.copy (cons vector.list->vector-h (cons vector.vector-macros (cons vector.key (cons vector.build-array (cons vector.unfold-populate (cons vector.<-array (cons vector.array-> (cons vector.unfold-vector-assignment ()))))))))) (value *property-vector*)) (do (put print shen.external-symbols (cons expt (cons =r (cons gcd (cons lcd (cons isqrt (cons sqrt (cons nthrt (cons floor (cons ceiling (cons round (cons mod (cons lcm (cons random (cons min (cons max (cons reseed (cons ~ (cons positive? (cons negative? (cons natural? (cons converge (cons series (cons odd? (cons even? (cons cos (cons sin (cons tan (cons radians (cons pi (cons e (cons tan30 (cons cos30 (cons cos45 (cons sin45 (cons sqrt2 (cons tan60 (cons sin120 (cons tan120 (cons sin135 (cons cos135 (cons cos150 (cons tan150 (cons cos210 (cons tan210 (cons sin225 (cons cos225 (cons sin240 (cons tan240 (cons sin300 (cons tan300 (cons sin315 (cons cos315 (cons cos330 (cons tan330 (cons sinh (cons cosh (cons tanh (cons sech (cons csch (cons power (cons factorial (cons prime? (cons unix (cons div (cons modf (cons product (cons summation (cons set-tolerance (cons tolerance (cons coth (cons for (cons sq (cons cube (cons newv (cons abs (cons approx (cons log (cons log2 (cons loge (cons log10 (cons g (cons pps (cons pprint (cons pretty-string (cons linelength (cons indentation (cons set-linelength (cons set-indentation ())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (value *property-vector*)) (do (put print shen.internal-symbols (cons print.pprint-macro (cons print.*linelength* (cons print.*indentation* (cons print.pretty-string-h (cons print.indent (cons print.indent-h (cons print.n-space ()))))))) (value *property-vector*)) (do (put file shen.external-symbols (cons append-files (cons append-files-with-open-stream (cons mapc (cons copy-file (cons file-size (cons reopen (cons errout (cons copy-file-with-open-stream (cons file-exists? (cons newv (cons ascii ()))))))))))) (value *property-vector*)) (do (put file shen.internal-symbols (cons file.file-macro (cons file.read&write (cons file.read&write-h (cons file.file-size-loop (cons file.scan-bytes ()))))) (value *property-vector*)) (do (put tuple shen.external-symbols (cons pairoff (cons assocp (cons cartprodp (cons assocp-if (cons assocp-if-not ()))))) (value *property-vector*)) (do (put tuple shen.internal-symbols () (value *property-vector*)) (do (put stlib shen.external-symbols (cons prefix? (cons suffix? (cons subset? (cons set=? (cons set? (cons permute (cons nthhd (cons cartprod (cons powerset (cons subbag? (cons bag=? (cons n-times (cons trim-right (cons trim-left (cons trim (cons trim-right-if (cons trim-left-if (cons trim-if (cons assoc-if (cons assoc-if-not (cons infix? (cons count-if (cons count (cons remove-duplicates (cons foldr (cons foldl (cons find (cons mapf (cons remove-if (cons some? (cons every? (cons mapc (cons filter (cons transitive-closure (cons x->ascii (cons take (cons take-last (cons drop (cons drop-last (cons index (cons index-last (cons insert (cons splice (cons sort (cons partition (cons render-file (cons render (cons s-op1 (cons s-op2 (cons string.reverse (cons string.element? (cons string.infix? (cons string.suffix? (cons string.prefix? (cons string.length (cons string.difference (cons string.intersection (cons string.nth (cons whitespace? (cons lowercase? (cons uppercase? (cons digit? (cons alpha? (cons alphanum? (cons string.subset? (cons string.set=? (cons string.set? (cons string.nth (cons string.trim (cons string.trim-right (cons string.trim-left (cons tokenise (cons list->string (cons string->list (cons string.trim-left-if (cons string.trim-right-if (cons string.trim-if (cons uppercase (cons lowercase (cons string.map (cons file-extension (cons strip-extension (cons string.count (cons spell-number (cons string>? (cons string=? (cons string<=? (cons string.some? (cons string.every? (cons prefix? (cons suffix? (cons subset? (cons set=? (cons set? (cons permute (cons nthhd (cons cartprod (cons powerset (cons subbag? (cons bag=? (cons n-times (cons trim-right (cons trim-left (cons trim (cons trim-right-if (cons trim-left-if (cons trim-if (cons assoc-if (cons assoc-if-not (cons infix? (cons count-if (cons count (cons remove-duplicates (cons foldr (cons foldl (cons find (cons mapf (cons remove-if (cons some? (cons every? (cons mapc (cons filter (cons transitive-closure (cons x->ascii (cons take (cons take-last (cons drop (cons drop-last (cons index (cons index-last (cons insert (cons splice (cons sort (cons partition (cons expt (cons =r (cons gcd (cons lcd (cons isqrt (cons sqrt (cons nthrt (cons floor (cons ceiling (cons round (cons mod (cons lcm (cons random (cons min (cons max (cons reseed (cons ~ (cons positive? (cons negative? (cons natural? (cons converge (cons series (cons odd? (cons even? (cons cos (cons sin (cons tan (cons radians (cons pi (cons e (cons tan30 (cons cos30 (cons cos45 (cons sin45 (cons sqrt2 (cons tan60 (cons sin120 (cons tan120 (cons sin135 (cons cos135 (cons cos150 (cons tan150 (cons cos210 (cons tan210 (cons sin225 (cons cos225 (cons sin240 (cons tan240 (cons sin300 (cons tan300 (cons sin315 (cons cos315 (cons cos330 (cons tan330 (cons sinh (cons cosh (cons tanh (cons sech (cons csch (cons power (cons factorial (cons prime? (cons unix (cons div (cons modf (cons product (cons summation (cons set-tolerance (cons tolerance (cons coth (cons for (cons sq (cons cube (cons newv (cons abs (cons approx (cons log (cons log2 (cons loge (cons log10 (cons g (cons expt (cons =r (cons gcd (cons lcd (cons isqrt (cons sqrt (cons nthrt (cons floor (cons ceiling (cons round (cons mod (cons lcm (cons random (cons min (cons max (cons reseed (cons ~ (cons positive? (cons negative? (cons natural? (cons converge (cons series (cons odd? (cons even? (cons cos (cons sin (cons tan (cons radians (cons pi (cons e (cons tan30 (cons cos30 (cons cos45 (cons sin45 (cons sqrt2 (cons tan60 (cons sin120 (cons tan120 (cons sin135 (cons cos135 (cons cos150 (cons tan150 (cons cos210 (cons tan210 (cons sin225 (cons cos225 (cons sin240 (cons tan240 (cons sin300 (cons tan300 (cons sin315 (cons cos315 (cons cos330 (cons tan330 (cons sinh (cons cosh (cons tanh (cons sech (cons csch (cons power (cons factorial (cons prime? (cons unix (cons div (cons modf (cons product (cons summation (cons set-tolerance (cons tolerance (cons coth (cons sq (cons cube (cons abs (cons approx (cons log (cons log2 (cons loge (cons log10 (cons g (cons list->vector (cons dense? (cons porous? (cons vector.reverse (cons vector.append (cons vector.dfilter (cons vector.element? (cons sparse? (cons vacant? (cons vector.some? (cons vector.map (cons vector.dmap (cons vector.every? (cons maths.lazyfor-and (cons maths.lazyfor-or (cons compress (cons newv (cons for (cons overwrite (cons insert (cons ignore (cons depopulate (cons populate (cons populated? (cons vector->list (cons v-op1 (cons v-op2 (cons array (cons newv (cons concat* (cons pairoff (cons assocp (cons cartprodp (cons assocp-if (cons assocp-if-not (cons append-files (cons append-files-with-open-stream (cons mapc (cons copy-file (cons file-size (cons reopen (cons errout (cons copy-file-with-open-stream (cons file-exists? (cons newv (cons ascii (cons expt (cons =r (cons gcd (cons lcd (cons isqrt (cons sqrt (cons nthrt (cons floor (cons ceiling (cons round (cons mod (cons lcm (cons random (cons min (cons max (cons reseed (cons ~ (cons positive? (cons negative? (cons natural? (cons converge (cons series (cons odd? (cons even? (cons cos (cons sin (cons tan (cons radians (cons pi (cons e (cons tan30 (cons cos30 (cons cos45 (cons sin45 (cons sqrt2 (cons tan60 (cons sin120 (cons tan120 (cons sin135 (cons cos135 (cons cos150 (cons tan150 (cons cos210 (cons tan210 (cons sin225 (cons cos225 (cons sin240 (cons tan240 (cons sin300 (cons tan300 (cons sin315 (cons cos315 (cons cos330 (cons tan330 (cons sinh (cons cosh (cons tanh (cons sech (cons csch (cons power (cons factorial (cons prime? (cons unix (cons div (cons modf (cons product (cons summation (cons set-tolerance (cons tolerance (cons coth (cons for (cons sq (cons cube (cons newv (cons abs (cons approx (cons log (cons log2 (cons loge (cons log10 (cons g (cons pps (cons pprint (cons pretty-string (cons linelength (cons indentation (cons set-linelength (cons set-indentation ()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (value *property-vector*)) (put stlib shen.internal-symbols (cons stlib.void ()) (value *property-vector*)))))))))))))))))))))))))))))))) - -(defun stlib.initialise-arities () (do (update-lambda-table concat* 2) (do (update-lambda-table newv 0) (do (update-lambda-table maths.maths-macro 1) (do (update-lambda-table set-tolerance 1) (do (update-lambda-table tolerance 0) (do (update-lambda-table sq 1) (do (update-lambda-table cube 1) (do (update-lambda-table for 5) (do (update-lambda-table maths.for-h 6) (do (update-lambda-table maths.lazyfor-and 4) (do (update-lambda-table maths.lazyfor-or 4) (do (update-lambda-table max 2) (do (update-lambda-table min 2) (do (update-lambda-table expt 3) (do (update-lambda-table maths.n->r 2) (do (update-lambda-table maths.expt-h 3) (do (update-lambda-table gcd 2) (do (update-lambda-table maths.gcd-help 2) (do (update-lambda-table maths.gcd-loop 3) (do (update-lambda-table lcd 2) (do (update-lambda-table maths.lcd-loop 4) (do (update-lambda-table isqrt 1) (do (update-lambda-table maths.isqrt-loop 2) (do (update-lambda-table div 2) (do (update-lambda-table modf 1) (do (update-lambda-table floor 1) (do (update-lambda-table maths.rounding-loop 4) (do (update-lambda-table maths.float->pair 1) (do (update-lambda-table ceiling 1) (do (update-lambda-table round 1) (do (update-lambda-table mod 2) (do (update-lambda-table lcm 1) (do (update-lambda-table maths.greatest 1) (do (update-lambda-table maths.lcm-h 3) (do (update-lambda-table maths.lcm? 2) (do (update-lambda-table random 2) (do (update-lambda-table min 2) (do (update-lambda-table reseed 0) (do (update-lambda-table maths.bbs 1) (do (update-lambda-table ~ 1) (do (update-lambda-table positive? 1) (do (update-lambda-table negative? 1) (do (update-lambda-table natural? 1) (do (update-lambda-table converge 3) (do (update-lambda-table maths.converge-help 4) (do (update-lambda-table nthrt 3) (do (update-lambda-table sqrt 2) (do (update-lambda-table maths.compute-nthrt 4) (do (update-lambda-table approx 1) (do (update-lambda-table abs 1) (do (update-lambda-table series 4) (do (update-lambda-table maths.series-h 5) (do (update-lambda-table product 3) (do (update-lambda-table summation 3) (do (update-lambda-table odd? 1) (do (update-lambda-table even? 1) (do (update-lambda-table maths.compute-sine 2) (do (update-lambda-table maths.compute-cos 2) (do (update-lambda-table cos 2) (do (update-lambda-table sin 2) (do (update-lambda-table tan 2) (do (update-lambda-table radians 1) (do (update-lambda-table g 0) (do (update-lambda-table pi 0) (do (update-lambda-table e 0) (do (update-lambda-table tan30 0) (do (update-lambda-table cos30 0) (do (update-lambda-table cos45 0) (do (update-lambda-table sin45 0) (do (update-lambda-table sqrt2 0) (do (update-lambda-table tan60 0) (do (update-lambda-table maths.sin60 0) (do (update-lambda-table sin120 0) (do (update-lambda-table tan120 0) (do (update-lambda-table sin135 0) (do (update-lambda-table cos135 0) (do (update-lambda-table cos150 0) (do (update-lambda-table tan150 0) (do (update-lambda-table cos210 0) (do (update-lambda-table tan210 0) (do (update-lambda-table sin225 0) (do (update-lambda-table cos225 0) (do (update-lambda-table sin240 0) (do (update-lambda-table tan240 0) (do (update-lambda-table sin300 0) (do (update-lambda-table tan300 0) (do (update-lambda-table sin315 0) (do (update-lambda-table cos315 0) (do (update-lambda-table cos330 0) (do (update-lambda-table tan330 0) (do (update-lambda-table coth 2) (do (update-lambda-table sinh 2) (do (update-lambda-table cosh 2) (do (update-lambda-table tanh 2) (do (update-lambda-table sech 2) (do (update-lambda-table csch 2) (do (update-lambda-table power 2) (do (update-lambda-table factorial 1) (do (update-lambda-table prime? 1) (do (update-lambda-table maths.prime-h 3) (do (update-lambda-table maths.sign 1) (do (update-lambda-table log 3) (do (update-lambda-table loge 2) (do (update-lambda-table log2 2) (do (update-lambda-table log10 2) (do (update-lambda-table maths.log10+ 2) (do (update-lambda-table r# 2) (do (update-lambda-table rational.print-rational 1) (do (update-lambda-table rational? 1) (do (update-lambda-table numerator 1) (do (update-lambda-table denominator 1) (do (update-lambda-table r-op1 2) (do (update-lambda-table r-op2 3) (do (update-lambda-table r->n 1) (do (update-lambda-table r->pair 1) (do (update-lambda-table n->r 1) (do (update-lambda-table r-reduce 1) (do (update-lambda-table rational.r-reduce-help 2) (do (update-lambda-table r= 2) (do (update-lambda-table r< 2) (do (update-lambda-table r> 2) (do (update-lambda-table r>= 2) (do (update-lambda-table r<= 2) (do (update-lambda-table r+ 2) (do (update-lambda-table r- 2) (do (update-lambda-table r* 2) (do (update-lambda-table +-inverse 1) (do (update-lambda-table *-inverse 1) (do (update-lambda-table r/ 2) (do (update-lambda-table r-expt 2) (do (update-lambda-table r-approx 2) (do (update-lambda-table rational.approx-r-h 3) (do (update-lambda-table c# 2) (do (update-lambda-table complex.print-complex 1) (do (update-lambda-table complex? 1) (do (update-lambda-table real 1) (do (update-lambda-table imaginary 1) (do (update-lambda-table c+ 2) (do (update-lambda-table c- 2) (do (update-lambda-table c* 2) (do (update-lambda-table c/ 2) (do (update-lambda-table n# 2) (do (update-lambda-table radix 1) (do (update-lambda-table numerals.numerals 1) (do (update-lambda-table n#->n 1) (do (update-lambda-table n#->ns 1) (do (update-lambda-table numerals.print-numeral 1) (do (update-lambda-table numerals.numeric->string 2) (do (update-lambda-table numeral? 1) (do (update-lambda-table numerals.numeral-macro 1) (do (update-lambda-table n-op2 4) (do (update-lambda-table n-op1 3) (do (update-lambda-table n+ 3) (do (update-lambda-table n* 3) (do (update-lambda-table n- 3) (do (update-lambda-table n/ 3) (do (update-lambda-table binary 1) (do (update-lambda-table hex 1) (do (update-lambda-table octal 1) (do (update-lambda-table duodecimal 1) (do (update-lambda-table numerals.n->numeral 2) (do (update-lambda-table numerals.largest-expt 3) (do (update-lambda-table numerals.n-zeros 1) (do (update-lambda-table numerals.add 3) (do (update-lambda-table numerals.add-h 4) (do (update-lambda-table assoc-if 2) (do (update-lambda-table assoc-if-not 2) (do (update-lambda-table drop 2) (do (update-lambda-table drop-last 2) (do (update-lambda-table index 2) (do (update-lambda-table list.index-h 3) (do (update-lambda-table index-last 2) (do (update-lambda-table insert 3) (do (update-lambda-table remove-duplicates 1) (do (update-lambda-table trim-left-if 2) (do (update-lambda-table trim-right-if 2) (do (update-lambda-table trim-if 2) (do (update-lambda-table trim-left 2) (do (update-lambda-table trim-right 2) (do (update-lambda-table trim 2) (do (update-lambda-table prefix? 2) (do (update-lambda-table infix? 2) (do (update-lambda-table suffix? 2) (do (update-lambda-table subset? 2) (do (update-lambda-table set=? 2) (do (update-lambda-table set? 1) (do (update-lambda-table n-times 2) (do (update-lambda-table list.n-times-h 3) (do (update-lambda-table subbag? 2) (do (update-lambda-table bag=? 2) (do (update-lambda-table mapc 2) (do (update-lambda-table permute 1) (do (update-lambda-table count-if 2) (do (update-lambda-table count 2) (do (update-lambda-table some? 2) (do (update-lambda-table every? 2) (do (update-lambda-table sort 2) (do (update-lambda-table find 2) (do (update-lambda-table foldr 3) (do (update-lambda-table foldl 3) (do (update-lambda-table mapf 3) (do (update-lambda-table filter 2) (do (update-lambda-table remove-if 2) (do (update-lambda-table list.reduce 3) (do (update-lambda-table take 2) (do (update-lambda-table take-last 2) (do (update-lambda-table cartprod 2) (do (update-lambda-table powerset 1) (do (update-lambda-table partition 2) (do (update-lambda-table transitive-closure 1) (do (update-lambda-table list.transitive-pass 2) (do (update-lambda-table list.find-trans 3) (do (update-lambda-table x->ascii 1) (do (update-lambda-table splice 3) (do (update-lambda-table string-macros 1) (do (update-lambda-table string->list 1) (do (update-lambda-table string.s->l-h 4) (do (update-lambda-table list->string 1) (do (update-lambda-table s-op1 3) (do (update-lambda-table s-op2 4) (do (update-lambda-table string.count 2) (do (update-lambda-table string.reverse 1) (do (update-lambda-table string.element? 2) (do (update-lambda-table string.prefix? 2) (do (update-lambda-table string.infix? 2) (do (update-lambda-table string.suffix? 2) (do (update-lambda-table string.subset? 2) (do (update-lambda-table string.set=? 2) (do (update-lambda-table string.set? 1) (do (update-lambda-table file-extension 2) (do (update-lambda-table strip-extension 1) (do (update-lambda-table string.length 1) (do (update-lambda-table string.trim 2) (do (update-lambda-table string.trim-if 2) (do (update-lambda-table string.trim-right-if 2) (do (update-lambda-table string.trim-left-if 2) (do (update-lambda-table string.trim-right 2) (do (update-lambda-table string.trim-left 2) (do (update-lambda-table string.some? 2) (do (update-lambda-table string.every? 2) (do (update-lambda-table string.difference 2) (do (update-lambda-table string.intersection 2) (do (update-lambda-table string.nth 2) (do (update-lambda-table whitespace? 1) (do (update-lambda-table uppercase? 1) (do (update-lambda-table lowercase? 1) (do (update-lambda-table digit? 1) (do (update-lambda-table alpha? 1) (do (update-lambda-table alphanum? 1) (do (update-lambda-table tokenise 2) (do (update-lambda-table string.tokenise-h 3) (do (update-lambda-table uppercase 1) (do (update-lambda-table lowercase 1) (do (update-lambda-table string.map 2) (do (update-lambda-table spell-number 1) (do (update-lambda-table string.digit 1) (do (update-lambda-table string.triples 1) (do (update-lambda-table string.triples-h 2) (do (update-lambda-table string.digits 1) (do (update-lambda-table string.tens 2) (do (update-lambda-table string.scale 1) (do (update-lambda-table string.units 1) (do (update-lambda-table string>? 2) (do (update-lambda-table string=? 2) (do (update-lambda-table string<=? 2) (do (update-lambda-table render-file 2) (do (update-lambda-table string.bytes->strings 2) (do (update-lambda-table render 1) (do (update-lambda-table string.rendered? 1) (do (update-lambda-table string. 1) (do (update-lambda-table string. 1) (do (update-lambda-table string.recapply 2) (do (update-lambda-table string. 1) (do (update-lambda-table string. 1) (do (update-lambda-table string. 1) (do (update-lambda-table string. 1) (do (update-lambda-table string. 1) (do (update-lambda-table string. 1) (do (update-lambda-table vector.vector-macros 1) (do (update-lambda-table vector.key 4) (do (update-lambda-table vector.build-array 1) (do (update-lambda-table depopulate 2) (do (update-lambda-table populated? 2) (do (update-lambda-table vector.unfold-populate 2) (do (update-lambda-table populate 2) (do (update-lambda-table vector.<-array 2) (do (update-lambda-table vector.array-> 3) (do (update-lambda-table vector.unfold-vector-assignment 4) (do (update-lambda-table compress 1) (do (update-lambda-table vector.copy 1) (do (update-lambda-table vector.reverse 1) (do (update-lambda-table vector.append 2) (do (update-lambda-table vector.dfilter 2) (do (update-lambda-table vector.element? 2) (do (update-lambda-table vector.map 2) (do (update-lambda-table vector.dmap 2) (do (update-lambda-table vector.every? 2) (do (update-lambda-table vector.some? 2) (do (update-lambda-table vector->list 2) (do (update-lambda-table list->vector 1) (do (update-lambda-table vector.list->vector-h 3) (do (update-lambda-table vacant? 1) (do (update-lambda-table dense? 1) (do (update-lambda-table porous? 1) (do (update-lambda-table sparse? 1) (do (update-lambda-table v-op1 3) (do (update-lambda-table v-op2 4) (do (update-lambda-table print.pprint-macro 1) (do (update-lambda-table linelength 0) (do (update-lambda-table indentation 0) (do (update-lambda-table set-linelength 1) (do (update-lambda-table set-indentation 1) (do (update-lambda-table pps 2) (do (update-lambda-table pprint 2) (do (update-lambda-table pretty-string 1) (do (update-lambda-table print.pretty-string-h 3) (do (update-lambda-table print.indent 1) (do (update-lambda-table print.indent-h 1) (do (update-lambda-table print.n-space 1) (do (update-lambda-table delete-file 1) (do (update-lambda-table file.file-macro 1) (do (update-lambda-table append-files 2) (do (update-lambda-table append-files-with-open-stream 2) (do (update-lambda-table file.read&write 2) (do (update-lambda-table file.read&write-h 3) (do (update-lambda-table reopen 1) (do (update-lambda-table copy-file 2) (do (update-lambda-table copy-file-with-open-stream 2) (do (update-lambda-table file-exists? 1) (do (update-lambda-table file-size 1) (do (update-lambda-table file.file-size-loop 3) (do (update-lambda-table ascii 3) (do (update-lambda-table file.scan-bytes 4) (do (update-lambda-table pairoff 2) (do (update-lambda-table assocp 2) (do (update-lambda-table cartprodp 2) (do (update-lambda-table assocp-if 2) (update-lambda-table assocp-if-not 2)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) - -(defun stlib.initialise-macros () (do (shen.record-macro maths.maths-macro (lambda X (maths.maths-macro X))) (do (shen.record-macro numerals.numeral-macro (lambda X (numerals.numeral-macro X))) (do (shen.record-macro string-macros (lambda X (string-macros X))) (do (shen.record-macro vector.vector-macros (lambda X (vector.vector-macros X))) (do (shen.record-macro print.pprint-macro (lambda X (print.pprint-macro X))) (shen.record-macro file.file-macro (lambda X (file.file-macro X))))))))) - -(defun stlib.initialise-synonyms () ()) - -(defun stlib.initialise-datatypes () (do (shen.process-datatype maths.maths (cons _________________ (cons (cons value (cons maths.*seed* ())) (cons : (cons number (cons ; (cons _______________________ (cons (cons value (cons maths.*tolerance* ())) (cons : (cons number (cons ; ()))))))))))) (shen.process-datatype print (cons _______________________________ (cons (cons value (cons print.*indentation* ())) (cons : (cons number (cons ; (cons _______________________________ (cons (cons value (cons print.*linelength* ())) (cons : (cons number (cons ; ()))))))))))))) - -(defun stlib.initialise-types () (do (declare concat* (cons A (cons --> (cons (cons B (cons --> (cons symbol ()))) ())))) (do (declare newv (cons --> (cons symbol ()))) (do (declare set-tolerance (cons number (cons --> (cons number ())))) (do (declare tolerance (cons --> (cons number ()))) (do (declare sq (cons number (cons --> (cons number ())))) (do (declare cube (cons number (cons --> (cons number ())))) (do (declare for (cons number (cons --> (cons (cons (cons number (cons --> (cons boolean ()))) (cons --> (cons (cons (cons number (cons --> (cons (protect A) ()))) (cons --> (cons (cons (cons number (cons --> (cons number ()))) (cons --> (cons (cons (cons (protect A) (cons --> (cons (cons (protect A) (cons --> (cons (protect A) ()))) ()))) (cons --> (cons (protect A) ()))) ()))) ()))) ()))) ())))) (do (declare maths.for-h (cons number (cons --> (cons (cons (cons number (cons --> (cons boolean ()))) (cons --> (cons (cons (cons number (cons --> (cons (protect A) ()))) (cons --> (cons (cons (cons number (cons --> (cons number ()))) (cons --> (cons (cons (cons (protect A) (cons --> (cons (cons (protect A) (cons --> (cons (protect A) ()))) ()))) (cons --> (cons (cons (protect A) (cons --> (cons (protect A) ()))) ()))) ()))) ()))) ()))) ())))) (do (declare maths.lazyfor-and (cons number (cons --> (cons (cons (cons number (cons --> (cons boolean ()))) (cons --> (cons (cons (cons number (cons --> (cons boolean ()))) (cons --> (cons (cons (cons number (cons --> (cons number ()))) (cons --> (cons boolean ()))) ()))) ()))) ())))) (do (declare maths.lazyfor-or (cons number (cons --> (cons (cons (cons number (cons --> (cons boolean ()))) (cons --> (cons (cons (cons number (cons --> (cons boolean ()))) (cons --> (cons (cons (cons number (cons --> (cons number ()))) (cons --> (cons boolean ()))) ()))) ()))) ())))) (do (declare max (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare min (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare expt (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare maths.n->r (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons * (cons number ()))) ()))) ())))) (do (declare maths.expt-h (cons number (cons --> (cons (cons (cons number (cons * (cons number ()))) (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare gcd (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare maths.gcd-help (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare maths.gcd-loop (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare lcd (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare maths.lcd-loop (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ()))) ())))) (do (declare isqrt (cons number (cons --> (cons number ())))) (do (declare maths.isqrt-loop (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare div (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare modf (cons number (cons --> (cons (cons number (cons * (cons number ()))) ())))) (do (declare floor (cons number (cons --> (cons number ())))) (do (declare maths.rounding-loop (cons symbol (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ()))) ())))) (do (declare maths.float->pair (cons number (cons --> (cons (cons number (cons * (cons number ()))) ())))) (do (declare ceiling (cons number (cons --> (cons number ())))) (do (declare round (cons number (cons --> (cons number ())))) (do (declare mod (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare lcm (cons (cons list (cons number ())) (cons --> (cons number ())))) (do (declare maths.greatest (cons (cons list (cons number ())) (cons --> (cons number ())))) (do (declare maths.lcm-h (cons number (cons --> (cons (cons number (cons --> (cons (cons (cons list (cons number ())) (cons --> (cons number ()))) ()))) ())))) (do (declare maths.lcm? (cons number (cons --> (cons (cons (cons list (cons number ())) (cons --> (cons boolean ()))) ())))) (do (declare random (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare min (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare reseed (cons --> (cons number ()))) (do (declare maths.bbs (cons number (cons --> (cons number ())))) (do (declare ~ (cons number (cons --> (cons number ())))) (do (declare positive? (cons number (cons --> (cons boolean ())))) (do (declare negative? (cons number (cons --> (cons boolean ())))) (do (declare natural? (cons number (cons --> (cons boolean ())))) (do (declare converge (cons (protect A) (cons --> (cons (cons (cons (protect A) (cons --> (cons (protect A) ()))) (cons --> (cons (cons (cons (protect A) (cons --> (cons (cons (protect A) (cons --> (cons boolean ()))) ()))) (cons --> (cons (protect A) ()))) ()))) ())))) (do (declare maths.converge-help (cons (cons (protect A) (cons --> (cons (protect A) ()))) (cons --> (cons (cons (protect A) (cons --> (cons (cons (protect A) (cons --> (cons (cons (cons (protect A) (cons --> (cons (cons (protect A) (cons --> (cons boolean ()))) ()))) (cons --> (cons (protect A) ()))) ()))) ()))) ())))) (do (declare nthrt (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare sqrt (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare maths.compute-nthrt (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ()))) ())))) (do (declare approx (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons boolean ()))) ()))) ())))) (do (declare abs (cons number (cons --> (cons number ())))) (do (declare series (cons number (cons --> (cons (cons (cons number (cons --> (cons number ()))) (cons --> (cons (cons number (cons --> (cons (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) (cons --> (cons number ()))) ()))) ()))) ())))) (do (declare maths.series-h (cons number (cons --> (cons (cons number (cons --> (cons (cons (cons number (cons --> (cons number ()))) (cons --> (cons (cons number (cons --> (cons (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) (cons --> (cons number ()))) ()))) ()))) ()))) ())))) (do (declare product (cons number (cons --> (cons (cons (cons number (cons --> (cons number ()))) (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare summation (cons number (cons --> (cons (cons (cons number (cons --> (cons number ()))) (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare odd? (cons number (cons --> (cons boolean ())))) (do (declare even? (cons number (cons --> (cons boolean ())))) (do (declare maths.compute-sine (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare maths.compute-cos (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare cos (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare sin (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare tan (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare radians (cons number (cons --> (cons number ())))) (do (declare g (cons --> (cons number ()))) (do (declare pi (cons --> (cons number ()))) (do (declare e (cons --> (cons number ()))) (do (declare tan30 (cons --> (cons number ()))) (do (declare cos30 (cons --> (cons number ()))) (do (declare cos45 (cons --> (cons number ()))) (do (declare sin45 (cons --> (cons number ()))) (do (declare sqrt2 (cons --> (cons number ()))) (do (declare tan60 (cons --> (cons number ()))) (do (declare maths.sin60 (cons --> (cons number ()))) (do (declare sin120 (cons --> (cons number ()))) (do (declare tan120 (cons --> (cons number ()))) (do (declare sin135 (cons --> (cons number ()))) (do (declare cos135 (cons --> (cons number ()))) (do (declare cos150 (cons --> (cons number ()))) (do (declare tan150 (cons --> (cons number ()))) (do (declare cos210 (cons --> (cons number ()))) (do (declare tan210 (cons --> (cons number ()))) (do (declare sin225 (cons --> (cons number ()))) (do (declare cos225 (cons --> (cons number ()))) (do (declare sin240 (cons --> (cons number ()))) (do (declare tan240 (cons --> (cons number ()))) (do (declare sin300 (cons --> (cons number ()))) (do (declare tan300 (cons --> (cons number ()))) (do (declare sin315 (cons --> (cons number ()))) (do (declare cos315 (cons --> (cons number ()))) (do (declare cos330 (cons --> (cons number ()))) (do (declare tan330 (cons --> (cons number ()))) (do (declare coth (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare sinh (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare cosh (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare tanh (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare sech (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare csch (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare power (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare factorial (cons number (cons --> (cons number ())))) (do (declare prime? (cons number (cons --> (cons boolean ())))) (do (declare maths.prime-h (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons boolean ()))) ()))) ())))) (do (declare maths.sign (cons number (cons --> (cons number ())))) (do (declare log (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare loge (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare log2 (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare log10 (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare maths.log10+ (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ())))) (do (declare r# (cons number (cons --> (cons (cons number (cons --> (cons rational ()))) ())))) (do (declare rational? (cons A (cons --> (cons boolean ())))) (do (declare numerator (cons rational (cons --> (cons number ())))) (do (declare denominator (cons rational (cons --> (cons number ())))) (do (declare r-op1 (cons (cons number (cons --> (cons number ()))) (cons --> (cons (cons rational (cons --> (cons rational ()))) ())))) (do (declare r-op2 (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) (cons --> (cons (cons rational (cons --> (cons (cons rational (cons --> (cons rational ()))) ()))) ())))) (do (declare r->n (cons rational (cons --> (cons number ())))) (do (declare r->pair (cons rational (cons --> (cons (cons number (cons * (cons number ()))) ())))) (do (declare n->r (cons number (cons --> (cons rational ())))) (do (declare r-reduce (cons rational (cons --> (cons rational ())))) (do (declare rational.r-reduce-help (cons number (cons --> (cons (cons number (cons --> (cons rational ()))) ())))) (do (declare r= (cons rational (cons --> (cons (cons rational (cons --> (cons boolean ()))) ())))) (do (declare r< (cons rational (cons --> (cons (cons rational (cons --> (cons boolean ()))) ())))) (do (declare r> (cons rational (cons --> (cons (cons rational (cons --> (cons boolean ()))) ())))) (do (declare r>= (cons rational (cons --> (cons (cons rational (cons --> (cons boolean ()))) ())))) (do (declare r<= (cons rational (cons --> (cons (cons rational (cons --> (cons boolean ()))) ())))) (do (declare r+ (cons rational (cons --> (cons (cons rational (cons --> (cons rational ()))) ())))) (do (declare r- (cons rational (cons --> (cons (cons rational (cons --> (cons rational ()))) ())))) (do (declare r* (cons rational (cons --> (cons (cons rational (cons --> (cons rational ()))) ())))) (do (declare +-inverse (cons rational (cons --> (cons rational ())))) (do (declare *-inverse (cons rational (cons --> (cons rational ())))) (do (declare r/ (cons rational (cons --> (cons (cons rational (cons --> (cons rational ()))) ())))) (do (declare r-expt (cons rational (cons --> (cons (cons number (cons --> (cons rational ()))) ())))) (do (declare r-approx (cons rational (cons --> (cons (cons number (cons --> (cons rational ()))) ())))) (do (declare rational.approx-r-h (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons rational ()))) ()))) ())))) (do (declare c# (cons number (cons --> (cons (cons number (cons --> (cons complex ()))) ())))) (do (declare complex? (cons A (cons --> (cons boolean ())))) (do (declare real (cons complex (cons --> (cons number ())))) (do (declare imaginary (cons complex (cons --> (cons number ())))) (do (declare c+ (cons complex (cons --> (cons (cons complex (cons --> (cons complex ()))) ())))) (do (declare c- (cons complex (cons --> (cons (cons complex (cons --> (cons complex ()))) ())))) (do (declare c* (cons complex (cons --> (cons (cons complex (cons --> (cons complex ()))) ())))) (do (declare c/ (cons complex (cons --> (cons (cons complex (cons --> (cons complex ()))) ())))) (do (declare radix (cons numeral (cons --> (cons number ())))) (do (declare n#->ns (cons numeral (cons --> (cons (cons list (cons number ())) ())))) (do (declare n#->n (cons numeral (cons --> (cons number ())))) (do (declare n# (cons number (cons --> (cons (cons number (cons --> (cons numeral ()))) ())))) (do (declare numeral? (cons A (cons --> (cons boolean ())))) (do (declare n-op2 (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) (cons --> (cons (cons numeral (cons --> (cons (cons numeral (cons --> (cons (cons number (cons --> (cons numeral ()))) ()))) ()))) ())))) (do (declare n-op1 (cons (cons number (cons --> (cons number ()))) (cons --> (cons (cons numeral (cons --> (cons (cons number (cons --> (cons numeral ()))) ()))) ())))) (do (declare n+ (cons numeral (cons --> (cons (cons numeral (cons --> (cons (cons number (cons --> (cons numeral ()))) ()))) ())))) (do (declare n* (cons numeral (cons --> (cons (cons numeral (cons --> (cons (cons number (cons --> (cons numeral ()))) ()))) ())))) (do (declare n- (cons numeral (cons --> (cons (cons numeral (cons --> (cons (cons number (cons --> (cons numeral ()))) ()))) ())))) (do (declare n/ (cons numeral (cons --> (cons (cons numeral (cons --> (cons (cons number (cons --> (cons numeral ()))) ()))) ())))) (do (declare binary (cons number (cons --> (cons numeral ())))) (do (declare hex (cons number (cons --> (cons numeral ())))) (do (declare octal (cons number (cons --> (cons numeral ())))) (do (declare duodecimal (cons number (cons --> (cons numeral ())))) (do (declare numerals.n->numeral (cons number (cons --> (cons (cons number (cons --> (cons (cons list (cons number ())) ()))) ())))) (do (declare numerals.largest-expt (cons number (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare numerals.n-zeros (cons number (cons --> (cons (cons list (cons number ())) ())))) (do (declare numerals.add (cons (cons list (cons number ())) (cons --> (cons (cons (cons list (cons number ())) (cons --> (cons (cons number (cons --> (cons (cons list (cons number ())) ()))) ()))) ())))) (do (declare numerals.add-h (cons (cons list (cons number ())) (cons --> (cons (cons (cons list (cons number ())) (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons (cons list (cons number ())) ()))) ()))) ()))) ())))) (do (declare assoc-if (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (cons list (cons (protect A) ())) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare assoc-if-not (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (cons list (cons (protect A) ())) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare drop (cons number (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare drop-last (cons number (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare index (cons (protect A) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons number ()))) ())))) (do (declare list.index-h (cons (protect A) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare index-last (cons (protect A) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons number ()))) ())))) (do (declare insert (cons number (cons --> (cons (cons (protect A) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ()))) ())))) (do (declare remove-duplicates (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ())))) (do (declare trim-left-if (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare trim-right-if (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare trim-if (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare trim-left (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare trim-right (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare trim (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare prefix? (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare infix? (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare suffix? (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare subset? (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare set=? (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare set? (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ())))) (do (declare n-times (cons (protect A) (cons --> (cons (cons number (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare list.n-times-h (cons number (cons --> (cons (cons (protect A) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ()))) ())))) (do (declare subbag? (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare bag=? (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare mapc (cons (cons (protect A) (cons --> (cons (protect B) ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect C) ())) ()))) ())))) (do (declare permute (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (cons list (cons (protect A) ())) ())) ())))) (do (declare count-if (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons number ()))) ())))) (do (declare count (cons (protect A) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons number ()))) ())))) (do (declare some? (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare every? (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare sort (cons (cons (protect A) (cons --> (cons (cons (protect A) (cons --> (cons boolean ()))) ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare find (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (protect A) ()))) ())))) (do (declare foldr (cons (cons (protect A) (cons --> (cons (cons (protect B) (cons --> (cons (protect B) ()))) ()))) (cons --> (cons (cons (protect B) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (protect B) ()))) ()))) ())))) (do (declare foldl (cons (cons (protect A) (cons --> (cons (cons (protect B) (cons --> (cons (protect A) ()))) ()))) (cons --> (cons (cons (protect A) (cons --> (cons (cons (cons list (cons (protect B) ())) (cons --> (cons (protect A) ()))) ()))) ())))) (do (declare mapf (cons (cons (protect A) (cons --> (cons (protect B) ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons (protect B) (cons --> (cons (cons (cons list (cons (protect C) ())) (cons --> (cons (cons list (cons (protect C) ())) ()))) ()))) (cons --> (cons (cons list (cons (protect C) ())) ()))) ()))) ())))) (do (declare filter (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare remove-if (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare list.reduce (cons (cons (protect A) (cons --> (cons (cons (protect B) (cons --> (cons (protect A) ()))) ()))) (cons --> (cons (cons (protect A) (cons --> (cons (cons (cons list (cons (protect B) ())) (cons --> (cons (protect A) ()))) ()))) ())))) (do (declare take (cons number (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare take-last (cons number (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare cartprod (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (cons list (cons (protect A) ())) ())) ()))) ())))) (do (declare powerset (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (cons list (cons (protect A) ())) ())) ())))) (do (declare partition (cons (cons (protect A) (cons --> (cons (cons (protect A) (cons --> (cons boolean ()))) ()))) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (cons list (cons (protect A) ())) ())) ()))) ())))) (do (declare transitive-closure (cons (cons list (cons (cons (protect A) (cons * (cons (protect A) ()))) ())) (cons --> (cons (cons list (cons (cons (protect A) (cons * (cons (protect A) ()))) ())) ())))) (do (declare list.transitive-pass (cons (cons list (cons (cons (protect A) (cons * (cons (protect A) ()))) ())) (cons --> (cons (cons (cons list (cons (cons (protect A) (cons * (cons (protect A) ()))) ())) (cons --> (cons (cons list (cons (cons (protect A) (cons * (cons (protect A) ()))) ())) ()))) ())))) (do (declare list.find-trans (cons (protect A) (cons --> (cons (cons (protect A) (cons --> (cons (cons (cons list (cons (cons (protect A) (cons * (cons (protect A) ()))) ())) (cons --> (cons (cons list (cons (cons (protect A) (cons * (cons (protect A) ()))) ())) ()))) ()))) ())))) (do (declare x->ascii (cons (protect A) (cons --> (cons (cons list (cons number ())) ())))) (do (declare splice (cons number (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ()))) ())))) (do (declare string->list (cons string (cons --> (cons (cons list (cons string ())) ())))) (do (declare string.s->l-h (cons string (cons --> (cons (cons number (cons --> (cons (cons string (cons --> (cons (cons (cons list (cons string ())) (cons --> (cons (cons list (cons string ())) ()))) ()))) ()))) ())))) (do (declare list->string (cons (cons list (cons string ())) (cons --> (cons string ())))) (do (declare s-op1 (cons (cons (cons list (cons string ())) (cons --> (cons (protect A) ()))) (cons --> (cons (cons string (cons --> (cons (cons (cons (protect A) (cons --> (cons (protect B) ()))) (cons --> (cons (protect B) ()))) ()))) ())))) (do (declare s-op2 (cons (cons (cons list (cons string ())) (cons --> (cons (cons (cons list (cons string ())) (cons --> (cons (protect A) ()))) ()))) (cons --> (cons (cons string (cons --> (cons (cons string (cons --> (cons (cons (cons (protect A) (cons --> (cons (protect B) ()))) (cons --> (cons (protect B) ()))) ()))) ()))) ())))) (do (declare string.count (cons string (cons --> (cons (cons string (cons --> (cons number ()))) ())))) (do (declare string.reverse (cons string (cons --> (cons string ())))) (do (declare string.element? (cons string (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string.prefix? (cons string (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string.infix? (cons string (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string.suffix? (cons string (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string.subset? (cons string (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string.set=? (cons string (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string.set? (cons string (cons --> (cons boolean ())))) (do (declare file-extension (cons string (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare strip-extension (cons string (cons --> (cons string ())))) (do (declare string.length (cons string (cons --> (cons number ())))) (do (declare string.trim (cons (cons list (cons string ())) (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare string.trim-if (cons (cons string (cons --> (cons boolean ()))) (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare string.trim-right-if (cons (cons string (cons --> (cons boolean ()))) (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare string.trim-left-if (cons (cons string (cons --> (cons boolean ()))) (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare string.trim-right (cons (cons list (cons string ())) (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare string.trim-left (cons (cons list (cons string ())) (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare string.some? (cons (cons string (cons --> (cons boolean ()))) (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string.every? (cons (cons string (cons --> (cons boolean ()))) (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string.difference (cons string (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare string.intersection (cons string (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare string.nth (cons number (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare whitespace? (cons string (cons --> (cons boolean ())))) (do (declare uppercase? (cons string (cons --> (cons boolean ())))) (do (declare lowercase? (cons string (cons --> (cons boolean ())))) (do (declare digit? (cons string (cons --> (cons boolean ())))) (do (declare alpha? (cons string (cons --> (cons boolean ())))) (do (declare alphanum? (cons string (cons --> (cons boolean ())))) (do (declare tokenise (cons (cons string (cons --> (cons boolean ()))) (cons --> (cons (cons string (cons --> (cons (cons list (cons string ())) ()))) ())))) (do (declare string.tokenise-h (cons (cons string (cons --> (cons boolean ()))) (cons --> (cons (cons string (cons --> (cons (cons string (cons --> (cons (cons list (cons string ())) ()))) ()))) ())))) (do (declare uppercase (cons string (cons --> (cons string ())))) (do (declare lowercase (cons string (cons --> (cons string ())))) (do (declare string.map (cons (cons string (cons --> (cons string ()))) (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare spell-number (cons number (cons --> (cons string ())))) (do (declare string.digit (cons string (cons --> (cons string ())))) (do (declare string.triples (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (cons list (cons (protect A) ())) ())) ())))) (do (declare string.triples-h (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (cons list (cons (protect A) ())) ())) (cons --> (cons (cons list (cons (cons list (cons (protect A) ())) ())) ()))) ())))) (do (declare string.digits (cons (cons list (cons string ())) (cons --> (cons string ())))) (do (declare string.tens (cons string (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare string.scale (cons (cons list (cons string ())) (cons --> (cons string ())))) (do (declare string.units (cons number (cons --> (cons string ())))) (do (declare string>? (cons string (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string>=? (cons string (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare string<=? (cons string (cons --> (cons (cons string (cons --> (cons boolean ()))) ())))) (do (declare render (cons string (cons --> (cons string ())))) (do (declare render-file (cons string (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare depopulate (cons (cons vector (cons A ())) (cons --> (cons (cons (cons list (cons number ())) (cons --> (cons (cons vector (cons A ())) ()))) ())))) (do (declare populated? (cons (cons vector (cons A ())) (cons --> (cons (cons (cons list (cons number ())) (cons --> (cons boolean ()))) ())))) (do (declare populate (cons (cons number (cons --> (cons A ()))) (cons --> (cons (cons number (cons --> (cons (cons vector (cons A ())) ()))) ())))) (do (declare compress (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ())))) (do (declare vector.copy (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ())))) (do (declare vector.reverse (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ())))) (do (declare vector.append (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ()))) ())))) (do (declare vector.dfilter (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ()))) ())))) (do (declare vector.element? (cons (protect A) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare vector.map (cons (cons (protect A) (cons --> (cons (protect B) ()))) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect B) ())) ()))) ())))) (do (declare vector.dmap (cons (cons (protect A) (cons --> (cons (protect A) ()))) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ()))) ())))) (do (declare vector.every? (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare vector.some? (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons boolean ()))) ())))) (do (declare vector->list (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ())))) (do (declare list->vector (cons (cons list (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ())))) (do (declare vector.list->vector-h (cons (cons list (cons (protect A) ())) (cons --> (cons (cons number (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ()))) ()))) ())))) (do (declare vacant? (cons (cons vector (cons (protect A) ())) (cons --> (cons boolean ())))) (do (declare dense? (cons (cons vector (cons (protect A) ())) (cons --> (cons boolean ())))) (do (declare porous? (cons (cons vector (cons (protect A) ())) (cons --> (cons boolean ())))) (do (declare sparse? (cons (cons vector (cons (protect A) ())) (cons --> (cons boolean ())))) (do (declare v-op1 (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ()))) ()))) ())))) (do (declare v-op2 (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons list (cons (protect A) ())) ()))) ()))) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons (cons vector (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect A) ())) (cons --> (cons (cons vector (cons (protect A) ())) ()))) ()))) ()))) ())))) (do (declare linelength (cons --> (cons number ()))) (do (declare indentation (cons --> (cons number ()))) (do (declare set-linelength (cons number (cons --> (cons number ())))) (do (declare set-indentation (cons number (cons --> (cons number ())))) (do (declare pps (cons symbol (cons --> (cons (cons (cons stream (cons out ())) (cons --> (cons symbol ()))) ())))) (do (declare pprint (cons (protect A) (cons --> (cons (cons (cons stream (cons out ())) (cons --> (cons (protect A) ()))) ())))) (do (declare pretty-string (cons string (cons --> (cons string ())))) (do (declare print.pretty-string-h (cons string (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons string ()))) ()))) ())))) (do (declare print.indent (cons number (cons --> (cons string ())))) (do (declare print.indent-h (cons number (cons --> (cons string ())))) (do (declare print.n-space (cons number (cons --> (cons string ())))) (do (declare delete-file (cons string (cons --> (cons (cons list (cons A ())) ())))) (do (declare append-files (cons (cons list (cons string ())) (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare append-files-with-open-stream (cons (cons list (cons string ())) (cons --> (cons (cons string (cons --> (cons (cons stream (cons out ())) ()))) ())))) (do (declare file.read&write (cons (cons stream (cons in ())) (cons --> (cons (cons (cons stream (cons out ())) (cons --> (cons number ()))) ())))) (do (declare file.read&write-h (cons number (cons --> (cons (cons (cons stream (cons in ())) (cons --> (cons (cons (cons stream (cons out ())) (cons --> (cons number ()))) ()))) ())))) (do (declare reopen (cons string (cons --> (cons (cons stream (cons out ())) ())))) (do (declare copy-file (cons string (cons --> (cons (cons string (cons --> (cons string ()))) ())))) (do (declare copy-file-with-open-stream (cons string (cons --> (cons (cons string (cons --> (cons (cons stream (cons out ())) ()))) ())))) (do (declare file-exists? (cons string (cons --> (cons boolean ())))) (do (declare file-size (cons string (cons --> (cons number ())))) (do (declare file.file-size-loop (cons (cons stream (cons in ())) (cons --> (cons (cons number (cons --> (cons (cons number (cons --> (cons number ()))) ()))) ())))) (do (declare ascii (cons number (cons --> (cons (cons number (cons --> (cons (cons string (cons --> (cons string ()))) ()))) ())))) (do (declare file.scan-bytes (cons number (cons --> (cons (cons number (cons --> (cons (cons (cons list (cons number ())) (cons --> (cons (cons string (cons --> (cons string ()))) ()))) ()))) ())))) (do (declare pairoff (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect B) ())) (cons --> (cons (cons list (cons (cons (protect A) (cons * (cons (protect B) ()))) ())) ()))) ())))) (do (declare assocp (cons (protect A) (cons --> (cons (cons (cons list (cons (cons (protect A) (cons * (cons (protect B) ()))) ())) (cons --> (cons (cons (protect A) (cons * (cons (protect B) ()))) ()))) ())))) (do (declare cartprodp (cons (cons list (cons (protect A) ())) (cons --> (cons (cons (cons list (cons (protect B) ())) (cons --> (cons (cons list (cons (cons (protect A) (cons * (cons (protect B) ()))) ())) ()))) ())))) (do (declare assocp-if (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (cons (protect A) (cons * (cons (protect B) ()))) ())) (cons --> (cons (cons (protect A) (cons * (cons (protect B) ()))) ()))) ())))) (declare assocp-if-not (cons (cons (protect A) (cons --> (cons boolean ()))) (cons --> (cons (cons (cons list (cons (cons (protect A) (cons * (cons (protect B) ()))) ())) (cons --> (cons (cons (protect A) (cons * (cons (protect B) ()))) ()))) ()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) - -(defun stlib.initialise-sources () (do (shen.record-kl concat* (cons defun (cons concat* (cons (cons (protect V3) (cons (protect V4) ())) (cons (cons let (cons (protect W5) (cons (cons concat (cons (protect V3) (cons (protect V4) ()))) (cons (cons if (cons (cons symbol? (cons (protect W5) ())) (cons (protect W5) (cons (cons simple-error (cons (cons cn (cons "'" (cons (cons shen.app (cons (protect W5) (cons "' is not a symbol -" (cons shen.a ())))) ()))) ())) ())))) ())))) ()))))) (do (shen.record-kl newv (cons defun (cons newv (cons () (cons (cons gensym (cons (protect X) ())) ()))))) (do (shen.record-kl maths.maths-macro (cons defun (cons maths.maths-macro (cons (cons (protect V8) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons log10 (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons log10 (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons log2 (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons log2 (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons loge (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons loge (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons log (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons log (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons sin (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons sin (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons tan (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons tan (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons cos (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons cos (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons tanh (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons tanh (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons cosh (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons cosh (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons sinh (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons sinh (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons sech (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons sech (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons csch (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons csch (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons coth (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons coth (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons nthrt (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons nthrt (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons sqrt (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons sqrt (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons expt (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons expt (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons cons (cons (cons cons (cons tolerance (cons () ()))) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons max (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons max (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons max (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons min (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons min (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons cons (cons (cons cons (cons min (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons tolerance (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons maths.tolerance=n (cons (cons tl (cons (protect V8) ())) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons for (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons and (cons (cons = (cons = (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons = (cons and (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons let (cons (protect W9) (cons (cons lambda (cons (protect Z10) (cons (cons lambda (cons (protect Z11) (cons (cons if (cons (cons > (cons (cons occurrences (cons (protect Z10) (cons (protect Z11) ()))) (cons 0 ()))) (cons (cons cons (cons /. (cons (cons cons (cons (protect Z10) (cons (cons cons (cons (protect Z11) (cons () ()))) ()))) ()))) (cons (protect Z11) ())))) ()))) ()))) (cons (cons cons (cons maths.lazyfor-and (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons cons (cons (cons (cons (protect W9) (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons cons (cons (cons (cons (protect W9) (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons () ()))) ()))) ()))) ()))) ()))) ())))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons for (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons and (cons (cons = (cons = (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons = (cons or (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons let (cons (protect W12) (cons (cons lambda (cons (protect Z13) (cons (cons lambda (cons (protect Z14) (cons (cons if (cons (cons > (cons (cons occurrences (cons (protect Z13) (cons (protect Z14) ()))) (cons 0 ()))) (cons (cons cons (cons /. (cons (cons cons (cons (protect Z13) (cons (cons cons (cons (protect Z14) (cons () ()))) ()))) ()))) (cons (protect Z14) ())))) ()))) ()))) (cons (cons cons (cons maths.lazyfor-or (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons cons (cons (cons (cons (protect W12) (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons cons (cons (cons (cons (protect W12) (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons () ()))) ()))) ()))) ()))) ()))) ())))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons for (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons and (cons (cons = (cons = (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons let (cons (protect W15) (cons (cons lambda (cons (protect Z16) (cons (cons lambda (cons (protect Z17) (cons (cons if (cons (cons > (cons (cons occurrences (cons (protect Z16) (cons (protect Z17) ()))) (cons 0 ()))) (cons (cons cons (cons /. (cons (cons cons (cons (protect Z16) (cons (cons cons (cons (protect Z17) (cons () ()))) ()))) ()))) (cons (protect Z17) ())))) ()))) ()))) (cons (cons cons (cons for (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons cons (cons (cons (cons (protect W15) (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons cons (cons (cons (cons (protect W15) (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ())))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons for (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons and (cons (cons = (cons = (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons let (cons (protect W18) (cons (cons lambda (cons (protect Z19) (cons (cons lambda (cons (protect Z20) (cons (cons if (cons (cons > (cons (cons occurrences (cons (protect Z19) (cons (protect Z20) ()))) (cons 0 ()))) (cons (cons cons (cons /. (cons (cons cons (cons (protect Z19) (cons (cons cons (cons (protect Z20) (cons () ()))) ()))) ()))) (cons (protect Z20) ())))) ()))) ()))) (cons (cons cons (cons for (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons cons (cons (cons (cons (protect W18) (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons cons (cons (cons (cons (protect W18) (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ())) (cons (cons cons (cons (cons cons (cons fn (cons (cons cons (cons do (cons () ()))) ()))) (cons () ()))) ()))) ()))) ()))) ()))) ()))) ())))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V8) ())) (cons (cons and (cons (cons = (cons for (cons (cons hd (cons (protect V8) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V8) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons and (cons (cons = (cons = (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons let (cons (protect W21) (cons (cons lambda (cons (protect Z22) (cons (cons lambda (cons (protect Z23) (cons (cons if (cons (cons > (cons (cons occurrences (cons (protect Z22) (cons (protect Z23) ()))) (cons 0 ()))) (cons (cons cons (cons /. (cons (cons cons (cons (protect Z22) (cons (cons cons (cons (protect Z23) (cons () ()))) ()))) ()))) (cons (protect Z23) ())))) ()))) ()))) (cons (cons cons (cons for (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) (cons (cons cons (cons (cons (cons (protect W21) (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ())) (cons (cons cons (cons (cons cons (cons /. (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V8) ())) ())) (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V8) ())) ())) ())) ())) ())) ()))) ()))) (cons (cons cons (cons (cons cons (cons + (cons (cons cons (cons 1 (cons () ()))) ()))) (cons (cons cons (cons (cons cons (cons fn (cons (cons cons (cons do (cons () ()))) ()))) (cons () ()))) ()))) ()))) ()))) ()))) ()))) ())))) ())) (cons (cons true (cons (protect V8) ())) ())))))))))))))))))))))))))) ()))))) (do (shen.record-kl set-tolerance (cons defun (cons set-tolerance (cons (cons (protect V249) ()) (cons (cons set (cons maths.*tolerance* (cons (protect V249) ()))) ()))))) (do (shen.record-kl tolerance (cons defun (cons tolerance (cons () (cons (cons value (cons maths.*tolerance* ())) ()))))) (do (shen.record-kl sq (cons defun (cons sq (cons (cons (protect V251) ()) (cons (cons * (cons (protect V251) (cons (protect V251) ()))) ()))))) (do (shen.record-kl cube (cons defun (cons cube (cons (cons (protect V253) ()) (cons (cons * (cons (protect V253) (cons (cons * (cons (protect V253) (cons (protect V253) ()))) ()))) ()))))) (do (shen.record-kl for (cons defun (cons for (cons (cons (protect V255) (cons (protect V256) (cons (protect V257) (cons (protect V258) (cons (protect V259) ()))))) (cons (cons maths.for-h (cons (cons (protect V258) (cons (protect V255) ())) (cons (protect V256) (cons (protect V257) (cons (protect V258) (cons (protect V259) (cons (cons (protect V257) (cons (protect V255) ())) ()))))))) ()))))) (do (shen.record-kl maths.for-h (cons defun (cons maths.for-h (cons (cons (protect V268) (cons (protect V269) (cons (protect V270) (cons (protect V271) (cons (protect V272) (cons (protect V273) ())))))) (cons (cons cond (cons (cons (cons not (cons (cons (protect V269) (cons (protect V268) ())) ())) (cons (protect V273) ())) (cons (cons true (cons (cons maths.for-h (cons (cons (protect V271) (cons (protect V268) ())) (cons (protect V269) (cons (protect V270) (cons (protect V271) (cons (protect V272) (cons (cons (cons (protect V272) (cons (protect V273) ())) (cons (cons (protect V270) (cons (protect V268) ())) ())) ()))))))) ())) ()))) ()))))) (do (shen.record-kl maths.lazyfor-and (cons defun (cons maths.lazyfor-and (cons (cons (protect V290) (cons (protect V291) (cons (protect V292) (cons (protect V293) ())))) (cons (cons cond (cons (cons (cons not (cons (cons (protect V291) (cons (protect V290) ())) ())) (cons true ())) (cons (cons (cons (protect V292) (cons (protect V290) ())) (cons (cons maths.lazyfor-and (cons (cons (protect V293) (cons (protect V290) ())) (cons (protect V291) (cons (protect V292) (cons (protect V293) ()))))) ())) (cons (cons true (cons false ())) ())))) ()))))) (do (shen.record-kl maths.lazyfor-or (cons defun (cons maths.lazyfor-or (cons (cons (protect V300) (cons (protect V301) (cons (protect V302) (cons (protect V303) ())))) (cons (cons cond (cons (cons (cons not (cons (cons (protect V301) (cons (protect V300) ())) ())) (cons false ())) (cons (cons (cons (protect V302) (cons (protect V300) ())) (cons true ())) (cons (cons true (cons (cons maths.lazyfor-or (cons (cons (protect V303) (cons (protect V300) ())) (cons (protect V301) (cons (protect V302) (cons (protect V303) ()))))) ())) ())))) ()))))) (do (shen.record-kl max (cons defun (cons max (cons (cons (protect V310) (cons (protect V311) ())) (cons (cons cond (cons (cons (cons > (cons (protect V311) (cons (protect V310) ()))) (cons (protect V311) ())) (cons (cons true (cons (protect V310) ())) ()))) ()))))) (do (shen.record-kl min (cons defun (cons min (cons (cons (protect V316) (cons (protect V317) ())) (cons (cons cond (cons (cons (cons < (cons (protect V317) (cons (protect V316) ()))) (cons (protect V317) ())) (cons (cons true (cons (protect V316) ())) ()))) ()))))) (do (shen.record-kl expt (cons defun (cons expt (cons (cons (protect V320) (cons (protect V321) (cons (protect V322) ()))) (cons (cons if (cons (cons = (cons (protect V321) (cons 0 ()))) (cons 1 (cons (cons if (cons (cons positive? (cons (protect V321) ())) (cons (cons maths.expt-h (cons (protect V320) (cons (cons maths.n->r (cons (protect V321) (cons 1 ()))) (cons (protect V322) ())))) (cons (cons / (cons 1 (cons (cons maths.expt-h (cons (protect V320) (cons (cons maths.n->r (cons (cons ~ (cons (protect V321) ())) (cons 1 ()))) (cons (protect V322) ())))) ()))) ())))) ())))) ()))))) (do (shen.record-kl maths.n->r (cons defun (cons maths.n->r (cons (cons (protect V326) (cons (protect V327) ())) (cons (cons cond (cons (cons (cons integer? (cons (protect V326) ())) (cons (cons @p (cons (protect V326) (cons (protect V327) ()))) ())) (cons (cons true (cons (cons maths.n->r (cons (cons * (cons (protect V326) (cons 10 ()))) (cons (cons * (cons (protect V327) (cons 10 ()))) ()))) ())) ()))) ()))))) (do (shen.record-kl maths.expt-h (cons defun (cons maths.expt-h (cons (cons (protect V330) (cons (protect V331) (cons (protect V332) ()))) (cons (cons cond (cons (cons (cons tuple? (cons (protect V331) ())) (cons (cons power (cons (cons nthrt (cons (protect V330) (cons (cons snd (cons (protect V331) ())) (cons (protect V332) ())))) (cons (cons fst (cons (protect V331) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons maths.expt-h ())) ())) ()))) ()))))) (do (shen.record-kl gcd (cons defun (cons gcd (cons (cons (protect V336) (cons (protect V337) ())) (cons (cons if (cons (cons and (cons (cons integer? (cons (protect V336) ())) (cons (cons integer? (cons (protect V337) ())) ()))) (cons (cons let (cons (protect W338) (cons (cons abs (cons (protect V336) ())) (cons (cons let (cons (protect W339) (cons (cons abs (cons (protect V337) ())) (cons (cons if (cons (cons > (cons (protect W338) (cons (protect W339) ()))) (cons (cons maths.gcd-help (cons (cons - (cons (protect W338) (cons (protect W339) ()))) (cons (protect W339) ()))) (cons (cons maths.gcd-help (cons (protect W338) (cons (cons - (cons (protect W339) (cons (protect W338) ()))) ()))) ())))) ())))) ())))) (cons (cons simple-error (cons "gcd expects integer inputs" ())) ())))) ()))))) (do (shen.record-kl maths.gcd-help (cons defun (cons maths.gcd-help (cons (cons (protect V342) (cons (protect V343) ())) (cons (cons if (cons (cons > (cons (protect V342) (cons (protect V343) ()))) (cons (cons maths.gcd-loop (cons (protect V342) (cons (protect V343) (cons (protect V343) ())))) (cons (cons maths.gcd-loop (cons (protect V342) (cons (protect V343) (cons (protect V342) ())))) ())))) ()))))) (do (shen.record-kl maths.gcd-loop (cons defun (cons maths.gcd-loop (cons (cons (protect V350) (cons (protect V351) (cons (protect V352) ()))) (cons (cons cond (cons (cons (cons = (cons 1 (cons (protect V352) ()))) (cons 1 ())) (cons (cons (cons and (cons (cons integer? (cons (cons / (cons (protect V350) (cons (protect V352) ()))) ())) (cons (cons integer? (cons (cons / (cons (protect V351) (cons (protect V352) ()))) ())) ()))) (cons (protect V352) ())) (cons (cons true (cons (cons maths.gcd-loop (cons (protect V350) (cons (protect V351) (cons (cons - (cons (protect V352) (cons 1 ()))) ())))) ())) ())))) ()))))) (do (shen.record-kl lcd (cons defun (cons lcd (cons (cons (protect V356) (cons (protect V357) ())) (cons (cons cond (cons (cons (cons and (cons (cons even? (cons (protect V356) ())) (cons (cons even? (cons (protect V357) ())) ()))) (cons 2 ())) (cons (cons true (cons (cons maths.lcd-loop (cons (protect V356) (cons (protect V357) (cons (cons if (cons (cons > (cons (protect V356) (cons (protect V357) ()))) (cons (protect V357) (cons (protect V356) ())))) (cons 3 ()))))) ())) ()))) ()))))) (do (shen.record-kl maths.lcd-loop (cons defun (cons maths.lcd-loop (cons (cons (protect V363) (cons (protect V364) (cons (protect V365) (cons (protect V366) ())))) (cons (cons cond (cons (cons (cons > (cons (protect V366) (cons (protect V365) ()))) (cons 1 ())) (cons (cons (cons and (cons (cons integer? (cons (cons / (cons (protect V363) (cons (protect V366) ()))) ())) (cons (cons integer? (cons (cons / (cons (protect V364) (cons (protect V366) ()))) ())) ()))) (cons (protect V366) ())) (cons (cons true (cons (cons maths.lcd-loop (cons (protect V363) (cons (protect V364) (cons (protect V365) (cons (cons + (cons 2 (cons (protect V366) ()))) ()))))) ())) ())))) ()))))) (do (shen.record-kl isqrt (cons defun (cons isqrt (cons (cons (protect V371) ()) (cons (cons maths.isqrt-loop (cons (protect V371) (cons 0 ()))) ()))))) (do (shen.record-kl maths.isqrt-loop (cons defun (cons maths.isqrt-loop (cons (cons (protect V373) (cons (protect V374) ())) (cons (cons cond (cons (cons (cons = (cons (cons * (cons (protect V374) (cons (protect V374) ()))) (cons (protect V373) ()))) (cons (protect V374) ())) (cons (cons (cons > (cons (cons * (cons (protect V374) (cons (protect V374) ()))) (cons (protect V373) ()))) (cons (cons - (cons (protect V374) (cons 1 ()))) ())) (cons (cons true (cons (cons maths.isqrt-loop (cons (protect V373) (cons (cons + (cons (protect V374) (cons 1 ()))) ()))) ())) ())))) ()))))) (do (shen.record-kl div (cons defun (cons div (cons (cons (protect V377) (cons (protect V378) ())) (cons (cons floor (cons (cons / (cons (protect V377) (cons (protect V378) ()))) ())) ()))))) (do (shen.record-kl modf (cons defun (cons modf (cons (cons (protect V381) ()) (cons (cons let (cons (protect W382) (cons (cons floor (cons (protect V381) ())) (cons (cons @p (cons (protect W382) (cons (cons - (cons (protect V381) (cons (protect W382) ()))) ()))) ())))) ()))))) (do (shen.record-kl floor (cons defun (cons floor (cons (cons (protect V384) ()) (cons (cons cond (cons (cons (cons negative? (cons (protect V384) ())) (cons (cons ~ (cons (cons ceiling (cons (cons ~ (cons (protect V384) ())) ())) ())) ())) (cons (cons true (cons (cons maths.rounding-loop (cons floor (cons (protect V384) (cons 15 (cons 0 ()))))) ())) ()))) ()))))) (do (shen.record-kl maths.rounding-loop (cons defun (cons maths.rounding-loop (cons (cons (protect V389) (cons (protect V390) (cons (protect V391) (cons (protect V392) ())))) (cons (cons cond (cons (cons (cons and (cons (cons = (cons 0 (cons (protect V391) ()))) (cons (cons = (cons (protect V390) (cons (protect V392) ()))) ()))) (cons (protect V392) ())) (cons (cons (cons and (cons (cons = (cons 0 (cons (protect V391) ()))) (cons (cons > (cons (protect V392) (cons (protect V390) ()))) ()))) (cons (cons if (cons (cons = (cons (protect V389) (cons floor ()))) (cons (cons - (cons (protect V392) (cons 1 ()))) (cons (cons if (cons (cons = (cons (protect V389) (cons ceiling ()))) (cons (protect V392) (cons (cons if (cons (cons = (cons (protect V389) (cons round ()))) (cons (cons let (cons (protect W393) (cons (cons - (cons (protect V392) (cons (protect V390) ()))) (cons (cons let (cons (protect W394) (cons (cons - (cons (protect V390) (cons (cons - (cons (protect V392) (cons 1 ()))) ()))) (cons (cons if (cons (cons > (cons (protect W393) (cons (protect W394) ()))) (cons (cons - (cons (protect V392) (cons 1 ()))) (cons (protect V392) ())))) ())))) ())))) (cons (cons simple-error (cons "error: cases exhausted" ())) ())))) ())))) ())))) ())) (cons (cons (cons > (cons (protect V390) (cons (protect V392) ()))) (cons (cons maths.rounding-loop (cons (protect V389) (cons (protect V390) (cons (protect V391) (cons (cons + (cons (protect V392) (cons (cons power (cons 10 (cons (protect V391) ()))) ()))) ()))))) ())) (cons (cons true (cons (cons maths.rounding-loop (cons (protect V389) (cons (protect V390) (cons (cons - (cons (protect V391) (cons 1 ()))) (cons (cons - (cons (protect V392) (cons (cons power (cons 10 (cons (protect V391) ()))) ()))) ()))))) ())) ()))))) ()))))) (do (shen.record-kl maths.float->pair (cons defun (cons maths.float->pair (cons (cons (protect V399) ()) (cons (cons let (cons (protect W400) (cons (cons floor (cons (protect V399) ())) (cons (cons @p (cons (protect W400) (cons (cons - (cons (protect V399) (cons (protect W400) ()))) ()))) ())))) ()))))) (do (shen.record-kl ceiling (cons defun (cons ceiling (cons (cons (protect V402) ()) (cons (cons cond (cons (cons (cons negative? (cons (protect V402) ())) (cons (cons ~ (cons (cons floor (cons (cons ~ (cons (protect V402) ())) ())) ())) ())) (cons (cons true (cons (cons maths.rounding-loop (cons ceiling (cons (protect V402) (cons 15 (cons 0 ()))))) ())) ()))) ()))))) (do (shen.record-kl round (cons defun (cons round (cons (cons (protect V404) ()) (cons (cons cond (cons (cons (cons negative? (cons (protect V404) ())) (cons (cons ~ (cons (cons round (cons (cons ~ (cons (protect V404) ())) ())) ())) ())) (cons (cons true (cons (cons maths.rounding-loop (cons round (cons (protect V404) (cons 15 (cons 0 ()))))) ())) ()))) ()))))) (do (shen.record-kl mod (cons defun (cons mod (cons (cons (protect V406) (cons (protect V407) ())) (cons (cons let (cons (protect W408) (cons (cons / (cons (protect V406) (cons (protect V407) ()))) (cons (cons let (cons (protect W409) (cons (cons floor (cons (protect W408) ())) (cons (cons if (cons (cons and (cons (cons integer? (cons (protect V406) ())) (cons (cons integer? (cons (protect V407) ())) ()))) (cons (cons round (cons (cons * (cons (protect V407) (cons (cons - (cons (protect W408) (cons (protect W409) ()))) ()))) ())) (cons (cons * (cons (protect V407) (cons (cons - (cons (protect W408) (cons (protect W409) ()))) ()))) ())))) ())))) ())))) ()))))) (do (shen.record-kl lcm (cons defun (cons lcm (cons (cons (protect V412) ()) (cons (cons let (cons (protect W413) (cons (cons maths.greatest (cons (protect V412) ())) (cons (cons maths.lcm-h (cons (protect W413) (cons (protect W413) (cons (protect V412) ())))) ())))) ()))))) (do (shen.record-kl maths.greatest (cons defun (cons maths.greatest (cons (cons (protect V417) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V417) ())) (cons (cons = (cons () (cons (cons tl (cons (protect V417) ())) ()))) ()))) (cons (cons hd (cons (protect V417) ())) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V417) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V417) ())) ())) (cons (cons > (cons (cons hd (cons (protect V417) ())) (cons (cons hd (cons (cons tl (cons (protect V417) ())) ())) ()))) ()))) ()))) (cons (cons maths.greatest (cons (cons cons (cons (cons hd (cons (protect V417) ())) (cons (cons tl (cons (cons tl (cons (protect V417) ())) ())) ()))) ())) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V417) ())) (cons (cons cons? (cons (cons tl (cons (protect V417) ())) ())) ()))) (cons (cons maths.greatest (cons (cons tl (cons (protect V417) ())) ())) ())) (cons (cons true (cons (cons shen.f-error (cons maths.greatest ())) ())) ()))))) ()))))) (do (shen.record-kl maths.lcm-h (cons defun (cons maths.lcm-h (cons (cons (protect V419) (cons (protect V420) (cons (protect V421) ()))) (cons (cons cond (cons (cons (cons maths.lcm? (cons (protect V419) (cons (protect V421) ()))) (cons (protect V419) ())) (cons (cons true (cons (cons maths.lcm-h (cons (cons + (cons (protect V419) (cons (protect V420) ()))) (cons (protect V420) (cons (protect V421) ())))) ())) ()))) ()))))) (do (shen.record-kl maths.lcm? (cons defun (cons maths.lcm? (cons (cons (protect V427) (cons (protect V428) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V428) ()))) (cons true ())) (cons (cons (cons cons? (cons (protect V428) ())) (cons (cons and (cons (cons integer? (cons (cons / (cons (protect V427) (cons (cons hd (cons (protect V428) ())) ()))) ())) (cons (cons maths.lcm? (cons (protect V427) (cons (cons tl (cons (protect V428) ())) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons maths.lcm? ())) ())) ())))) ()))))) (do (shen.record-kl random (cons defun (cons random (cons (cons (protect V431) (cons (protect V432) ())) (cons (cons let (cons (protect W433) (cons (cons maths.bbs (cons (cons value (cons maths.*seed* ())) ())) (cons (cons let (cons (protect W434) (cons (cons set (cons maths.*seed* (cons (protect W433) ()))) (cons (cons let (cons (protect W435) (cons (cons min (cons (protect V431) (cons (protect V432) ()))) (cons (cons + (cons (protect W435) (cons (cons mod (cons (protect W434) (cons (cons abs (cons (cons + (cons 1 (cons (cons - (cons (protect V432) (cons (protect V431) ()))) ()))) ())) ()))) ()))) ())))) ())))) ())))) ()))))) (do (shen.record-kl min (cons defun (cons min (cons (cons (protect V440) (cons (protect V441) ())) (cons (cons cond (cons (cons (cons > (cons (protect V440) (cons (protect V441) ()))) (cons (protect V441) ())) (cons (cons true (cons (protect V440) ())) ()))) ()))))) (do (shen.record-kl reseed (cons defun (cons reseed (cons () (cons (cons set (cons maths.*seed* (cons (cons get-time (cons unix ())) ()))) ()))))) (do (shen.record-kl maths.bbs (cons defun (cons maths.bbs (cons (cons (protect V444) ()) (cons (cons let (cons (protect W445) (cons (cons * (cons 1201 (cons 1213 ()))) (cons (cons mod (cons (cons * (cons (protect V444) (cons (protect V444) ()))) (cons (protect W445) ()))) ())))) ()))))) (do (shen.record-kl ~ (cons defun (cons ~ (cons (cons (protect V447) ()) (cons (cons - (cons 0 (cons (protect V447) ()))) ()))))) (do (shen.record-kl positive? (cons defun (cons positive? (cons (cons (protect V449) ()) (cons (cons > (cons (protect V449) (cons 0 ()))) ()))))) (do (shen.record-kl negative? (cons defun (cons negative? (cons (cons (protect V451) ()) (cons (cons < (cons (protect V451) (cons 0 ()))) ()))))) (do (shen.record-kl natural? (cons defun (cons natural? (cons (cons (protect V453) ()) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V453) ()))) (cons true ())) (cons (cons true (cons (cons and (cons (cons integer? (cons (protect V453) ())) (cons (cons positive? (cons (protect V453) ())) ()))) ())) ()))) ()))))) (do (shen.record-kl converge (cons defun (cons converge (cons (cons (protect V455) (cons (protect V456) (cons (protect V457) ()))) (cons (cons maths.converge-help (cons (protect V456) (cons (cons (protect V456) (cons (protect V455) ())) (cons (protect V455) (cons (protect V457) ()))))) ()))))) (do (shen.record-kl maths.converge-help (cons defun (cons maths.converge-help (cons (cons (protect V464) (cons (protect V465) (cons (protect V466) (cons (protect V467) ())))) (cons (cons cond (cons (cons (cons (cons (protect V467) (cons (protect V466) ())) (cons (protect V465) ())) (cons (protect V465) ())) (cons (cons true (cons (cons maths.converge-help (cons (protect V464) (cons (cons (protect V464) (cons (protect V465) ())) (cons (protect V465) (cons (protect V467) ()))))) ())) ()))) ()))))) (do (shen.record-kl nthrt (cons defun (cons nthrt (cons (cons (protect V476) (cons (protect V477) (cons (protect V478) ()))) (cons (cons cond (cons (cons (cons positive? (cons (protect V476) ())) (cons (cons converge (cons (protect V476) (cons (cons lambda (cons (protect Z479) (cons (cons maths.compute-nthrt (cons (protect V476) (cons (protect Z479) (cons (protect V477) (cons (protect V478) ()))))) ()))) (cons (cons approx (cons (protect V478) ())) ())))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "nthrt: negA must be a positive numberneg%" (cons "" ()))) ())) ())) ()))) ()))))) (do (shen.record-kl sqrt (cons defun (cons sqrt (cons (cons (protect V483) (cons (protect V484) ())) (cons (cons nthrt (cons (protect V483) (cons 2 (cons (protect V484) ())))) ()))))) (do (shen.record-kl maths.compute-nthrt (cons defun (cons maths.compute-nthrt (cons (cons (protect V487) (cons (protect V488) (cons (protect V489) (cons (protect V490) ())))) (cons (cons let (cons (protect W491) (cons (cons / (cons 1 (cons (protect V489) ()))) (cons (cons let (cons (protect W492) (cons (cons * (cons (cons - (cons (protect V489) (cons 1 ()))) (cons (protect V488) ()))) (cons (cons let (cons (protect W493) (cons (cons expt (cons (protect V488) (cons (cons - (cons (protect V489) (cons 1 ()))) (cons (protect V490) ())))) (cons (cons let (cons (protect W494) (cons (cons / (cons (protect V487) (cons (protect W493) ()))) (cons (cons let (cons (protect W495) (cons (cons + (cons (protect W492) (cons (protect W494) ()))) (cons (cons * (cons (protect W491) (cons (protect W495) ()))) ())))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl approx (cons defun (cons approx (cons (cons (protect V500) ()) (cons (cons lambda (cons (protect Z501) (cons (cons lambda (cons (protect Z502) (cons (cons let (cons (protect W503) (cons (cons - (cons (protect Z501) (cons (protect Z502) ()))) (cons (cons >= (cons (protect V500) (cons (cons abs (cons (protect W503) ())) ()))) ())))) ()))) ()))) ()))))) (do (shen.record-kl abs (cons defun (cons abs (cons (cons (protect V505) ()) (cons (cons if (cons (cons >= (cons (protect V505) (cons 0 ()))) (cons (protect V505) (cons (cons - (cons 0 (cons (protect V505) ()))) ())))) ()))))) (do (shen.record-kl series (cons defun (cons series (cons (cons (protect V507) (cons (protect V508) (cons (protect V509) (cons (protect V510) ())))) (cons (cons maths.series-h (cons (cons + (cons (protect V507) (cons 1 ()))) (cons (protect V509) (cons (protect V508) (cons (cons (protect V508) (cons (protect V507) ())) (cons (protect V510) ())))))) ()))))) (do (shen.record-kl maths.series-h (cons defun (cons maths.series-h (cons (cons (protect V515) (cons (protect V516) (cons (protect V517) (cons (protect V518) (cons (protect V519) ()))))) (cons (cons let (cons (protect W520) (cons (cons (cons (protect V519) (cons (cons (protect V517) (cons (protect V515) ())) ())) (cons (protect V518) ())) (cons (cons if (cons (cons <= (cons (cons abs (cons (cons - (cons (protect V518) (cons (protect W520) ()))) ())) (cons (protect V516) ()))) (cons (protect W520) (cons (cons maths.series-h (cons (cons + (cons (protect V515) (cons 1 ()))) (cons (protect V516) (cons (protect V517) (cons (protect W520) (cons (protect V519) ())))))) ())))) ())))) ()))))) (do (shen.record-kl product (cons defun (cons product (cons (cons (protect V528) (cons (protect V529) (cons (protect V530) ()))) (cons (cons series (cons (protect V528) (cons (protect V529) (cons (protect V530) (cons (cons lambda (cons (protect Z531) (cons (cons lambda (cons (protect Z532) (cons (cons * (cons (protect Z531) (cons (protect Z532) ()))) ()))) ()))) ()))))) ()))))) (do (shen.record-kl summation (cons defun (cons summation (cons (cons (protect V538) (cons (protect V539) (cons (protect V540) ()))) (cons (cons series (cons (protect V538) (cons (protect V539) (cons (protect V540) (cons (cons lambda (cons (protect Z541) (cons (cons lambda (cons (protect Z542) (cons (cons + (cons (protect Z541) (cons (protect Z542) ()))) ()))) ()))) ()))))) ()))))) (do (shen.record-kl odd? (cons defun (cons odd? (cons (cons (protect V546) ()) (cons (cons and (cons (cons integer? (cons (protect V546) ())) (cons (cons not (cons (cons integer? (cons (cons / (cons (protect V546) (cons 2 ()))) ())) ())) ()))) ()))))) (do (shen.record-kl even? (cons defun (cons even? (cons (cons (protect V548) ()) (cons (cons and (cons (cons integer? (cons (protect V548) ())) (cons (cons integer? (cons (cons / (cons (protect V548) (cons 2 ()))) ())) ()))) ()))))) (do (shen.record-kl maths.compute-sine (cons defun (cons maths.compute-sine (cons (cons (protect V550) (cons (protect V551) ())) (cons (cons let (cons (protect W552) (cons (cons + (cons (cons * (cons 2 (cons (protect V551) ()))) (cons 1 ()))) (cons (cons let (cons (protect W553) (cons (cons * (cons (cons power (cons -1 (cons (protect V551) ()))) (cons (cons power (cons (protect V550) (cons (protect W552) ()))) ()))) (cons (cons let (cons (protect W554) (cons (cons factorial (cons (protect W552) ())) (cons (cons / (cons (protect W553) (cons (protect W554) ()))) ())))) ())))) ())))) ()))))) (do (shen.record-kl maths.compute-cos (cons defun (cons maths.compute-cos (cons (cons (protect V557) (cons (protect V558) ())) (cons (cons let (cons (protect W559) (cons (cons * (cons 2 (cons (protect V558) ()))) (cons (cons let (cons (protect W560) (cons (cons * (cons (cons power (cons -1 (cons (protect V558) ()))) (cons (cons power (cons (protect V557) (cons (protect W559) ()))) ()))) (cons (cons let (cons (protect W561) (cons (cons factorial (cons (protect W559) ())) (cons (cons / (cons (protect W560) (cons (protect W561) ()))) ())))) ())))) ())))) ()))))) (do (shen.record-kl cos (cons defun (cons cos (cons (cons (protect V565) (cons (protect V566) ())) (cons (cons let (cons (protect W567) (cons (cons radians (cons (protect V565) ())) (cons (cons summation (cons 0 (cons (cons lambda (cons (protect Z568) (cons (cons maths.compute-cos (cons (protect W567) (cons (protect Z568) ()))) ()))) (cons (protect V566) ())))) ())))) ()))))) (do (shen.record-kl sin (cons defun (cons sin (cons (cons (protect V572) (cons (protect V573) ())) (cons (cons let (cons (protect W574) (cons (cons radians (cons (protect V572) ())) (cons (cons summation (cons 0 (cons (cons lambda (cons (protect Z575) (cons (cons maths.compute-sine (cons (protect W574) (cons (protect Z575) ()))) ()))) (cons (protect V573) ())))) ())))) ()))))) (do (shen.record-kl tan (cons defun (cons tan (cons (cons (protect V578) (cons (protect V579) ())) (cons (cons / (cons (cons sin (cons (protect V578) (cons (protect V579) ()))) (cons (cons cos (cons (protect V578) (cons (protect V579) ()))) ()))) ()))))) (do (shen.record-kl radians (cons defun (cons radians (cons (cons (protect V582) ()) (cons (cons * (cons (cons / (cons (protect V582) (cons 180 ()))) (cons (cons pi ()) ()))) ()))))) (do (shen.record-kl g (cons defun (cons g (cons () (cons 1.6180339887498 ()))))) (do (shen.record-kl pi (cons defun (cons pi (cons () (cons 3.1415926535897 ()))))) (do (shen.record-kl e (cons defun (cons e (cons () (cons 2.7182818284590002 ()))))) (do (shen.record-kl tan30 (cons defun (cons tan30 (cons () (cons 0.5773502691896 ()))))) (do (shen.record-kl cos30 (cons defun (cons cos30 (cons () (cons 0.8660254037844001 ()))))) (do (shen.record-kl cos45 (cons defun (cons cos45 (cons () (cons 0.70710678118651 ()))))) (do (shen.record-kl sin45 (cons defun (cons sin45 (cons () (cons 0.7071067811865 ()))))) (do (shen.record-kl sqrt2 (cons defun (cons sqrt2 (cons () (cons 1.4142135623731 ()))))) (do (shen.record-kl tan60 (cons defun (cons tan60 (cons () (cons 1.7320508075692 ()))))) (do (shen.record-kl maths.sin60 (cons defun (cons maths.sin60 (cons () (cons 0.8660254037844001 ()))))) (do (shen.record-kl sin120 (cons defun (cons sin120 (cons () (cons 0.8660254037844001 ()))))) (do (shen.record-kl tan120 (cons defun (cons tan120 (cons () (cons -1.7320508075692 ()))))) (do (shen.record-kl sin135 (cons defun (cons sin135 (cons () (cons 0.7071067811865 ()))))) (do (shen.record-kl cos135 (cons defun (cons cos135 (cons () (cons -0.7071067811865 ()))))) (do (shen.record-kl cos150 (cons defun (cons cos150 (cons () (cons -0.8660254037844001 ()))))) (do (shen.record-kl tan150 (cons defun (cons tan150 (cons () (cons -0.5773502691905 ()))))) (do (shen.record-kl cos210 (cons defun (cons cos210 (cons () (cons -0.8660254037844001 ()))))) (do (shen.record-kl tan210 (cons defun (cons tan210 (cons () (cons 0.5773502691905 ()))))) (do (shen.record-kl sin225 (cons defun (cons sin225 (cons () (cons -0.7071067811865 ()))))) (do (shen.record-kl cos225 (cons defun (cons cos225 (cons () (cons -0.7071067811865 ()))))) (do (shen.record-kl sin240 (cons defun (cons sin240 (cons () (cons -0.8660254037844001 ()))))) (do (shen.record-kl tan240 (cons defun (cons tan240 (cons () (cons 1.7320508075692 ()))))) (do (shen.record-kl sin300 (cons defun (cons sin300 (cons () (cons -0.8660254037844001 ()))))) (do (shen.record-kl tan300 (cons defun (cons tan300 (cons () (cons -1.7320508075692 ()))))) (do (shen.record-kl sin315 (cons defun (cons sin315 (cons () (cons -0.7071067811865 ()))))) (do (shen.record-kl cos315 (cons defun (cons cos315 (cons () (cons 0.7071067811865 ()))))) (do (shen.record-kl cos330 (cons defun (cons cos330 (cons () (cons 0.8660254037844001 ()))))) (do (shen.record-kl tan330 (cons defun (cons tan330 (cons () (cons -0.5773502691905 ()))))) (do (shen.record-kl coth (cons defun (cons coth (cons (cons (protect V584) (cons (protect V585) ())) (cons (cons let (cons (protect W586) (cons (cons e ()) (cons (cons let (cons (protect W587) (cons (cons expt (cons (protect W586) (cons (cons ~ (cons (cons * (cons 2 (cons (protect V584) ()))) ())) (cons (protect V585) ())))) (cons (cons / (cons (cons + (cons 1 (cons (protect W587) ()))) (cons (cons - (cons 1 (cons (protect W587) ()))) ()))) ())))) ())))) ()))))) (do (shen.record-kl sinh (cons defun (cons sinh (cons (cons (protect V590) (cons (protect V591) ())) (cons (cons let (cons (protect W592) (cons (cons e ()) (cons (cons let (cons (protect W593) (cons (cons expt (cons (protect W592) (cons (protect V590) (cons (protect V591) ())))) (cons (cons let (cons (protect W594) (cons (cons expt (cons (protect W592) (cons (cons ~ (cons (protect V590) ())) (cons (protect V591) ())))) (cons (cons let (cons (protect W595) (cons (cons - (cons (protect W593) (cons (protect W594) ()))) (cons (cons / (cons (protect W595) (cons 2 ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl cosh (cons defun (cons cosh (cons (cons (protect V598) (cons (protect V599) ())) (cons (cons let (cons (protect W600) (cons (cons e ()) (cons (cons let (cons (protect W601) (cons (cons expt (cons (protect W600) (cons (protect V598) (cons (protect V599) ())))) (cons (cons let (cons (protect W602) (cons (cons expt (cons (protect W600) (cons (cons ~ (cons (protect V598) ())) (cons (protect V599) ())))) (cons (cons let (cons (protect W603) (cons (cons + (cons (protect W601) (cons (protect W602) ()))) (cons (cons / (cons (protect W603) (cons 2 ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl tanh (cons defun (cons tanh (cons (cons (protect V606) (cons (protect V607) ())) (cons (cons / (cons (cons sinh (cons (protect V606) (cons (protect V607) ()))) (cons (cons cosh (cons (protect V606) (cons (protect V607) ()))) ()))) ()))))) (do (shen.record-kl sech (cons defun (cons sech (cons (cons (protect V610) (cons (protect V611) ())) (cons (cons / (cons 1 (cons (cons cosh (cons (protect V610) (cons (protect V611) ()))) ()))) ()))))) (do (shen.record-kl csch (cons defun (cons csch (cons (cons (protect V614) (cons (protect V615) ())) (cons (cons / (cons 1 (cons (cons sinh (cons (protect V614) (cons (protect V615) ()))) ()))) ()))))) (do (shen.record-kl power (cons defun (cons power (cons (cons (protect V620) (cons (protect V621) ())) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V621) ()))) (cons 1 ())) (cons (cons true (cons (cons * (cons (protect V620) (cons (cons power (cons (protect V620) (cons (cons - (cons (protect V621) (cons 1 ()))) ()))) ()))) ())) ()))) ()))))) (do (shen.record-kl factorial (cons defun (cons factorial (cons (cons (protect V624) ()) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V624) ()))) (cons 1 ())) (cons (cons true (cons (cons * (cons (protect V624) (cons (cons factorial (cons (cons - (cons (protect V624) (cons 1 ()))) ())) ()))) ())) ()))) ()))))) (do (shen.record-kl prime? (cons defun (cons prime? (cons (cons (protect V626) ()) (cons (cons cond (cons (cons (cons = (cons 2 (cons (protect V626) ()))) (cons true ())) (cons (cons (cons even? (cons (protect V626) ())) (cons false ())) (cons (cons true (cons (cons maths.prime-h (cons (protect V626) (cons (cons isqrt (cons (protect V626) ())) (cons 3 ())))) ())) ())))) ()))))) (do (shen.record-kl maths.prime-h (cons defun (cons maths.prime-h (cons (cons (protect V629) (cons (protect V630) (cons (protect V631) ()))) (cons (cons cond (cons (cons (cons > (cons (protect V631) (cons (protect V630) ()))) (cons true ())) (cons (cons (cons integer? (cons (cons / (cons (protect V629) (cons (protect V631) ()))) ())) (cons false ())) (cons (cons true (cons (cons maths.prime-h (cons (protect V629) (cons (protect V630) (cons (cons + (cons (protect V631) (cons 2 ()))) ())))) ())) ())))) ()))))) (do (shen.record-kl maths.sign (cons defun (cons maths.sign (cons (cons (protect V637) ()) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V637) ()))) (cons 0 ())) (cons (cons (cons positive? (cons (protect V637) ())) (cons 1 ())) (cons (cons true (cons -1 ())) ())))) ()))))) (do (shen.record-kl log (cons defun (cons log (cons (cons (protect V639) (cons (protect V640) (cons (protect V641) ()))) (cons (cons / (cons (cons log10 (cons (protect V639) (cons (protect V641) ()))) (cons (cons log10 (cons (protect V640) (cons (protect V641) ()))) ()))) ()))))) (do (shen.record-kl loge (cons defun (cons loge (cons (cons (protect V645) (cons (protect V646) ())) (cons (cons log (cons (protect V645) (cons (cons e ()) (cons (protect V646) ())))) ()))))) (do (shen.record-kl log2 (cons defun (cons log2 (cons (cons (protect V649) (cons (protect V650) ())) (cons (cons log (cons (protect V649) (cons 2 (cons (protect V650) ())))) ()))))) (do (shen.record-kl log10 (cons defun (cons log10 (cons (cons (protect V653) (cons (protect V654) ())) (cons (cons if (cons (cons >= (cons (protect V653) (cons 1 ()))) (cons (cons maths.log10+ (cons (protect V653) (cons (protect V654) ()))) (cons (cons ~ (cons (cons maths.log10+ (cons (cons / (cons 1 (cons (protect V653) ()))) (cons (protect V654) ()))) ())) ())))) ()))))) (do (shen.record-kl maths.log10+ (cons defun (cons maths.log10+ (cons (cons (protect V657) (cons (protect V658) ())) (cons (cons cond (cons (cons (cons <= (cons (cons abs (cons (protect V657) ())) (cons (protect V658) ()))) (cons 0 ())) (cons (cons (cons >= (cons (protect V657) (cons 10 ()))) (cons (cons + (cons 1 (cons (cons maths.log10+ (cons (cons / (cons (protect V657) (cons 10 ()))) (cons (protect V658) ()))) ()))) ())) (cons (cons true (cons (cons * (cons 0.1 (cons (cons maths.log10+ (cons (cons power (cons (protect V657) (cons 10 ()))) (cons (cons * (cons 10 (cons (protect V658) ()))) ()))) ()))) ())) ())))) ()))))) (do (shen.record-kl r# (cons defun (cons r# (cons (cons (protect V667) (cons (protect V668) ())) (cons (cons cond (cons (cons (cons and (cons (cons integer? (cons (protect V667) ())) (cons (cons integer? (cons (protect V668) ())) ()))) (cons (cons let (cons (protect W669) (cons (cons absvector (cons 3 ())) (cons (cons let (cons (protect W670) (cons (cons address-> (cons (protect W669) (cons 0 (cons rational.print-rational ())))) (cons (cons let (cons (protect W671) (cons (cons address-> (cons (protect W669) (cons 1 (cons (protect V667) ())))) (cons (cons let (cons (protect W672) (cons (cons address-> (cons (protect W669) (cons 2 (cons (protect V668) ())))) (cons (protect W669) ())))) ())))) ())))) ())))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "numerator " (cons (cons shen.app (cons (protect V667) (cons (cons cn (cons " and divisor " (cons (cons shen.app (cons (protect V668) (cons " must be integers -" (cons shen.s ())))) ()))) (cons shen.s ())))) ()))) ())) ())) ()))) ()))))) (do (shen.record-kl rational.print-rational (cons defun (cons rational.print-rational (cons (cons (protect V675) ()) (cons (cons shen.app (cons (cons <-address (cons (protect V675) (cons 1 ()))) (cons (cons cn (cons "/" (cons (cons shen.app (cons (cons <-address (cons (protect V675) (cons 2 ()))) (cons "" (cons shen.s ())))) ()))) (cons shen.s ())))) ()))))) (do (shen.record-kl rational? (cons defun (cons rational? (cons (cons (protect V677) ()) (cons (cons trap-error (cons (cons and (cons (cons absvector? (cons (protect V677) ())) (cons (cons and (cons (cons = (cons (cons <-address (cons (protect V677) (cons 0 ()))) (cons rational.print-rational ()))) (cons (cons and (cons (cons integer? (cons (cons <-address (cons (protect V677) (cons 1 ()))) ())) (cons (cons integer? (cons (cons <-address (cons (protect V677) (cons 2 ()))) ())) ()))) ()))) ()))) (cons (cons lambda (cons (protect Z678) (cons false ()))) ()))) ()))))) (do (shen.record-kl numerator (cons defun (cons numerator (cons (cons (protect V680) ()) (cons (cons <-address (cons (protect V680) (cons 1 ()))) ()))))) (do (shen.record-kl denominator (cons defun (cons denominator (cons (cons (protect V682) ()) (cons (cons <-address (cons (protect V682) (cons 2 ()))) ()))))) (do (shen.record-kl r-op1 (cons defun (cons r-op1 (cons (cons (protect V722) (cons (protect V723) ())) (cons (cons n->r (cons (cons (protect V722) (cons (cons r->n (cons (protect V723) ())) ())) ())) ()))))) (do (shen.record-kl r-op2 (cons defun (cons r-op2 (cons (cons (protect V726) (cons (protect V727) (cons (protect V728) ()))) (cons (cons n->r (cons (cons (cons (protect V726) (cons (cons r->n (cons (protect V727) ())) ())) (cons (cons r->n (cons (protect V728) ())) ())) ())) ()))))) (do (shen.record-kl r->n (cons defun (cons r->n (cons (cons (protect V732) ()) (cons (cons / (cons (cons numerator (cons (protect V732) ())) (cons (cons denominator (cons (protect V732) ())) ()))) ()))))) (do (shen.record-kl r->pair (cons defun (cons r->pair (cons (cons (protect V734) ()) (cons (cons @p (cons (cons numerator (cons (protect V734) ())) (cons (cons denominator (cons (protect V734) ())) ()))) ()))))) (do (shen.record-kl n->r (cons defun (cons n->r (cons (cons (protect V736) ()) (cons (cons let (cons (protect W737) (cons (cons maths.n->r (cons (protect V736) (cons 1 ()))) (cons (cons r# (cons (cons fst (cons (protect W737) ())) (cons (cons snd (cons (protect W737) ())) ()))) ())))) ()))))) (do (shen.record-kl r-reduce (cons defun (cons r-reduce (cons (cons (protect V739) ()) (cons (cons rational.r-reduce-help (cons (cons numerator (cons (protect V739) ())) (cons (cons denominator (cons (protect V739) ())) ()))) ()))))) (do (shen.record-kl rational.r-reduce-help (cons defun (cons rational.r-reduce-help (cons (cons (protect V741) (cons (protect V742) ())) (cons (cons let (cons (protect W743) (cons (cons lcd (cons (protect V741) (cons (protect V742) ()))) (cons (cons if (cons (cons = (cons (protect W743) (cons 1 ()))) (cons (cons r# (cons (protect V741) (cons (protect V742) ()))) (cons (cons rational.r-reduce-help (cons (cons / (cons (protect V741) (cons (protect W743) ()))) (cons (cons / (cons (protect V742) (cons (protect W743) ()))) ()))) ())))) ())))) ()))))) (do (shen.record-kl r= (cons defun (cons r= (cons (cons (protect V746) (cons (protect V747) ())) (cons (cons let (cons (protect W748) (cons (cons numerator (cons (protect V746) ())) (cons (cons let (cons (protect W749) (cons (cons denominator (cons (protect V746) ())) (cons (cons let (cons (protect W750) (cons (cons numerator (cons (protect V747) ())) (cons (cons let (cons (protect W751) (cons (cons denominator (cons (protect V747) ())) (cons (cons = (cons (cons * (cons (protect W748) (cons (protect W751) ()))) (cons (cons * (cons (protect W749) (cons (protect W750) ()))) ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl r< (cons defun (cons r< (cons (cons (protect V754) (cons (protect V755) ())) (cons (cons let (cons (protect W756) (cons (cons numerator (cons (protect V754) ())) (cons (cons let (cons (protect W757) (cons (cons denominator (cons (protect V754) ())) (cons (cons let (cons (protect W758) (cons (cons numerator (cons (protect V755) ())) (cons (cons let (cons (protect W759) (cons (cons denominator (cons (protect V755) ())) (cons (cons < (cons (cons * (cons (protect W756) (cons (protect W759) ()))) (cons (cons * (cons (protect W757) (cons (protect W758) ()))) ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl r> (cons defun (cons r> (cons (cons (protect V762) (cons (protect V763) ())) (cons (cons not (cons (cons or (cons (cons r= (cons (protect V762) (cons (protect V763) ()))) (cons (cons r< (cons (protect V762) (cons (protect V763) ()))) ()))) ())) ()))))) (do (shen.record-kl r>= (cons defun (cons r>= (cons (cons (protect V766) (cons (protect V767) ())) (cons (cons or (cons (cons r= (cons (protect V766) (cons (protect V767) ()))) (cons (cons r> (cons (protect V766) (cons (protect V767) ()))) ()))) ()))))) (do (shen.record-kl r<= (cons defun (cons r<= (cons (cons (protect V770) (cons (protect V771) ())) (cons (cons or (cons (cons r= (cons (protect V770) (cons (protect V771) ()))) (cons (cons r< (cons (protect V770) (cons (protect V771) ()))) ()))) ()))))) (do (shen.record-kl r+ (cons defun (cons r+ (cons (cons (protect V774) (cons (protect V775) ())) (cons (cons let (cons (protect W776) (cons (cons numerator (cons (protect V774) ())) (cons (cons let (cons (protect W777) (cons (cons denominator (cons (protect V774) ())) (cons (cons let (cons (protect W778) (cons (cons numerator (cons (protect V775) ())) (cons (cons let (cons (protect W779) (cons (cons denominator (cons (protect V775) ())) (cons (cons r# (cons (cons + (cons (cons * (cons (protect W776) (cons (protect W779) ()))) (cons (cons * (cons (protect W777) (cons (protect W778) ()))) ()))) (cons (cons * (cons (protect W777) (cons (protect W779) ()))) ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl r- (cons defun (cons r- (cons (cons (protect V782) (cons (protect V783) ())) (cons (cons let (cons (protect W784) (cons (cons numerator (cons (protect V782) ())) (cons (cons let (cons (protect W785) (cons (cons denominator (cons (protect V782) ())) (cons (cons let (cons (protect W786) (cons (cons numerator (cons (protect V783) ())) (cons (cons let (cons (protect W787) (cons (cons denominator (cons (protect V783) ())) (cons (cons r# (cons (cons - (cons (cons * (cons (protect W784) (cons (protect W787) ()))) (cons (cons * (cons (protect W785) (cons (protect W786) ()))) ()))) (cons (cons * (cons (protect W785) (cons (protect W787) ()))) ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl r* (cons defun (cons r* (cons (cons (protect V790) (cons (protect V791) ())) (cons (cons let (cons (protect W792) (cons (cons numerator (cons (protect V790) ())) (cons (cons let (cons (protect W793) (cons (cons denominator (cons (protect V790) ())) (cons (cons let (cons (protect W794) (cons (cons numerator (cons (protect V791) ())) (cons (cons let (cons (protect W795) (cons (cons denominator (cons (protect V791) ())) (cons (cons r# (cons (cons * (cons (protect W792) (cons (protect W794) ()))) (cons (cons * (cons (protect W793) (cons (protect W795) ()))) ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl +-inverse (cons defun (cons +-inverse (cons (cons (protect V798) ()) (cons (cons let (cons (protect W799) (cons (cons numerator (cons (protect V798) ())) (cons (cons let (cons (protect W800) (cons (cons denominator (cons (protect V798) ())) (cons (cons r# (cons (cons ~ (cons (protect W799) ())) (cons (protect W800) ()))) ())))) ())))) ()))))) (do (shen.record-kl *-inverse (cons defun (cons *-inverse (cons (cons (protect V802) ()) (cons (cons let (cons (protect W803) (cons (cons numerator (cons (protect V802) ())) (cons (cons let (cons (protect W804) (cons (cons denominator (cons (protect V802) ())) (cons (cons r# (cons (protect W804) (cons (protect W803) ()))) ())))) ())))) ()))))) (do (shen.record-kl r/ (cons defun (cons r/ (cons (cons (protect V806) (cons (protect V807) ())) (cons (cons r* (cons (protect V806) (cons (cons *-inverse (cons (protect V807) ())) ()))) ()))))) (do (shen.record-kl r-expt (cons defun (cons r-expt (cons (cons (protect V812) (cons (protect V813) ())) (cons (cons cond (cons (cons (cons natural? (cons (protect V813) ())) (cons (cons let (cons (protect W814) (cons (cons numerator (cons (protect V812) ())) (cons (cons let (cons (protect W815) (cons (cons denominator (cons (protect V812) ())) (cons (cons r# (cons (cons power (cons (protect W814) (cons (protect V813) ()))) (cons (cons power (cons (protect W815) (cons (protect V813) ()))) ()))) ())))) ())))) ())) (cons (cons (cons and (cons (cons integer? (cons (protect V813) ())) (cons (cons negative? (cons (protect V813) ())) ()))) (cons (cons let (cons (protect W816) (cons (cons numerator (cons (protect V812) ())) (cons (cons let (cons (protect W817) (cons (cons denominator (cons (protect V812) ())) (cons (cons r# (cons (cons power (cons (protect W817) (cons (cons ~ (cons (protect V813) ())) ()))) (cons (cons power (cons (protect W816) (cons (cons ~ (cons (protect V813) ())) ()))) ()))) ())))) ())))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "cannot exponentiate a rational by a non-integer " (cons (cons shen.app (cons (protect V813) (cons " -" (cons shen.a ())))) ()))) ())) ())) ())))) ()))))) (do (shen.record-kl r-approx (cons defun (cons r-approx (cons (cons (protect V820) (cons (protect V821) ())) (cons (cons rational.approx-r-h (cons (cons r->n (cons (protect V820) ())) (cons (protect V821) (cons 0 ())))) ()))))) (do (shen.record-kl rational.approx-r-h (cons defun (cons rational.approx-r-h (cons (cons (protect V824) (cons (protect V825) (cons (protect V826) ()))) (cons (cons cond (cons (cons (cons > (cons (cons / (cons (protect V826) (cons (protect V825) ()))) (cons (protect V824) ()))) (cons (cons r# (cons (protect V826) (cons (protect V825) ()))) ())) (cons (cons true (cons (cons rational.approx-r-h (cons (protect V824) (cons (protect V825) (cons (cons + (cons (protect V826) (cons 1 ()))) ())))) ())) ()))) ()))))) (do (shen.record-kl c# (cons defun (cons c# (cons (cons (protect V836) (cons (protect V837) ())) (cons (cons cond (cons (cons (cons and (cons (cons number? (cons (protect V836) ())) (cons (cons number? (cons (protect V837) ())) ()))) (cons (cons let (cons (protect W838) (cons (cons absvector (cons 3 ())) (cons (cons let (cons (protect W839) (cons (cons address-> (cons (protect W838) (cons 0 (cons complex.print-complex ())))) (cons (cons let (cons (protect W840) (cons (cons address-> (cons (protect W838) (cons 1 (cons (protect V836) ())))) (cons (cons let (cons (protect W841) (cons (cons address-> (cons (protect W838) (cons 2 (cons (protect V837) ())))) (cons (protect W838) ())))) ())))) ())))) ())))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "real " (cons (cons shen.app (cons (protect V836) (cons (cons cn (cons " and imaginary " (cons (cons shen.app (cons (protect V837) (cons " must be numbers -" (cons shen.a ())))) ()))) (cons shen.a ())))) ()))) ())) ())) ()))) ()))))) (do (shen.record-kl complex.print-complex (cons defun (cons complex.print-complex (cons (cons (protect V844) ()) (cons (cons shen.insert (cons (cons <-address (cons (protect V844) (cons 2 ()))) (cons (cons shen.insert (cons (cons <-address (cons (protect V844) (cons 1 ()))) (cons (cons shen.proc-nl (cons (cons cn (cons "(c" (cons "# ~A ~A)" ()))) ())) ()))) ()))) ()))))) (do (shen.record-kl complex? (cons defun (cons complex? (cons (cons (protect V846) ()) (cons (cons trap-error (cons (cons and (cons (cons absvector? (cons (protect V846) ())) (cons (cons and (cons (cons = (cons (cons <-address (cons (protect V846) (cons 0 ()))) (cons complex.print-complex ()))) (cons (cons and (cons (cons number? (cons (cons <-address (cons (protect V846) (cons 1 ()))) ())) (cons (cons number? (cons (cons <-address (cons (protect V846) (cons 2 ()))) ())) ()))) ()))) ()))) (cons (cons lambda (cons (protect Z847) (cons false ()))) ()))) ()))))) (do (shen.record-kl real (cons defun (cons real (cons (cons (protect V849) ()) (cons (cons <-address (cons (protect V849) (cons 1 ()))) ()))))) (do (shen.record-kl imaginary (cons defun (cons imaginary (cons (cons (protect V851) ()) (cons (cons <-address (cons (protect V851) (cons 2 ()))) ()))))) (do (shen.record-kl c+ (cons defun (cons c+ (cons (cons (protect V861) (cons (protect V862) ())) (cons (cons let (cons (protect W863) (cons (cons real (cons (protect V861) ())) (cons (cons let (cons (protect W864) (cons (cons imaginary (cons (protect V861) ())) (cons (cons let (cons (protect W865) (cons (cons real (cons (protect V862) ())) (cons (cons let (cons (protect W866) (cons (cons imaginary (cons (protect V862) ())) (cons (cons c# (cons (cons + (cons (protect W863) (cons (protect W865) ()))) (cons (cons + (cons (protect W864) (cons (protect W866) ()))) ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl c- (cons defun (cons c- (cons (cons (protect V869) (cons (protect V870) ())) (cons (cons let (cons (protect W871) (cons (cons real (cons (protect V869) ())) (cons (cons let (cons (protect W872) (cons (cons imaginary (cons (protect V869) ())) (cons (cons let (cons (protect W873) (cons (cons real (cons (protect V870) ())) (cons (cons let (cons (protect W874) (cons (cons imaginary (cons (protect V870) ())) (cons (cons c# (cons (cons - (cons (protect W871) (cons (protect W873) ()))) (cons (cons - (cons (protect W872) (cons (protect W874) ()))) ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl c* (cons defun (cons c* (cons (cons (protect V877) (cons (protect V878) ())) (cons (cons let (cons (protect W879) (cons (cons real (cons (protect V877) ())) (cons (cons let (cons (protect W880) (cons (cons imaginary (cons (protect V877) ())) (cons (cons let (cons (protect W881) (cons (cons real (cons (protect V878) ())) (cons (cons let (cons (protect W882) (cons (cons imaginary (cons (protect V878) ())) (cons (cons c# (cons (cons - (cons (cons * (cons (protect W879) (cons (protect W881) ()))) (cons (cons * (cons (protect W880) (cons (protect W882) ()))) ()))) (cons (cons + (cons (cons * (cons (protect W880) (cons (protect W881) ()))) (cons (cons * (cons (protect W879) (cons (protect W882) ()))) ()))) ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl c/ (cons defun (cons c/ (cons (cons (protect V885) (cons (protect V886) ())) (cons (cons let (cons (protect W887) (cons (cons real (cons (protect V885) ())) (cons (cons let (cons (protect W888) (cons (cons imaginary (cons (protect V885) ())) (cons (cons let (cons (protect W889) (cons (cons real (cons (protect V886) ())) (cons (cons let (cons (protect W890) (cons (cons imaginary (cons (protect V886) ())) (cons (cons c# (cons (cons / (cons (cons + (cons (cons * (cons (protect W887) (cons (protect W889) ()))) (cons (cons * (cons (protect W888) (cons (protect W890) ()))) ()))) (cons (cons + (cons (cons * (cons (protect W889) (cons (protect W889) ()))) (cons (cons * (cons (protect W890) (cons (protect W890) ()))) ()))) ()))) (cons (cons / (cons (cons - (cons (cons * (cons (protect W888) (cons (protect W889) ()))) (cons (cons * (cons (protect W887) (cons (protect W890) ()))) ()))) (cons (cons + (cons (cons * (cons (protect W889) (cons (protect W889) ()))) (cons (cons * (cons (protect W890) (cons (protect W890) ()))) ()))) ()))) ()))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl n# (cons defun (cons n# (cons (cons (protect V903) (cons (protect V904) ())) (cons (cons cond (cons (cons (cons and (cons (cons natural? (cons (protect V903) ())) (cons (cons and (cons (cons natural? (cons (protect V904) ())) (cons (cons > (cons (protect V904) (cons 0 ()))) ()))) ()))) (cons (cons let (cons (protect W905) (cons (cons absvector (cons 4 ())) (cons (cons let (cons (protect W906) (cons (cons address-> (cons (protect W905) (cons 0 (cons numerals.print-numeral ())))) (cons (cons let (cons (protect W907) (cons (cons address-> (cons (protect W905) (cons 1 (cons (cons (cons (cons fn (cons numerals.n->numeral ())) (cons (protect V903) ())) (cons (protect V904) ())) ())))) (cons (cons let (cons (protect W908) (cons (cons address-> (cons (protect W905) (cons 2 (cons (protect V904) ())))) (cons (cons let (cons (protect W909) (cons (cons address-> (cons (protect W905) (cons 3 (cons (protect V903) ())))) (cons (protect W905) ())))) ())))) ())))) ())))) ())))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "N = " (cons (cons shen.app (cons (protect V903) (cons (cons cn (cons ", Radix = " (cons (cons shen.app (cons (protect V904) (cons "; N and Radix must be natural numbers where Radix > 0 -" (cons shen.a ())))) ()))) (cons shen.a ())))) ()))) ())) ())) ()))) ()))))) (do (shen.record-kl radix (cons defun (cons radix (cons (cons (protect V912) ()) (cons (cons <-address (cons (protect V912) (cons 2 ()))) ()))))) (do (shen.record-kl numerals.numerals (cons defun (cons numerals.numerals (cons (cons (protect V914) ()) (cons (cons <-address (cons (protect V914) (cons 1 ()))) ()))))) (do (shen.record-kl n#->n (cons defun (cons n#->n (cons (cons (protect V916) ()) (cons (cons <-address (cons (protect V916) (cons 3 ()))) ()))))) (do (shen.record-kl n#->ns (cons defun (cons n#->ns (cons (cons (protect V918) ()) (cons (cons <-address (cons (protect V918) (cons 1 ()))) ()))))) (do (shen.record-kl numerals.print-numeral (cons defun (cons numerals.print-numeral (cons (cons (protect V920) ()) (cons (cons let (cons (protect W921) (cons (cons radix (cons (protect V920) ())) (cons (cons let (cons (protect W922) (cons (cons numerals.numerals (cons (protect V920) ())) (cons (cons @s (cons (cons numerals.numeric->string (cons (protect W922) (cons (protect W921) ()))) (cons (cons @s (cons "#" (cons (cons str (cons (protect W921) ())) ()))) ()))) ())))) ())))) ()))))) (do (shen.record-kl numerals.numeric->string (cons defun (cons numerals.numeric->string (cons (cons (protect V926) (cons (protect V927) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V926) ()))) (cons "" ())) (cons (cons (cons cons? (cons (protect V926) ())) (cons (cons let (cons (protect W928) (cons (cons if (cons (cons < (cons (cons hd (cons (protect V926) ())) (cons 10 ()))) (cons (cons str (cons (cons hd (cons (protect V926) ())) ())) (cons (cons if (cons (cons > (cons (protect V927) (cons 36 ()))) (cons (cons cn (cons (cons str (cons (cons hd (cons (protect V926) ())) ())) (cons " " ()))) (cons (cons n->string (cons (cons + (cons (cons hd (cons (protect V926) ())) (cons 55 ()))) ())) ())))) ())))) (cons (cons cn (cons (protect W928) (cons (cons numerals.numeric->string (cons (cons tl (cons (protect V926) ())) (cons (protect V927) ()))) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons numerals.numeric->string ())) ())) ())))) ()))))) (do (shen.record-kl numeral? (cons defun (cons numeral? (cons (cons (protect V931) ()) (cons (cons and (cons (cons absvector? (cons (protect V931) ())) (cons (cons = (cons numerals.print-numeral (cons (cons <-address (cons (protect V931) (cons 0 ()))) ()))) ()))) ()))))) (do (shen.record-kl numerals.numeral-macro (cons defun (cons numerals.numeral-macro (cons (cons (protect V969) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V969) ())) (cons (cons and (cons (cons = (cons n-op2 (cons (cons hd (cons (protect V969) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V969) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons n-op2 (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) ())) (cons (cons cons (cons (cons cons (cons radix (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons () ()))) ()))) (cons () ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V969) ())) (cons (cons and (cons (cons = (cons n-op1 (cons (cons hd (cons (protect V969) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V969) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons n-op1 (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons cons (cons (cons cons (cons radix (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ()))) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V969) ())) (cons (cons and (cons (cons = (cons n+ (cons (cons hd (cons (protect V969) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V969) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons n+ (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons cons (cons (cons cons (cons radix (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons () ()))) ()))) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V969) ())) (cons (cons and (cons (cons = (cons n- (cons (cons hd (cons (protect V969) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V969) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons n- (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons cons (cons (cons cons (cons radix (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons () ()))) ()))) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V969) ())) (cons (cons and (cons (cons = (cons n* (cons (cons hd (cons (protect V969) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V969) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons n* (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons cons (cons (cons cons (cons radix (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons () ()))) ()))) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V969) ())) (cons (cons and (cons (cons = (cons n/ (cons (cons hd (cons (protect V969) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V969) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons n/ (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V969) ())) ())) ())) (cons (cons cons (cons (cons cons (cons radix (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V969) ())) ())) (cons () ()))) ()))) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons true (cons (protect V969) ())) ())))))))) ()))))) (do (shen.record-kl n-op2 (cons defun (cons n-op2 (cons (cons (protect V971) (cons (protect V972) (cons (protect V973) (cons (protect V974) ())))) (cons (cons n# (cons (cons (cons (protect V971) (cons (cons n#->n (cons (protect V972) ())) ())) (cons (cons n#->n (cons (protect V973) ())) ())) (cons (protect V974) ()))) ()))))) (do (shen.record-kl n-op1 (cons defun (cons n-op1 (cons (cons (protect V979) (cons (protect V980) (cons (protect V981) ()))) (cons (cons n# (cons (cons (protect V979) (cons (cons n#->n (cons (protect V980) ())) ())) (cons (protect V981) ()))) ()))))) (do (shen.record-kl n+ (cons defun (cons n+ (cons (cons (protect V987) (cons (protect V988) (cons (protect V989) ()))) (cons (cons n-op2 (cons (cons lambda (cons (protect Z990) (cons (cons lambda (cons (protect Z991) (cons (cons + (cons (protect Z990) (cons (protect Z991) ()))) ()))) ()))) (cons (protect V987) (cons (protect V988) (cons (protect V989) ()))))) ()))))) (do (shen.record-kl n* (cons defun (cons n* (cons (cons (protect V997) (cons (protect V998) (cons (protect V999) ()))) (cons (cons n-op2 (cons (cons lambda (cons (protect Z1000) (cons (cons lambda (cons (protect Z1001) (cons (cons * (cons (protect Z1000) (cons (protect Z1001) ()))) ()))) ()))) (cons (protect V997) (cons (protect V998) (cons (protect V999) ()))))) ()))))) (do (shen.record-kl n- (cons defun (cons n- (cons (cons (protect V1007) (cons (protect V1008) (cons (protect V1009) ()))) (cons (cons n-op2 (cons (cons lambda (cons (protect Z1010) (cons (cons lambda (cons (protect Z1011) (cons (cons - (cons (protect Z1010) (cons (protect Z1011) ()))) ()))) ()))) (cons (protect V1007) (cons (protect V1008) (cons (protect V1009) ()))))) ()))))) (do (shen.record-kl n/ (cons defun (cons n/ (cons (cons (protect V1017) (cons (protect V1018) (cons (protect V1019) ()))) (cons (cons n-op2 (cons (cons lambda (cons (protect Z1020) (cons (cons lambda (cons (protect Z1021) (cons (cons / (cons (protect Z1020) (cons (protect Z1021) ()))) ()))) ()))) (cons (protect V1017) (cons (protect V1018) (cons (protect V1019) ()))))) ()))))) (do (shen.record-kl binary (cons defun (cons binary (cons (cons (protect V1025) ()) (cons (cons n# (cons (protect V1025) (cons 2 ()))) ()))))) (do (shen.record-kl hex (cons defun (cons hex (cons (cons (protect V1027) ()) (cons (cons n# (cons (protect V1027) (cons 16 ()))) ()))))) (do (shen.record-kl octal (cons defun (cons octal (cons (cons (protect V1029) ()) (cons (cons n# (cons (protect V1029) (cons 8 ()))) ()))))) (do (shen.record-kl duodecimal (cons defun (cons duodecimal (cons (cons (protect V1031) ()) (cons (cons n# (cons (protect V1031) (cons 12 ()))) ()))))) (do (shen.record-kl numerals.n->numeral (cons defun (cons numerals.n->numeral (cons (cons (protect V1033) (cons (protect V1034) ())) (cons (cons cond (cons (cons (cons > (cons (protect V1034) (cons (protect V1033) ()))) (cons (cons cons (cons (protect V1033) (cons () ()))) ())) (cons (cons true (cons (cons let (cons (protect W1035) (cons (cons numerals.largest-expt (cons (protect V1033) (cons (protect V1034) (cons 0 ())))) (cons (cons let (cons (protect W1036) (cons (cons power (cons (protect V1034) (cons (protect W1035) ()))) (cons (cons let (cons (protect W1037) (cons (cons div (cons (protect V1033) (cons (protect W1036) ()))) (cons (cons let (cons (protect W1038) (cons (cons cons (cons (protect W1037) (cons (cons numerals.n-zeros (cons (protect W1035) ())) ()))) (cons (cons let (cons (protect W1039) (cons (cons - (cons (protect V1033) (cons (cons * (cons (protect W1037) (cons (protect W1036) ()))) ()))) (cons (cons numerals.add (cons (protect W1038) (cons (cons numerals.n->numeral (cons (protect W1039) (cons (protect V1034) ()))) (cons (protect V1034) ())))) ())))) ())))) ())))) ())))) ())))) ())) ()))) ()))))) (do (shen.record-kl numerals.largest-expt (cons defun (cons numerals.largest-expt (cons (cons (protect V1042) (cons (protect V1043) (cons (protect V1044) ()))) (cons (cons cond (cons (cons (cons > (cons (cons power (cons (protect V1043) (cons (protect V1044) ()))) (cons (protect V1042) ()))) (cons (cons - (cons (protect V1044) (cons 1 ()))) ())) (cons (cons true (cons (cons numerals.largest-expt (cons (protect V1042) (cons (protect V1043) (cons (cons + (cons (protect V1044) (cons 1 ()))) ())))) ())) ()))) ()))))) (do (shen.record-kl numerals.n-zeros (cons defun (cons numerals.n-zeros (cons (cons (protect V1048) ()) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V1048) ()))) (cons () ())) (cons (cons true (cons (cons cons (cons 0 (cons (cons numerals.n-zeros (cons (cons - (cons (protect V1048) (cons 1 ()))) ())) ()))) ())) ()))) ()))))) (do (shen.record-kl numerals.add (cons defun (cons numerals.add (cons (cons (protect V1050) (cons (protect V1051) (cons (protect V1052) ()))) (cons (cons reverse (cons (cons numerals.add-h (cons (cons reverse (cons (protect V1050) ())) (cons (cons reverse (cons (protect V1051) ())) (cons (protect V1052) (cons 0 ()))))) ())) ()))))) (do (shen.record-kl numerals.add-h (cons defun (cons numerals.add-h (cons (cons (protect V1060) (cons (protect V1061) (cons (protect V1062) (cons (protect V1063) ())))) (cons (cons cond (cons (cons (cons and (cons (cons = (cons () (cons (protect V1060) ()))) (cons (cons and (cons (cons = (cons () (cons (protect V1061) ()))) (cons (cons = (cons 0 (cons (protect V1063) ()))) ()))) ()))) (cons () ())) (cons (cons (cons and (cons (cons = (cons () (cons (protect V1060) ()))) (cons (cons = (cons () (cons (protect V1061) ()))) ()))) (cons (cons cons (cons (protect V1063) (cons () ()))) ())) (cons (cons (cons = (cons () (cons (protect V1060) ()))) (cons (cons numerals.add-h (cons (cons cons (cons 0 (cons () ()))) (cons (protect V1061) (cons (protect V1062) (cons (protect V1063) ()))))) ())) (cons (cons (cons = (cons () (cons (protect V1061) ()))) (cons (cons numerals.add-h (cons (protect V1060) (cons (cons cons (cons 0 (cons () ()))) (cons (protect V1062) (cons (protect V1063) ()))))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1060) ())) (cons (cons cons? (cons (protect V1061) ())) ()))) (cons (cons let (cons (protect W1064) (cons (cons + (cons (cons hd (cons (protect V1060) ())) (cons (cons + (cons (cons hd (cons (protect V1061) ())) (cons (protect V1063) ()))) ()))) (cons (cons if (cons (cons < (cons (protect W1064) (cons (protect V1062) ()))) (cons (cons cons (cons (protect W1064) (cons (cons numerals.add-h (cons (cons tl (cons (protect V1060) ())) (cons (cons tl (cons (protect V1061) ())) (cons (protect V1062) (cons 0 ()))))) ()))) (cons (cons cons (cons (cons - (cons (protect V1062) (cons (protect W1064) ()))) (cons (cons numerals.add-h (cons (cons tl (cons (protect V1060) ())) (cons (cons tl (cons (protect V1061) ())) (cons (protect V1062) (cons 1 ()))))) ()))) ())))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons numerals.add-h ())) ())) ()))))))) ()))))) (do (shen.record-kl assoc-if (cons defun (cons assoc-if (cons (cons (protect V1175) (cons (protect V1176) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1176) ()))) (cons () ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1176) ())) (cons (cons and (cons (cons cons? (cons (cons hd (cons (protect V1176) ())) ())) (cons (cons (protect V1175) (cons (cons hd (cons (cons hd (cons (protect V1176) ())) ())) ())) ()))) ()))) (cons (cons hd (cons (protect V1176) ())) ())) (cons (cons (cons cons? (cons (protect V1176) ())) (cons (cons assoc-if (cons (protect V1175) (cons (cons tl (cons (protect V1176) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons assoc-if ())) ())) ()))))) ()))))) (do (shen.record-kl assoc-if-not (cons defun (cons assoc-if-not (cons (cons (protect V1184) (cons (protect V1185) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1185) ()))) (cons () ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1185) ())) (cons (cons and (cons (cons cons? (cons (cons hd (cons (protect V1185) ())) ())) (cons (cons not (cons (cons (protect V1184) (cons (cons hd (cons (cons hd (cons (protect V1185) ())) ())) ())) ())) ()))) ()))) (cons (cons hd (cons (protect V1185) ())) ())) (cons (cons (cons cons? (cons (protect V1185) ())) (cons (cons assoc-if (cons (protect V1184) (cons (cons tl (cons (protect V1185) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons assoc-if-not ())) ())) ()))))) ()))))) (do (shen.record-kl drop (cons defun (cons drop (cons (cons (protect V1190) (cons (protect V1191) ())) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V1190) ()))) (cons (protect V1191) ())) (cons (cons (cons cons? (cons (protect V1191) ())) (cons (cons drop (cons (cons - (cons (protect V1190) (cons 1 ()))) (cons (cons tl (cons (protect V1191) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons drop ())) ())) ())))) ()))))) (do (shen.record-kl drop-last (cons defun (cons drop-last (cons (cons (protect V1194) (cons (protect V1195) ())) (cons (cons reverse (cons (cons drop (cons (protect V1194) (cons (cons reverse (cons (protect V1195) ())) ()))) ())) ()))))) (do (shen.record-kl index (cons defun (cons index (cons (cons (protect V1198) (cons (protect V1199) ())) (cons (cons list.index-h (cons (protect V1198) (cons (protect V1199) (cons 1 ())))) ()))))) (do (shen.record-kl list.index-h (cons defun (cons list.index-h (cons (cons (protect V1211) (cons (protect V1212) (cons (protect V1213) ()))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1212) ()))) (cons -1 ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1212) ())) (cons (cons = (cons (protect V1211) (cons (cons hd (cons (protect V1212) ())) ()))) ()))) (cons (protect V1213) ())) (cons (cons (cons cons? (cons (protect V1212) ())) (cons (cons list.index-h (cons (protect V1211) (cons (cons tl (cons (protect V1212) ())) (cons (cons + (cons (protect V1213) (cons 1 ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons list.index-h ())) ())) ()))))) ()))))) (do (shen.record-kl index-last (cons defun (cons index-last (cons (cons (protect V1217) (cons (protect V1218) ())) (cons (cons let (cons (protect W1219) (cons (cons length (cons (protect V1218) ())) (cons (cons let (cons (protect W1220) (cons (cons index (cons (protect V1217) (cons (cons reverse (cons (protect V1218) ())) ()))) (cons (cons if (cons (cons = (cons (protect W1220) (cons -1 ()))) (cons (protect W1220) (cons (cons + (cons (cons - (cons (protect W1219) (cons (protect W1220) ()))) (cons 1 ()))) ())))) ())))) ())))) ()))))) (do (shen.record-kl insert (cons defun (cons insert (cons (cons (protect V1225) (cons (protect V1226) (cons (protect V1227) ()))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1227) ()))) (cons (cons simple-error (cons (cons cn (cons "cannot insert " (cons (cons shen.app (cons (protect V1226) (cons " into list: index out of range -" (cons shen.s ())))) ()))) ())) ())) (cons (cons (cons = (cons 1 (cons (protect V1225) ()))) (cons (cons cons (cons (protect V1226) (cons (protect V1227) ()))) ())) (cons (cons (cons cons? (cons (protect V1227) ())) (cons (cons cons (cons (cons hd (cons (protect V1227) ())) (cons (cons insert (cons (cons - (cons (protect V1225) (cons 1 ()))) (cons (protect V1226) (cons (cons tl (cons (protect V1227) ())) ())))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons insert ())) ())) ()))))) ()))))) (do (shen.record-kl remove-duplicates (cons defun (cons remove-duplicates (cons (cons (protect V1231) ()) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1231) ()))) (cons () ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1231) ())) (cons (cons element? (cons (cons hd (cons (protect V1231) ())) (cons (cons tl (cons (protect V1231) ())) ()))) ()))) (cons (cons remove-duplicates (cons (cons tl (cons (protect V1231) ())) ())) ())) (cons (cons (cons cons? (cons (protect V1231) ())) (cons (cons cons (cons (cons hd (cons (protect V1231) ())) (cons (cons remove-duplicates (cons (cons tl (cons (protect V1231) ())) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons remove-duplicates ())) ())) ()))))) ()))))) (do (shen.record-kl trim-left-if (cons defun (cons trim-left-if (cons (cons (protect V1237) (cons (protect V1238) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1238) ()))) (cons () ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1238) ())) (cons (cons (protect V1237) (cons (cons hd (cons (protect V1238) ())) ())) ()))) (cons (cons trim-left-if (cons (protect V1237) (cons (cons tl (cons (protect V1238) ())) ()))) ())) (cons (cons true (cons (protect V1238) ())) ())))) ()))))) (do (shen.record-kl trim-right-if (cons defun (cons trim-right-if (cons (cons (protect V1241) (cons (protect V1242) ())) (cons (cons reverse (cons (cons trim-left-if (cons (protect V1241) (cons (cons reverse (cons (protect V1242) ())) ()))) ())) ()))))) (do (shen.record-kl trim-if (cons defun (cons trim-if (cons (cons (protect V1245) (cons (protect V1246) ())) (cons (cons trim-right-if (cons (protect V1245) (cons (cons trim-left-if (cons (protect V1245) (cons (protect V1246) ()))) ()))) ()))))) (do (shen.record-kl trim-left (cons defun (cons trim-left (cons (cons (protect V1253) (cons (protect V1254) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1254) ()))) (cons () ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1254) ())) (cons (cons element? (cons (cons hd (cons (protect V1254) ())) (cons (protect V1253) ()))) ()))) (cons (cons trim-left (cons (protect V1253) (cons (cons tl (cons (protect V1254) ())) ()))) ())) (cons (cons true (cons (protect V1254) ())) ())))) ()))))) (do (shen.record-kl trim-right (cons defun (cons trim-right (cons (cons (protect V1257) (cons (protect V1258) ())) (cons (cons reverse (cons (cons trim-left (cons (protect V1257) (cons (cons reverse (cons (protect V1258) ())) ()))) ())) ()))))) (do (shen.record-kl trim (cons defun (cons trim (cons (cons (protect V1261) (cons (protect V1262) ())) (cons (cons trim-right (cons (protect V1261) (cons (cons trim-left (cons (protect V1261) (cons (protect V1262) ()))) ()))) ()))))) (do (shen.record-kl prefix? (cons defun (cons prefix? (cons (cons (protect V1272) (cons (protect V1273) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1272) ()))) (cons true ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1272) ())) (cons (cons and (cons (cons cons? (cons (protect V1273) ())) (cons (cons = (cons (cons hd (cons (protect V1272) ())) (cons (cons hd (cons (protect V1273) ())) ()))) ()))) ()))) (cons (cons prefix? (cons (cons tl (cons (protect V1272) ())) (cons (cons tl (cons (protect V1273) ())) ()))) ())) (cons (cons true (cons false ())) ())))) ()))))) (do (shen.record-kl infix? (cons defun (cons infix? (cons (cons (protect V1280) (cons (protect V1281) ())) (cons (cons cond (cons (cons (cons prefix? (cons (protect V1280) (cons (protect V1281) ()))) (cons true ())) (cons (cons (cons = (cons () (cons (protect V1281) ()))) (cons false ())) (cons (cons (cons cons? (cons (protect V1281) ())) (cons (cons infix? (cons (protect V1280) (cons (cons tl (cons (protect V1281) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons infix? ())) ())) ()))))) ()))))) (do (shen.record-kl suffix? (cons defun (cons suffix? (cons (cons (protect V1284) (cons (protect V1285) ())) (cons (cons prefix? (cons (cons reverse (cons (protect V1284) ())) (cons (cons reverse (cons (protect V1285) ())) ()))) ()))))) (do (shen.record-kl subset? (cons defun (cons subset? (cons (cons (protect V1294) (cons (protect V1295) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1294) ()))) (cons true ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1294) ())) (cons (cons element? (cons (cons hd (cons (protect V1294) ())) (cons (protect V1295) ()))) ()))) (cons (cons subset? (cons (cons tl (cons (protect V1294) ())) (cons (protect V1295) ()))) ())) (cons (cons true (cons false ())) ())))) ()))))) (do (shen.record-kl set=? (cons defun (cons set=? (cons (cons (protect V1298) (cons (protect V1299) ())) (cons (cons and (cons (cons subset? (cons (protect V1298) (cons (protect V1299) ()))) (cons (cons subset? (cons (protect V1299) (cons (protect V1298) ()))) ()))) ()))))) (do (shen.record-kl set? (cons defun (cons set? (cons (cons (protect V1304) ()) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1304) ()))) (cons true ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1304) ())) (cons (cons element? (cons (cons hd (cons (protect V1304) ())) (cons (cons tl (cons (protect V1304) ())) ()))) ()))) (cons false ())) (cons (cons (cons cons? (cons (protect V1304) ())) (cons (cons set? (cons (cons tl (cons (protect V1304) ())) ())) ())) (cons (cons true (cons (cons shen.f-error (cons set? ())) ())) ()))))) ()))))) (do (shen.record-kl n-times (cons defun (cons n-times (cons (cons (protect V1306) (cons (protect V1307) ())) (cons (cons list.n-times-h (cons (protect V1307) (cons (protect V1306) (cons () ())))) ()))))) (do (shen.record-kl list.n-times-h (cons defun (cons list.n-times-h (cons (cons (protect V1310) (cons (protect V1311) (cons (protect V1312) ()))) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V1310) ()))) (cons (protect V1312) ())) (cons (cons true (cons (cons list.n-times-h (cons (cons - (cons (protect V1310) (cons 1 ()))) (cons (protect V1311) (cons (cons cons (cons (protect V1311) (cons (protect V1312) ()))) ())))) ())) ()))) ()))))) (do (shen.record-kl subbag? (cons defun (cons subbag? (cons (cons (protect V1316) (cons (protect V1317) ())) (cons (cons every? (cons (cons lambda (cons (protect Z1318) (cons (cons = (cons (cons count (cons (protect Z1318) (cons (protect V1316) ()))) (cons (cons count (cons (protect Z1318) (cons (protect V1317) ()))) ()))) ()))) (cons (protect V1316) ()))) ()))))) (do (shen.record-kl bag=? (cons defun (cons bag=? (cons (cons (protect V1321) (cons (protect V1322) ())) (cons (cons and (cons (cons subbag? (cons (protect V1321) (cons (protect V1322) ()))) (cons (cons subbag? (cons (protect V1322) (cons (protect V1321) ()))) ()))) ()))))) (do (shen.record-kl mapc (cons defun (cons mapc (cons (cons (protect V1327) (cons (protect V1328) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1328) ()))) (cons () ())) (cons (cons (cons cons? (cons (protect V1328) ())) (cons (cons mapc (cons (cons do (cons (cons (protect V1327) (cons (cons hd (cons (protect V1328) ())) ())) (cons (protect V1327) ()))) (cons (cons tl (cons (protect V1328) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons mapc ())) ())) ())))) ()))))) (do (shen.record-kl permute (cons defun (cons permute (cons (cons (protect V1331) ()) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1331) ()))) (cons (cons cons (cons () (cons () ()))) ())) (cons (cons true (cons (cons mapcan (cons (cons lambda (cons (protect Z1332) (cons (cons map (cons (cons lambda (cons (protect Z1333) (cons (cons cons (cons (protect Z1332) (cons (protect Z1333) ()))) ()))) (cons (cons permute (cons (cons remove (cons (protect Z1332) (cons (protect V1331) ()))) ())) ()))) ()))) (cons (protect V1331) ()))) ())) ()))) ()))))) (do (shen.record-kl count-if (cons defun (cons count-if (cons (cons (protect V1335) (cons (protect V1336) ())) (cons (cons length (cons (cons mapcan (cons (cons lambda (cons (protect Z1337) (cons (cons if (cons (cons (protect V1335) (cons (protect Z1337) ())) (cons (cons cons (cons (protect Z1337) (cons () ()))) (cons () ())))) ()))) (cons (protect V1336) ()))) ())) ()))))) (do (shen.record-kl count (cons defun (cons count (cons (cons (protect V1341) (cons (protect V1342) ())) (cons (cons count-if (cons (cons lambda (cons (protect Z1343) (cons (cons = (cons (protect V1341) (cons (protect Z1343) ()))) ()))) (cons (protect V1342) ()))) ()))))) (do (shen.record-kl some? (cons defun (cons some? (cons (cons (protect V1351) (cons (protect V1352) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1352) ()))) (cons false ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1352) ())) (cons (cons (protect V1351) (cons (cons hd (cons (protect V1352) ())) ())) ()))) (cons true ())) (cons (cons (cons cons? (cons (protect V1352) ())) (cons (cons some? (cons (protect V1351) (cons (cons tl (cons (protect V1352) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons some? ())) ())) ()))))) ()))))) (do (shen.record-kl every? (cons defun (cons every? (cons (cons (protect V1361) (cons (protect V1362) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1362) ()))) (cons true ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1362) ())) (cons (cons (protect V1361) (cons (cons hd (cons (protect V1362) ())) ())) ()))) (cons (cons every? (cons (protect V1361) (cons (cons tl (cons (protect V1362) ())) ()))) ())) (cons (cons true (cons false ())) ())))) ()))))) (do (shen.record-kl sort (cons defun (cons sort (cons (cons (protect V1369) (cons (protect V1370) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1370) ()))) (cons () ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1370) ())) (cons (cons = (cons () (cons (cons tl (cons (protect V1370) ())) ()))) ()))) (cons (protect V1370) ())) (cons (cons (cons cons? (cons (protect V1370) ())) (cons (cons let (cons (protect W1371) (cons (cons mapcan (cons (cons lambda (cons (protect Z1372) (cons (cons if (cons (cons (cons (protect V1369) (cons (protect Z1372) ())) (cons (cons hd (cons (protect V1370) ())) ())) (cons (cons cons (cons (protect Z1372) (cons () ()))) (cons () ())))) ()))) (cons (cons tl (cons (protect V1370) ())) ()))) (cons (cons let (cons (protect W1373) (cons (cons mapcan (cons (cons lambda (cons (protect Z1374) (cons (cons if (cons (cons not (cons (cons (cons (protect V1369) (cons (protect Z1374) ())) (cons (cons hd (cons (protect V1370) ())) ())) ())) (cons (cons cons (cons (protect Z1374) (cons () ()))) (cons () ())))) ()))) (cons (cons tl (cons (protect V1370) ())) ()))) (cons (cons append (cons (cons sort (cons (protect V1369) (cons (protect W1371) ()))) (cons (cons append (cons (cons cons (cons (cons hd (cons (protect V1370) ())) (cons () ()))) (cons (cons sort (cons (protect V1369) (cons (protect W1373) ()))) ()))) ()))) ())))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons sort ())) ())) ()))))) ()))))) (do (shen.record-kl find (cons defun (cons find (cons (cons (protect V1382) (cons (protect V1383) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1383) ()))) (cons (cons simple-error (cons "find has found no element -" ())) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1383) ())) (cons (cons (protect V1382) (cons (cons hd (cons (protect V1383) ())) ())) ()))) (cons (cons hd (cons (protect V1383) ())) ())) (cons (cons (cons cons? (cons (protect V1383) ())) (cons (cons find (cons (protect V1382) (cons (cons tl (cons (protect V1383) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons find ())) ())) ()))))) ()))))) (do (shen.record-kl foldr (cons defun (cons foldr (cons (cons (protect V1388) (cons (protect V1389) (cons (protect V1390) ()))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1390) ()))) (cons (protect V1389) ())) (cons (cons (cons cons? (cons (protect V1390) ())) (cons (cons foldr (cons (protect V1388) (cons (cons (cons (protect V1388) (cons (cons hd (cons (protect V1390) ())) ())) (cons (protect V1389) ())) (cons (cons tl (cons (protect V1390) ())) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons foldr ())) ())) ())))) ()))))) (do (shen.record-kl foldl (cons defun (cons foldl (cons (cons (protect V1396) (cons (protect V1397) (cons (protect V1398) ()))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1398) ()))) (cons (protect V1397) ())) (cons (cons (cons cons? (cons (protect V1398) ())) (cons (cons foldl (cons (protect V1396) (cons (cons (cons (protect V1396) (cons (protect V1397) ())) (cons (cons hd (cons (protect V1398) ())) ())) (cons (cons tl (cons (protect V1398) ())) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons foldl ())) ())) ())))) ()))))) (do (shen.record-kl mapf (cons defun (cons mapf (cons (cons (protect V1406) (cons (protect V1407) (cons (protect V1408) ()))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1407) ()))) (cons () ())) (cons (cons (cons cons? (cons (protect V1407) ())) (cons (cons (cons (protect V1408) (cons (cons (protect V1406) (cons (cons hd (cons (protect V1407) ())) ())) ())) (cons (cons mapf (cons (protect V1406) (cons (cons tl (cons (protect V1407) ())) (cons (protect V1408) ())))) ())) ())) (cons (cons true (cons (cons shen.f-error (cons mapf ())) ())) ())))) ()))))) (do (shen.record-kl filter (cons defun (cons filter (cons (cons (protect V1414) (cons (protect V1415) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1415) ()))) (cons () ())) (cons (cons (cons cons? (cons (protect V1415) ())) (cons (cons if (cons (cons (protect V1414) (cons (cons hd (cons (protect V1415) ())) ())) (cons (cons cons (cons (cons hd (cons (protect V1415) ())) (cons (cons filter (cons (protect V1414) (cons (cons tl (cons (protect V1415) ())) ()))) ()))) (cons (cons filter (cons (protect V1414) (cons (cons tl (cons (protect V1415) ())) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons filter ())) ())) ())))) ()))))) (do (shen.record-kl remove-if (cons defun (cons remove-if (cons (cons (protect V1420) (cons (protect V1421) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1421) ()))) (cons () ())) (cons (cons (cons cons? (cons (protect V1421) ())) (cons (cons if (cons (cons (protect V1420) (cons (cons hd (cons (protect V1421) ())) ())) (cons (cons remove-if (cons (protect V1420) (cons (cons tl (cons (protect V1421) ())) ()))) (cons (cons cons (cons (cons hd (cons (protect V1421) ())) (cons (cons remove-if (cons (protect V1420) (cons (cons tl (cons (protect V1421) ())) ()))) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons remove-if ())) ())) ())))) ()))))) (do (shen.record-kl list.reduce (cons defun (cons list.reduce (cons (cons (protect V1424) (cons (protect V1425) (cons (protect V1426) ()))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1426) ()))) (cons (protect V1425) ())) (cons (cons (cons cons? (cons (protect V1426) ())) (cons (cons list.reduce (cons (protect V1424) (cons (cons (cons (protect V1424) (cons (protect V1425) ())) (cons (cons hd (cons (protect V1426) ())) ())) (cons (cons tl (cons (protect V1426) ())) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons list.reduce ())) ())) ())))) ()))))) (do (shen.record-kl take (cons defun (cons take (cons (cons (protect V1434) (cons (protect V1435) ())) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V1434) ()))) (cons () ())) (cons (cons (cons = (cons () (cons (protect V1435) ()))) (cons () ())) (cons (cons (cons cons? (cons (protect V1435) ())) (cons (cons cons (cons (cons hd (cons (protect V1435) ())) (cons (cons take (cons (cons - (cons (protect V1434) (cons 1 ()))) (cons (cons tl (cons (protect V1435) ())) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons take ())) ())) ()))))) ()))))) (do (shen.record-kl take-last (cons defun (cons take-last (cons (cons (protect V1438) (cons (protect V1439) ())) (cons (cons reverse (cons (cons take (cons (protect V1438) (cons (cons reverse (cons (protect V1439) ())) ()))) ())) ()))))) (do (shen.record-kl cartprod (cons defun (cons cartprod (cons (cons (protect V1444) (cons (protect V1445) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1444) ()))) (cons () ())) (cons (cons (cons cons? (cons (protect V1444) ())) (cons (cons append (cons (cons map (cons (cons lambda (cons (protect Z1446) (cons (cons cons (cons (cons hd (cons (protect V1444) ())) (cons (cons cons (cons (protect Z1446) (cons () ()))) ()))) ()))) (cons (protect V1445) ()))) (cons (cons cartprod (cons (cons tl (cons (protect V1444) ())) (cons (protect V1445) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons cartprod ())) ())) ())))) ()))))) (do (shen.record-kl powerset (cons defun (cons powerset (cons (cons (protect V1449) ()) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1449) ()))) (cons (cons cons (cons () (cons () ()))) ())) (cons (cons (cons cons? (cons (protect V1449) ())) (cons (cons let (cons (protect W1450) (cons (cons powerset (cons (cons tl (cons (protect V1449) ())) ())) (cons (cons append (cons (protect W1450) (cons (cons map (cons (cons lambda (cons (protect Z1451) (cons (cons cons (cons (cons hd (cons (protect V1449) ())) (cons (protect Z1451) ()))) ()))) (cons (protect W1450) ()))) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons powerset ())) ())) ())))) ()))))) (do (shen.record-kl partition (cons defun (cons partition (cons (cons (protect V1459) (cons (protect V1460) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1460) ()))) (cons () ())) (cons (cons (cons cons? (cons (protect V1460) ())) (cons (cons let (cons (protect W1461) (cons (cons mapcan (cons (cons lambda (cons (protect Z1462) (cons (cons if (cons (cons (cons (protect V1459) (cons (cons hd (cons (protect V1460) ())) ())) (cons (protect Z1462) ())) (cons (cons cons (cons (protect Z1462) (cons () ()))) (cons () ())))) ()))) (cons (protect V1460) ()))) (cons (cons let (cons (protect W1463) (cons (cons difference (cons (protect V1460) (cons (protect W1461) ()))) (cons (cons cons (cons (protect W1461) (cons (cons partition (cons (protect V1459) (cons (protect W1463) ()))) ()))) ())))) ())))) ())) (cons (cons true (cons (cons simple-error (cons "partition equires a list" ())) ())) ())))) ()))))) (do (shen.record-kl transitive-closure (cons defun (cons transitive-closure (cons (cons (protect V1466) ()) (cons (cons let (cons (protect W1467) (cons (cons list.transitive-pass (cons (protect V1466) (cons (protect V1466) ()))) (cons (cons if (cons (cons = (cons (protect W1467) (cons (protect V1466) ()))) (cons (protect W1467) (cons (cons list.transitive-pass (cons (protect W1467) (cons (protect W1467) ()))) ())))) ())))) ()))))) (do (shen.record-kl list.transitive-pass (cons defun (cons list.transitive-pass (cons (cons (protect V1469) (cons (protect V1470) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1469) ()))) (cons (protect V1470) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1469) ())) (cons (cons tuple? (cons (cons hd (cons (protect V1469) ())) ())) ()))) (cons (cons let (cons (protect W1471) (cons (cons list.find-trans (cons (cons fst (cons (cons hd (cons (protect V1469) ())) ())) (cons (cons snd (cons (cons hd (cons (protect V1469) ())) ())) (cons (protect V1470) ())))) (cons (cons union (cons (protect W1471) (cons (cons list.transitive-pass (cons (cons tl (cons (protect V1469) ())) (cons (protect V1470) ()))) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons list.transitive-pass ())) ())) ())))) ()))))) (do (shen.record-kl list.find-trans (cons defun (cons list.find-trans (cons (cons (protect V1481) (cons (protect V1482) (cons (protect V1483) ()))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1483) ()))) (cons () ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1483) ())) (cons (cons and (cons (cons tuple? (cons (cons hd (cons (protect V1483) ())) ())) (cons (cons = (cons (protect V1482) (cons (cons fst (cons (cons hd (cons (protect V1483) ())) ())) ()))) ()))) ()))) (cons (cons cons (cons (cons @p (cons (protect V1481) (cons (cons snd (cons (cons hd (cons (protect V1483) ())) ())) ()))) (cons (cons list.find-trans (cons (protect V1481) (cons (cons fst (cons (cons hd (cons (protect V1483) ())) ())) (cons (cons tl (cons (protect V1483) ())) ())))) ()))) ())) (cons (cons (cons cons? (cons (protect V1483) ())) (cons (cons list.find-trans (cons (protect V1481) (cons (protect V1482) (cons (cons tl (cons (protect V1483) ())) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons list.find-trans ())) ())) ()))))) ()))))) (do (shen.record-kl x->ascii (cons defun (cons x->ascii (cons (cons (protect V1488) ()) (cons (cons map (cons (cons lambda (cons (protect Z1489) (cons (cons string->n (cons (protect Z1489) ())) ()))) (cons (cons explode (cons (protect V1488) ())) ()))) ()))))) (do (shen.record-kl splice (cons defun (cons splice (cons (cons (protect V1491) (cons (protect V1492) (cons (protect V1493) ()))) (cons (cons cond (cons (cons (cons = (cons 1 (cons (protect V1491) ()))) (cons (cons append (cons (protect V1492) (cons (protect V1493) ()))) ())) (cons (cons (cons cons? (cons (protect V1493) ())) (cons (cons cons (cons (cons hd (cons (protect V1493) ())) (cons (cons splice (cons (cons - (cons (protect V1491) (cons 1 ()))) (cons (protect V1492) (cons (cons tl (cons (protect V1493) ())) ())))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons splice ())) ())) ())))) ()))))) (do (shen.record-kl string-macros (cons defun (cons string-macros (cons (cons (protect V1497) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V1497) ())) (cons (cons and (cons (cons = (cons s-op1 (cons (cons hd (cons (protect V1497) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1497) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V1497) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1497) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons s-op1 (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V1497) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V1497) ())) ())) ())) (cons (cons cons (cons (cons cons (cons /. (cons (cons cons (cons (protect X) (cons (cons cons (cons (protect X) (cons () ()))) ()))) ()))) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1497) ())) (cons (cons and (cons (cons = (cons s-op2 (cons (cons hd (cons (protect V1497) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1497) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V1497) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1497) ())) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1497) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons s-op2 (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V1497) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V1497) ())) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1497) ())) ())) ())) ())) (cons (cons cons (cons (cons cons (cons /. (cons (cons cons (cons (protect X) (cons (cons cons (cons (protect X) (cons () ()))) ()))) ()))) (cons () ()))) ()))) ()))) ()))) ()))) ())) (cons (cons true (cons (protect V1497) ())) ())))) ()))))) (do (shen.record-kl string->list (cons defun (cons string->list (cons (cons (protect V1587) ()) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1587) ()))) (cons () ())) (cons (cons true (cons (cons string.s->l-h (cons (protect V1587) (cons 1 (cons (cons pos (cons (protect V1587) (cons 0 ()))) (cons () ()))))) ())) ()))) ()))))) (do (shen.record-kl string.s->l-h (cons defun (cons string.s->l-h (cons (cons (protect V1589) (cons (protect V1590) (cons (protect V1591) (cons (protect V1592) ())))) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1591) ()))) (cons (cons reverse (cons (protect V1592) ())) ())) (cons (cons true (cons (cons string.s->l-h (cons (protect V1589) (cons (cons + (cons (protect V1590) (cons 1 ()))) (cons (cons trap-error (cons (cons pos (cons (protect V1589) (cons (protect V1590) ()))) (cons (cons lambda (cons (protect Z1593) (cons "" ()))) ()))) (cons (cons cons (cons (protect V1591) (cons (protect V1592) ()))) ()))))) ())) ()))) ()))))) (do (shen.record-kl list->string (cons defun (cons list->string (cons (cons (protect V1598) ()) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1598) ()))) (cons "" ())) (cons (cons (cons cons? (cons (protect V1598) ())) (cons (cons cn (cons (cons hd (cons (protect V1598) ())) (cons (cons list->string (cons (cons tl (cons (protect V1598) ())) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons list->string ())) ())) ())))) ()))))) (do (shen.record-kl s-op1 (cons defun (cons s-op1 (cons (cons (protect V1600) (cons (protect V1601) (cons (protect V1602) ()))) (cons (cons (protect V1602) (cons (cons (protect V1600) (cons (cons string->list (cons (protect V1601) ())) ())) ())) ()))))) (do (shen.record-kl s-op2 (cons defun (cons s-op2 (cons (cons (protect V1606) (cons (protect V1607) (cons (protect V1608) (cons (protect V1609) ())))) (cons (cons (protect V1609) (cons (cons (cons (protect V1606) (cons (cons string->list (cons (protect V1607) ())) ())) (cons (cons string->list (cons (protect V1608) ())) ())) ())) ()))))) (do (shen.record-kl string.count (cons defun (cons string.count (cons (cons (protect V1619) (cons (protect V1620) ())) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1620) ()))) (cons 0 ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V1620) ())) (cons (cons = (cons (protect V1619) (cons (cons hdstr (cons (protect V1620) ())) ()))) ()))) (cons (cons + (cons 1 (cons (cons string.count (cons (cons hdstr (cons (protect V1620) ())) (cons (cons tlstr (cons (protect V1620) ())) ()))) ()))) ())) (cons (cons (cons shen.+string? (cons (protect V1620) ())) (cons (cons string.count (cons (protect V1619) (cons (cons tlstr (cons (protect V1620) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons string.count ())) ())) ()))))) ()))))) (do (shen.record-kl string.reverse (cons defun (cons string.reverse (cons (cons (protect V1625) ()) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1626) (cons (cons reverse (cons (protect Z1626) ())) ()))) (cons (protect V1625) (cons (cons lambda (cons (protect Z1627) (cons (cons list->string (cons (protect Z1627) ())) ()))) ())))) ()))))) (do (shen.record-kl string.element? (cons defun (cons string.element? (cons (cons (protect V1629) (cons (protect V1630) ())) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1631) (cons (cons element? (cons (protect V1629) (cons (protect Z1631) ()))) ()))) (cons (protect V1630) (cons (cons lambda (cons (protect Z1632) (cons (protect Z1632) ()))) ())))) ()))))) (do (shen.record-kl string.prefix? (cons defun (cons string.prefix? (cons (cons (protect V1637) (cons (protect V1638) ())) (cons (cons s-op2 (cons (cons lambda (cons (protect Z1639) (cons (cons lambda (cons (protect Z1640) (cons (cons prefix? (cons (protect Z1639) (cons (protect Z1640) ()))) ()))) ()))) (cons (protect V1637) (cons (protect V1638) (cons (cons lambda (cons (protect Z1641) (cons (protect Z1641) ()))) ()))))) ()))))) (do (shen.record-kl string.infix? (cons defun (cons string.infix? (cons (cons (protect V1646) (cons (protect V1647) ())) (cons (cons s-op2 (cons (cons lambda (cons (protect Z1648) (cons (cons lambda (cons (protect Z1649) (cons (cons infix? (cons (protect Z1648) (cons (protect Z1649) ()))) ()))) ()))) (cons (protect V1646) (cons (protect V1647) (cons (cons lambda (cons (protect Z1650) (cons (protect Z1650) ()))) ()))))) ()))))) (do (shen.record-kl string.suffix? (cons defun (cons string.suffix? (cons (cons (protect V1655) (cons (protect V1656) ())) (cons (cons s-op2 (cons (cons lambda (cons (protect Z1657) (cons (cons lambda (cons (protect Z1658) (cons (cons suffix? (cons (protect Z1657) (cons (protect Z1658) ()))) ()))) ()))) (cons (protect V1655) (cons (protect V1656) (cons (cons lambda (cons (protect Z1659) (cons (protect Z1659) ()))) ()))))) ()))))) (do (shen.record-kl string.subset? (cons defun (cons string.subset? (cons (cons (protect V1664) (cons (protect V1665) ())) (cons (cons s-op2 (cons (cons lambda (cons (protect Z1666) (cons (cons lambda (cons (protect Z1667) (cons (cons subset? (cons (protect Z1666) (cons (protect Z1667) ()))) ()))) ()))) (cons (protect V1664) (cons (protect V1665) (cons (cons lambda (cons (protect Z1668) (cons (protect Z1668) ()))) ()))))) ()))))) (do (shen.record-kl string.set=? (cons defun (cons string.set=? (cons (cons (protect V1673) (cons (protect V1674) ())) (cons (cons s-op2 (cons (cons lambda (cons (protect Z1675) (cons (cons lambda (cons (protect Z1676) (cons (cons set=? (cons (protect Z1675) (cons (protect Z1676) ()))) ()))) ()))) (cons (protect V1673) (cons (protect V1674) (cons (cons lambda (cons (protect Z1677) (cons (protect Z1677) ()))) ()))))) ()))))) (do (shen.record-kl string.set? (cons defun (cons string.set? (cons (cons (protect V1681) ()) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1682) (cons (cons set? (cons (protect Z1682) ())) ()))) (cons (protect V1681) (cons (cons lambda (cons (protect Z1683) (cons (protect Z1683) ()))) ())))) ()))))) (do (shen.record-kl file-extension (cons defun (cons file-extension (cons (cons (protect V1685) (cons (protect V1686) ())) (cons (cons cn (cons (cons strip-extension (cons (protect V1685) ())) (cons (protect V1686) ()))) ()))))) (do (shen.record-kl strip-extension (cons defun (cons strip-extension (cons (cons (protect V1691) ()) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1691) ()))) (cons "" ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V1691) ())) (cons (cons = (cons "." (cons (cons hdstr (cons (protect V1691) ())) ()))) ()))) (cons "" ())) (cons (cons (cons shen.+string? (cons (protect V1691) ())) (cons (cons @s (cons (cons hdstr (cons (protect V1691) ())) (cons (cons strip-extension (cons (cons tlstr (cons (protect V1691) ())) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons strip-extension ())) ())) ()))))) ()))))) (do (shen.record-kl string.length (cons defun (cons string.length (cons (cons (protect V1694) ()) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1695) (cons (cons length (cons (protect Z1695) ())) ()))) (cons (protect V1694) (cons (cons lambda (cons (protect Z1696) (cons (protect Z1696) ()))) ())))) ()))))) (do (shen.record-kl string.trim (cons defun (cons string.trim (cons (cons (protect V1700) (cons (protect V1701) ())) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1702) (cons (cons trim (cons (protect V1700) (cons (protect Z1702) ()))) ()))) (cons (protect V1701) (cons (cons lambda (cons (protect Z1703) (cons (cons list->string (cons (protect Z1703) ())) ()))) ())))) ()))))) (do (shen.record-kl string.trim-if (cons defun (cons string.trim-if (cons (cons (protect V1708) (cons (protect V1709) ())) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1710) (cons (cons trim-if (cons (protect V1708) (cons (protect Z1710) ()))) ()))) (cons (protect V1709) (cons (cons lambda (cons (protect Z1711) (cons (cons list->string (cons (protect Z1711) ())) ()))) ())))) ()))))) (do (shen.record-kl string.trim-right-if (cons defun (cons string.trim-right-if (cons (cons (protect V1716) (cons (protect V1717) ())) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1718) (cons (cons trim-right-if (cons (protect V1716) (cons (protect Z1718) ()))) ()))) (cons (protect V1717) (cons (cons lambda (cons (protect Z1719) (cons (cons list->string (cons (protect Z1719) ())) ()))) ())))) ()))))) (do (shen.record-kl string.trim-left-if (cons defun (cons string.trim-left-if (cons (cons (protect V1724) (cons (protect V1725) ())) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1726) (cons (cons trim-left-if (cons (protect V1724) (cons (protect Z1726) ()))) ()))) (cons (protect V1725) (cons (cons lambda (cons (protect Z1727) (cons (cons list->string (cons (protect Z1727) ())) ()))) ())))) ()))))) (do (shen.record-kl string.trim-right (cons defun (cons string.trim-right (cons (cons (protect V1732) (cons (protect V1733) ())) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1734) (cons (cons trim-right (cons (protect V1732) (cons (protect Z1734) ()))) ()))) (cons (protect V1733) (cons (cons lambda (cons (protect Z1735) (cons (cons list->string (cons (protect Z1735) ())) ()))) ())))) ()))))) (do (shen.record-kl string.trim-left (cons defun (cons string.trim-left (cons (cons (protect V1740) (cons (protect V1741) ())) (cons (cons s-op1 (cons (cons lambda (cons (protect Z1742) (cons (cons trim-left (cons (protect V1740) (cons (protect Z1742) ()))) ()))) (cons (protect V1741) (cons (cons lambda (cons (protect Z1743) (cons (cons list->string (cons (protect Z1743) ())) ()))) ())))) ()))))) (do (shen.record-kl string.some? (cons defun (cons string.some? (cons (cons (protect V1748) (cons (protect V1749) ())) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1749) ()))) (cons false ())) (cons (cons (cons shen.+string? (cons (protect V1749) ())) (cons (cons or (cons (cons (protect V1748) (cons (cons hdstr (cons (protect V1749) ())) ())) (cons (cons string.some? (cons (protect V1748) (cons (cons tlstr (cons (protect V1749) ())) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons string.some? ())) ())) ())))) ()))))) (do (shen.record-kl string.every? (cons defun (cons string.every? (cons (cons (protect V1754) (cons (protect V1755) ())) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1755) ()))) (cons true ())) (cons (cons (cons shen.+string? (cons (protect V1755) ())) (cons (cons and (cons (cons (protect V1754) (cons (cons hdstr (cons (protect V1755) ())) ())) (cons (cons string.every? (cons (protect V1754) (cons (cons tlstr (cons (protect V1755) ())) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons string.every? ())) ())) ())))) ()))))) (do (shen.record-kl string.difference (cons defun (cons string.difference (cons (cons (protect V1761) (cons (protect V1762) ())) (cons (cons s-op2 (cons (cons lambda (cons (protect Z1763) (cons (cons lambda (cons (protect Z1764) (cons (cons difference (cons (protect Z1763) (cons (protect Z1764) ()))) ()))) ()))) (cons (protect V1761) (cons (protect V1762) (cons (cons lambda (cons (protect Z1765) (cons (cons list->string (cons (protect Z1765) ())) ()))) ()))))) ()))))) (do (shen.record-kl string.intersection (cons defun (cons string.intersection (cons (cons (protect V1771) (cons (protect V1772) ())) (cons (cons s-op2 (cons (cons lambda (cons (protect Z1773) (cons (cons lambda (cons (protect Z1774) (cons (cons intersection (cons (protect Z1773) (cons (protect Z1774) ()))) ()))) ()))) (cons (protect V1771) (cons (protect V1772) (cons (cons lambda (cons (protect Z1775) (cons (cons list->string (cons (protect Z1775) ())) ()))) ()))))) ()))))) (do (shen.record-kl string.nth (cons defun (cons string.nth (cons (cons (protect V1778) (cons (protect V1779) ())) (cons (cons pos (cons (protect V1779) (cons (cons + (cons (protect V1778) (cons 1 ()))) ()))) ()))))) (do (shen.record-kl whitespace? (cons defun (cons whitespace? (cons (cons (protect V1784) ()) (cons (cons cond (cons (cons (cons shen.+string? (cons (protect V1784) ())) (cons (cons let (cons (protect W1785) (cons (cons string->n (cons (cons hdstr (cons (protect V1784) ())) ())) (cons (cons element? (cons (protect W1785) (cons (cons cons (cons 9 (cons (cons cons (cons 10 (cons (cons cons (cons 13 (cons (cons cons (cons 32 (cons () ()))) ()))) ()))) ()))) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons whitespace? ())) ())) ()))) ()))))) (do (shen.record-kl uppercase? (cons defun (cons uppercase? (cons (cons (protect V1789) ()) (cons (cons cond (cons (cons (cons shen.+string? (cons (protect V1789) ())) (cons (cons let (cons (protect W1790) (cons (cons string->n (cons (cons hdstr (cons (protect V1789) ())) ())) (cons (cons and (cons (cons > (cons (protect W1790) (cons 64 ()))) (cons (cons < (cons (protect W1790) (cons 91 ()))) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons uppercase? ())) ())) ()))) ()))))) (do (shen.record-kl lowercase? (cons defun (cons lowercase? (cons (cons (protect V1794) ()) (cons (cons cond (cons (cons (cons shen.+string? (cons (protect V1794) ())) (cons (cons let (cons (protect W1795) (cons (cons string->n (cons (cons hdstr (cons (protect V1794) ())) ())) (cons (cons and (cons (cons > (cons (protect W1795) (cons 96 ()))) (cons (cons < (cons (protect W1795) (cons 123 ()))) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons lowercase? ())) ())) ()))) ()))))) (do (shen.record-kl digit? (cons defun (cons digit? (cons (cons (protect V1799) ()) (cons (cons cond (cons (cons (cons shen.+string? (cons (protect V1799) ())) (cons (cons let (cons (protect W1800) (cons (cons string->n (cons (cons hdstr (cons (protect V1799) ())) ())) (cons (cons and (cons (cons > (cons (protect W1800) (cons 47 ()))) (cons (cons < (cons (protect W1800) (cons 58 ()))) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons digit? ())) ())) ()))) ()))))) (do (shen.record-kl alpha? (cons defun (cons alpha? (cons (cons (protect V1806) ()) (cons (cons cond (cons (cons (cons shen.+string? (cons (protect V1806) ())) (cons (cons let (cons (protect W1807) (cons (cons string->n (cons (cons hdstr (cons (protect V1806) ())) ())) (cons (cons or (cons (cons and (cons (cons > (cons (protect W1807) (cons 64 ()))) (cons (cons < (cons (protect W1807) (cons 91 ()))) ()))) (cons (cons and (cons (cons > (cons (protect W1807) (cons 96 ()))) (cons (cons < (cons (protect W1807) (cons 123 ()))) ()))) ()))) ())))) ())) (cons (cons true (cons false ())) ()))) ()))))) (do (shen.record-kl alphanum? (cons defun (cons alphanum? (cons (cons (protect V1813) ()) (cons (cons cond (cons (cons (cons shen.+string? (cons (protect V1813) ())) (cons (cons let (cons (protect W1814) (cons (cons string->n (cons (cons hdstr (cons (protect V1813) ())) ())) (cons (cons or (cons (cons and (cons (cons > (cons (protect W1814) (cons 64 ()))) (cons (cons < (cons (protect W1814) (cons 91 ()))) ()))) (cons (cons or (cons (cons and (cons (cons > (cons (protect W1814) (cons 96 ()))) (cons (cons < (cons (protect W1814) (cons 123 ()))) ()))) (cons (cons and (cons (cons > (cons (protect W1814) (cons 47 ()))) (cons (cons < (cons (protect W1814) (cons 58 ()))) ()))) ()))) ()))) ())))) ())) (cons (cons true (cons false ())) ()))) ()))))) (do (shen.record-kl tokenise (cons defun (cons tokenise (cons (cons (protect V1816) (cons (protect V1817) ())) (cons (cons string.tokenise-h (cons (protect V1816) (cons (protect V1817) (cons "" ())))) ()))))) (do (shen.record-kl string.tokenise-h (cons defun (cons string.tokenise-h (cons (cons (protect V1822) (cons (protect V1823) (cons (protect V1824) ()))) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1823) ()))) (cons (cons cons (cons (protect V1824) (cons () ()))) ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V1823) ())) (cons (cons (protect V1822) (cons (cons hdstr (cons (protect V1823) ())) ())) ()))) (cons (cons cons (cons (protect V1824) (cons (cons string.tokenise-h (cons (protect V1822) (cons (cons tlstr (cons (protect V1823) ())) (cons "" ())))) ()))) ())) (cons (cons (cons shen.+string? (cons (protect V1823) ())) (cons (cons string.tokenise-h (cons (protect V1822) (cons (cons tlstr (cons (protect V1823) ())) (cons (cons @s (cons (protect V1824) (cons (cons hdstr (cons (protect V1823) ())) ()))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons string.tokenise-h ())) ())) ()))))) ()))))) (do (shen.record-kl uppercase (cons defun (cons uppercase (cons (cons (protect V1828) ()) (cons (cons cond (cons (cons (cons shen.+string? (cons (protect V1828) ())) (cons (cons if (cons (cons lowercase? (cons (cons hdstr (cons (protect V1828) ())) ())) (cons (cons @s (cons (cons n->string (cons (cons - (cons (cons string->n (cons (cons hdstr (cons (protect V1828) ())) ())) (cons 32 ()))) ())) (cons (cons tlstr (cons (protect V1828) ())) ()))) (cons (protect V1828) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons uppercase ())) ())) ()))) ()))))) (do (shen.record-kl lowercase (cons defun (cons lowercase (cons (cons (protect V1830) ()) (cons (cons cond (cons (cons (cons shen.+string? (cons (protect V1830) ())) (cons (cons if (cons (cons uppercase? (cons (cons hdstr (cons (protect V1830) ())) ())) (cons (cons @s (cons (cons n->string (cons (cons + (cons (cons string->n (cons (cons hdstr (cons (protect V1830) ())) ())) (cons 32 ()))) ())) (cons (cons tlstr (cons (protect V1830) ())) ()))) (cons (protect V1830) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons lowercase ())) ())) ()))) ()))))) (do (shen.record-kl string.map (cons defun (cons string.map (cons (cons (protect V1834) (cons (protect V1835) ())) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1835) ()))) (cons "" ())) (cons (cons (cons shen.+string? (cons (protect V1835) ())) (cons (cons @s (cons (cons (protect V1834) (cons (cons hdstr (cons (protect V1835) ())) ())) (cons (cons string.map (cons (protect V1834) (cons (cons tlstr (cons (protect V1835) ())) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons string.map ())) ())) ())))) ()))))) (do (shen.record-kl spell-number (cons defun (cons spell-number (cons (cons (protect V1839) ()) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V1839) ()))) (cons "zero" ())) (cons (cons true (cons (cons string.scale (cons (cons map (cons (cons lambda (cons (protect Z1840) (cons (cons string.digits (cons (protect Z1840) ())) ()))) (cons (cons string.triples (cons (cons explode (cons (protect V1839) ())) ())) ()))) ())) ())) ()))) ()))))) (do (shen.record-kl string.digit (cons defun (cons string.digit (cons (cons (protect V1842) ()) (cons (cons cond (cons (cons (cons = (cons "0" (cons (protect V1842) ()))) (cons "" ())) (cons (cons (cons = (cons "1" (cons (protect V1842) ()))) (cons "one" ())) (cons (cons (cons = (cons "2" (cons (protect V1842) ()))) (cons "two" ())) (cons (cons (cons = (cons "3" (cons (protect V1842) ()))) (cons "three" ())) (cons (cons (cons = (cons "4" (cons (protect V1842) ()))) (cons "four" ())) (cons (cons (cons = (cons "5" (cons (protect V1842) ()))) (cons "five" ())) (cons (cons (cons = (cons "6" (cons (protect V1842) ()))) (cons "six" ())) (cons (cons (cons = (cons "7" (cons (protect V1842) ()))) (cons "seven" ())) (cons (cons (cons = (cons "8" (cons (protect V1842) ()))) (cons "eight" ())) (cons (cons (cons = (cons "9" (cons (protect V1842) ()))) (cons "nine" ())) (cons (cons true (cons (cons shen.f-error (cons string.digit ())) ())) ())))))))))))) ()))))) (do (shen.record-kl string.triples (cons defun (cons string.triples (cons (cons (protect V1844) ()) (cons (cons string.triples-h (cons (cons reverse (cons (protect V1844) ())) (cons () ()))) ()))))) (do (shen.record-kl string.triples-h (cons defun (cons string.triples-h (cons (cons (protect V1846) (cons (protect V1847) ())) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V1846) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1846) ())) ())) (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V1846) ())) ())) ())) ()))) ()))) (cons (cons string.triples-h (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1846) ())) ())) ())) (cons (cons cons (cons (cons reverse (cons (cons cons (cons (cons hd (cons (protect V1846) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V1846) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V1846) ())) ())) ())) (cons () ()))) ()))) ()))) ())) (cons (protect V1847) ()))) ()))) ())) (cons (cons true (cons (cons cons (cons (cons reverse (cons (protect V1846) ())) (cons (protect V1847) ()))) ())) ()))) ()))))) (do (shen.record-kl string.digits (cons defun (cons string.digits (cons (cons (protect V1850) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V1850) ())) (cons (cons and (cons (cons = (cons "0" (cons (cons hd (cons (protect V1850) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1850) ())) ())) (cons (cons and (cons (cons = (cons "0" (cons (cons hd (cons (cons tl (cons (protect V1850) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) (cons (cons and (cons (cons = (cons "0" (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) (cons "" ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1850) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1850) ())) ())) (cons (cons and (cons (cons = (cons "0" (cons (cons hd (cons (cons tl (cons (protect V1850) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) (cons (cons and (cons (cons = (cons "0" (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons @s (cons (cons string.digit (cons (cons hd (cons (protect V1850) ())) ())) (cons (cons @s (cons " " (cons "hundred" ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1850) ())) (cons (cons and (cons (cons = (cons "0" (cons (cons hd (cons (protect V1850) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1850) ())) ())) (cons (cons and (cons (cons = (cons "0" (cons (cons hd (cons (cons tl (cons (protect V1850) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons @s (cons "a" (cons (cons @s (cons "n" (cons (cons @s (cons "d" (cons (cons @s (cons " " (cons (cons string.digit (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1850) ())) (cons (cons and (cons (cons = (cons "0" (cons (cons hd (cons (protect V1850) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1850) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons @s (cons "a" (cons (cons @s (cons "n" (cons (cons @s (cons "d" (cons (cons @s (cons " " (cons (cons string.tens (cons (cons hd (cons (cons tl (cons (protect V1850) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1850) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1850) ())) ())) (cons (cons and (cons (cons = (cons "0" (cons (cons hd (cons (cons tl (cons (protect V1850) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons @s (cons (cons string.digit (cons (cons hd (cons (protect V1850) ())) ())) (cons (cons @s (cons " " (cons (cons @s (cons "h" (cons (cons @s (cons "u" (cons (cons @s (cons "n" (cons (cons @s (cons "d" (cons (cons @s (cons "r" (cons (cons @s (cons "e" (cons (cons @s (cons "d" (cons (cons @s (cons " " (cons (cons @s (cons "a" (cons (cons @s (cons "n" (cons (cons @s (cons "d" (cons (cons @s (cons " " (cons (cons string.digit (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1850) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1850) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) ()))) ()))) ()))) (cons (cons @s (cons (cons string.digit (cons (cons hd (cons (protect V1850) ())) ())) (cons (cons @s (cons " " (cons (cons @s (cons "h" (cons (cons @s (cons "u" (cons (cons @s (cons "n" (cons (cons @s (cons "d" (cons (cons @s (cons "r" (cons (cons @s (cons "e" (cons (cons @s (cons "d" (cons (cons @s (cons " " (cons (cons @s (cons "a" (cons (cons @s (cons "n" (cons (cons @s (cons "d" (cons (cons @s (cons " " (cons (cons string.tens (cons (cons hd (cons (cons tl (cons (protect V1850) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1850) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V1850) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V1850) ())) ())) ()))) ()))) ()))) (cons (cons string.tens (cons (cons hd (cons (protect V1850) ())) (cons (cons hd (cons (cons tl (cons (protect V1850) ())) ())) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1850) ())) (cons (cons = (cons () (cons (cons tl (cons (protect V1850) ())) ()))) ()))) (cons (cons string.digit (cons (cons hd (cons (protect V1850) ())) ())) ())) (cons (cons (cons = (cons () (cons (protect V1850) ()))) (cons "" ())) (cons (cons true (cons (cons shen.f-error (cons string.digits ())) ())) ()))))))))))) ()))))) (do (shen.record-kl string.tens (cons defun (cons string.tens (cons (cons (protect V1852) (cons (protect V1853) ())) (cons (cons cond (cons (cons (cons = (cons "1" (cons (protect V1852) ()))) (cons (cons if (cons (cons = (cons (protect V1853) (cons "0" ()))) (cons "ten" (cons (cons if (cons (cons = (cons (protect V1853) (cons "1" ()))) (cons "eleven" (cons (cons if (cons (cons = (cons (protect V1853) (cons "2" ()))) (cons "twelve" (cons (cons if (cons (cons = (cons (protect V1853) (cons "3" ()))) (cons "thirteen" (cons (cons if (cons (cons = (cons (protect V1853) (cons "4" ()))) (cons "fourteen" (cons (cons if (cons (cons = (cons (protect V1853) (cons "5" ()))) (cons "fifteen" (cons (cons if (cons (cons = (cons (protect V1853) (cons "6" ()))) (cons "sixteen" (cons (cons if (cons (cons = (cons (protect V1853) (cons "7" ()))) (cons "seventeen" (cons (cons if (cons (cons = (cons (protect V1853) (cons "8" ()))) (cons "eighteen" (cons (cons if (cons (cons = (cons (protect V1853) (cons "9" ()))) (cons "nineteen" (cons (cons simple-error (cons "error: cases exhausted" ())) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())) (cons (cons (cons = (cons "2" (cons (protect V1852) ()))) (cons (cons @s (cons "t" (cons (cons @s (cons "w" (cons (cons @s (cons "e" (cons (cons @s (cons "n" (cons (cons @s (cons "t" (cons (cons @s (cons "y" (cons (cons @s (cons " " (cons (cons string.digit (cons (protect V1853) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons = (cons "3" (cons (protect V1852) ()))) (cons (cons @s (cons "t" (cons (cons @s (cons "h" (cons (cons @s (cons "i" (cons (cons @s (cons "r" (cons (cons @s (cons "t" (cons (cons @s (cons "y" (cons (cons @s (cons " " (cons (cons string.digit (cons (protect V1853) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons = (cons "4" (cons (protect V1852) ()))) (cons (cons @s (cons "f" (cons (cons @s (cons "o" (cons (cons @s (cons "r" (cons (cons @s (cons "t" (cons (cons @s (cons "y" (cons (cons @s (cons " " (cons (cons string.digit (cons (protect V1853) ())) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons = (cons "5" (cons (protect V1852) ()))) (cons (cons @s (cons "f" (cons (cons @s (cons "i" (cons (cons @s (cons "f" (cons (cons @s (cons "t" (cons (cons @s (cons "y" (cons (cons @s (cons " " (cons (cons string.digit (cons (protect V1853) ())) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons = (cons "6" (cons (protect V1852) ()))) (cons (cons @s (cons "s" (cons (cons @s (cons "i" (cons (cons @s (cons "x" (cons (cons @s (cons "t" (cons (cons @s (cons "y" (cons (cons @s (cons " " (cons (cons string.digit (cons (protect V1853) ())) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons = (cons "7" (cons (protect V1852) ()))) (cons (cons @s (cons "s" (cons (cons @s (cons "e" (cons (cons @s (cons "v" (cons (cons @s (cons "e" (cons (cons @s (cons "n" (cons (cons @s (cons "t" (cons (cons @s (cons "y" (cons (cons @s (cons " " (cons (cons string.digit (cons (protect V1853) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons = (cons "8" (cons (protect V1852) ()))) (cons (cons @s (cons "e" (cons (cons @s (cons "i" (cons (cons @s (cons "g" (cons (cons @s (cons "h" (cons (cons @s (cons "t" (cons (cons @s (cons "y" (cons (cons @s (cons " " (cons (cons string.digit (cons (protect V1853) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons (cons = (cons "9" (cons (protect V1852) ()))) (cons (cons @s (cons "n" (cons (cons @s (cons "i" (cons (cons @s (cons "n" (cons (cons @s (cons "e" (cons (cons @s (cons "t" (cons (cons @s (cons "y" (cons (cons @s (cons " " (cons (cons string.digit (cons (protect V1853) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons string.tens ())) ())) ()))))))))))) ()))))) (do (shen.record-kl string.scale (cons defun (cons string.scale (cons (cons (protect V1856) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V1856) ())) (cons (cons = (cons () (cons (cons tl (cons (protect V1856) ())) ()))) ()))) (cons (cons hd (cons (protect V1856) ())) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V1856) ())) (cons (cons = (cons "" (cons (cons hd (cons (protect V1856) ())) ()))) ()))) (cons (cons string.scale (cons (cons tl (cons (protect V1856) ())) ())) ())) (cons (cons (cons cons? (cons (protect V1856) ())) (cons (cons @s (cons (cons hd (cons (protect V1856) ())) (cons (cons @s (cons (cons string.units (cons (cons length (cons (protect V1856) ())) ())) (cons (cons string.scale (cons (cons tl (cons (protect V1856) ())) ())) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons string.scale ())) ())) ()))))) ()))))) (do (shen.record-kl string.units (cons defun (cons string.units (cons (cons (protect V1860) ()) (cons (cons cond (cons (cons (cons = (cons 2 (cons (protect V1860) ()))) (cons " thousand " ())) (cons (cons (cons = (cons 3 (cons (protect V1860) ()))) (cons " million " ())) (cons (cons (cons = (cons 4 (cons (protect V1860) ()))) (cons " billion " ())) (cons (cons (cons = (cons 5 (cons (protect V1860) ()))) (cons " trillion " ())) (cons (cons true (cons (cons simple-error (cons "this number has a magnitude beyond our text representation" ())) ())) ())))))) ()))))) (do (shen.record-kl string>? (cons defun (cons string>? (cons (cons (protect V1866) (cons (protect V1867) ())) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1866) ()))) (cons false ())) (cons (cons (cons = (cons "" (cons (protect V1867) ()))) (cons true ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V1866) ())) (cons (cons shen.+string? (cons (protect V1867) ())) ()))) (cons (cons let (cons (protect W1868) (cons (cons string->n (cons (cons hdstr (cons (protect V1866) ())) ())) (cons (cons let (cons (protect W1869) (cons (cons string->n (cons (cons hdstr (cons (protect V1867) ())) ())) (cons (cons if (cons (cons > (cons (protect W1868) (cons (protect W1869) ()))) (cons true (cons (cons if (cons (cons < (cons (protect W1868) (cons (protect W1869) ()))) (cons false (cons (cons string>? (cons (cons tlstr (cons (protect V1866) ())) (cons (cons tlstr (cons (protect V1867) ())) ()))) ())))) ())))) ())))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons string>? ())) ())) ()))))) ()))))) (do (shen.record-kl stringn (cons (cons hdstr (cons (protect V1876) ())) ())) (cons (cons let (cons (protect W1879) (cons (cons string->n (cons (cons hdstr (cons (protect V1877) ())) ())) (cons (cons if (cons (cons < (cons (protect W1878) (cons (protect W1879) ()))) (cons true (cons (cons if (cons (cons > (cons (protect W1878) (cons (protect W1879) ()))) (cons false (cons (cons string=? (cons defun (cons string>=? (cons (cons (protect V1882) (cons (protect V1883) ())) (cons (cons or (cons (cons = (cons (protect V1882) (cons (protect V1883) ()))) (cons (cons string>? (cons (protect V1882) (cons (protect V1883) ()))) ()))) ()))))) (do (shen.record-kl string<=? (cons defun (cons string<=? (cons (cons (protect V1886) (cons (protect V1887) ())) (cons (cons or (cons (cons = (cons (protect V1886) (cons (protect V1887) ()))) (cons (cons stringstrings (cons (protect W1900) (cons () ()))) (cons (cons let (cons (protect W1902) (cons (cons compile (cons (cons fn (cons string. ())) (cons (protect W1901) ()))) (cons (cons let (cons (protect W1903) (cons (cons file-extension (cons (protect V1898) (cons (protect V1899) ()))) (cons (cons let (cons (protect W1904) (cons (cons write-to-file (cons (protect W1903) (cons (protect W1902) ()))) (cons (protect W1903) ())))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl string.bytes->strings (cons defun (cons string.bytes->strings (cons (cons (protect V1907) (cons (protect V1908) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1907) ()))) (cons (cons reverse (cons (protect V1908) ())) ())) (cons (cons (cons cons? (cons (protect V1907) ())) (cons (cons string.bytes->strings (cons (cons tl (cons (protect V1907) ())) (cons (cons cons (cons (cons n->string (cons (cons hd (cons (protect V1907) ())) ())) (cons (protect V1908) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons string.bytes->strings ())) ())) ())))) ()))))) (do (shen.record-kl render (cons defun (cons render (cons (cons (protect V1911) ()) (cons (cons compile (cons (cons fn (cons string. ())) (cons (cons string->list (cons (protect V1911) ())) ()))) ()))))) (do (shen.record-kl string.rendered? (cons defun (cons string.rendered? (cons (cons (protect V1917) ()) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V1917) ()))) (cons true ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V1917) ())) (cons (cons = (cons "{" (cons (cons hdstr (cons (protect V1917) ())) ()))) ()))) (cons false ())) (cons (cons (cons shen.+string? (cons (protect V1917) ())) (cons (cons string.rendered? (cons (cons tlstr (cons (protect V1917) ())) ())) ())) (cons (cons true (cons (cons shen.f-error (cons string.rendered? ())) ())) ()))))) ()))))) (do (shen.record-kl string. (cons defun (cons string. (cons (cons (protect V1924) ()) (cons (cons let (cons (protect W1925) (cons (cons if (cons (cons shen.hds=? (cons (protect V1924) (cons "{" ()))) (cons (cons let (cons (protect W1926) (cons (cons tail (cons (protect V1924) ())) (cons (cons let (cons (protect W1927) (cons (cons (cons fn (cons string. ())) (cons (protect W1926) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1927) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1928) (cons (cons shen.<-out (cons (protect W1927) ())) (cons (cons let (cons (protect W1929) (cons (cons shen.in-> (cons (protect W1927) ())) (cons (cons let (cons (protect W1930) (cons (cons (cons fn (cons string. ())) (cons (protect W1929) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1930) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1931) (cons (cons shen.in-> (cons (protect W1930) ())) (cons (cons let (cons (protect W1932) (cons (cons (cons fn (cons string. ())) (cons (protect W1931) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1932) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1933) (cons (cons shen.<-out (cons (protect W1932) ())) (cons (cons let (cons (protect W1934) (cons (cons shen.in-> (cons (protect W1932) ())) (cons (cons if (cons (cons shen.hds=? (cons (protect W1934) (cons "}" ()))) (cons (cons let (cons (protect W1935) (cons (cons tail (cons (protect W1934) ())) (cons (cons let (cons (protect W1936) (cons (cons (cons fn (cons string. ())) (cons (protect W1935) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1936) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1937) (cons (cons shen.<-out (cons (protect W1936) ())) (cons (cons let (cons (protect W1938) (cons (cons shen.in-> (cons (protect W1936) ())) (cons (cons shen.comb (cons (protect W1938) (cons (cons cn (cons (cons string.recapply (cons (cons fn (cons (cons intern (cons (protect W1928) ())) ())) (cons (protect W1933) ()))) (cons (protect W1937) ()))) ()))) ())))) ())))) ())))) ())))) ())))) (cons (cons shen.parse-failure ()) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) (cons (cons shen.parse-failure ()) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1925) ())) (cons (cons let (cons (protect W1939) (cons (cons if (cons (cons shen.hds=? (cons (protect V1924) (cons "{" ()))) (cons (cons let (cons (protect W1940) (cons (cons tail (cons (protect V1924) ())) (cons (cons let (cons (protect W1941) (cons (cons (cons fn (cons string. ())) (cons (protect W1940) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1941) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1942) (cons (cons shen.<-out (cons (protect W1941) ())) (cons (cons let (cons (protect W1943) (cons (cons shen.in-> (cons (protect W1941) ())) (cons (cons if (cons (cons shen.hds=? (cons (protect W1943) (cons "}" ()))) (cons (cons let (cons (protect W1944) (cons (cons tail (cons (protect W1943) ())) (cons (cons let (cons (protect W1945) (cons (cons (cons fn (cons string. ())) (cons (protect W1944) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1945) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1946) (cons (cons shen.<-out (cons (protect W1945) ())) (cons (cons let (cons (protect W1947) (cons (cons shen.in-> (cons (protect W1945) ())) (cons (cons shen.comb (cons (protect W1947) (cons (cons cn (cons (cons (cons intern (cons (protect W1942) ())) ()) (cons (protect W1946) ()))) ()))) ())))) ())))) ())))) ())))) ())))) (cons (cons shen.parse-failure ()) ())))) ())))) ())))) ())))) ())))) ())))) (cons (cons shen.parse-failure ()) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1939) ())) (cons (cons let (cons (protect W1948) (cons (cons let (cons (protect W1949) (cons (cons (cons fn (cons string. ())) (cons (protect V1924) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1949) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1950) (cons (cons shen.<-out (cons (protect W1949) ())) (cons (cons let (cons (protect W1951) (cons (cons shen.in-> (cons (protect W1949) ())) (cons (cons let (cons (protect W1952) (cons (cons (cons fn (cons string. ())) (cons (protect W1951) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1952) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1953) (cons (cons shen.<-out (cons (protect W1952) ())) (cons (cons let (cons (protect W1954) (cons (cons shen.in-> (cons (protect W1952) ())) (cons (cons shen.comb (cons (protect W1954) (cons (cons cn (cons (protect W1950) (cons (protect W1953) ()))) ()))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1948) ())) (cons (cons let (cons (protect W1955) (cons (cons let (cons (protect W1956) (cons (cons (cons (protect V1924) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1956) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1957) (cons (cons shen.in-> (cons (protect W1956) ())) (cons (cons shen.comb (cons (protect W1957) (cons "" ()))) ())))) ())))) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1955) ())) (cons (cons shen.parse-failure ()) (cons (protect W1955) ())))) ())))) (cons (protect W1948) ())))) ())))) (cons (protect W1939) ())))) ())))) (cons (protect W1925) ())))) ())))) ()))))) (do (shen.record-kl string. (cons defun (cons string. (cons (cons (protect V1961) ()) (cons (cons let (cons (protect W1962) (cons (cons if (cons (cons cons? (cons (protect V1961) ())) (cons (cons let (cons (protect W1963) (cons (cons head (cons (protect V1961) ())) (cons (cons let (cons (protect W1964) (cons (cons tail (cons (protect V1961) ())) (cons (cons if (cons (cons and (cons (cons not (cons (cons = (cons (protect W1963) (cons "}" ()))) ())) (cons (cons not (cons (cons = (cons (protect W1963) (cons "\" ()))) ())) ()))) (cons (cons shen.comb (cons (protect W1964) (cons (protect W1963) ()))) (cons (cons shen.parse-failure ()) ())))) ())))) ())))) (cons (cons shen.parse-failure ()) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1962) ())) (cons (cons shen.parse-failure ()) (cons (protect W1962) ())))) ())))) ()))))) (do (shen.record-kl string.recapply (cons defun (cons string.recapply (cons (cons (protect V1966) (cons (protect V1967) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V1967) ()))) (cons (protect V1966) ())) (cons (cons (cons cons? (cons (protect V1967) ())) (cons (cons string.recapply (cons (cons (protect V1966) (cons (cons hd (cons (protect V1967) ())) ())) (cons (cons tl (cons (protect V1967) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons string.recapply ())) ())) ())))) ()))))) (do (shen.record-kl string. (cons defun (cons string. (cons (cons (protect V1972) ()) (cons (cons let (cons (protect W1973) (cons (cons let (cons (protect W1974) (cons (cons (cons fn (cons string. ())) (cons (protect V1972) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1974) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1975) (cons (cons shen.<-out (cons (protect W1974) ())) (cons (cons let (cons (protect W1976) (cons (cons shen.in-> (cons (protect W1974) ())) (cons (cons if (cons (cons shen.hds=? (cons (protect W1976) (cons "\" ()))) (cons (cons let (cons (protect W1977) (cons (cons tail (cons (protect W1976) ())) (cons (cons let (cons (protect W1978) (cons (cons (cons fn (cons string. ())) (cons (protect W1977) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1978) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1979) (cons (cons shen.<-out (cons (protect W1978) ())) (cons (cons let (cons (protect W1980) (cons (cons shen.in-> (cons (protect W1978) ())) (cons (cons shen.comb (cons (protect W1980) (cons (cons cons (cons (protect W1975) (cons (protect W1979) ()))) ()))) ())))) ())))) ())))) ())))) ())))) (cons (cons shen.parse-failure ()) ())))) ())))) ())))) ())))) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1973) ())) (cons (cons let (cons (protect W1981) (cons (cons let (cons (protect W1982) (cons (cons (cons fn (cons string. ())) (cons (protect V1972) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1982) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1983) (cons (cons shen.<-out (cons (protect W1982) ())) (cons (cons let (cons (protect W1984) (cons (cons shen.in-> (cons (protect W1982) ())) (cons (cons shen.comb (cons (protect W1984) (cons (cons cons (cons (protect W1983) (cons () ()))) ()))) ())))) ())))) ())))) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1981) ())) (cons (cons shen.parse-failure ()) (cons (protect W1981) ())))) ())))) (cons (protect W1973) ())))) ())))) ()))))) (do (shen.record-kl string. (cons defun (cons string. (cons (cons (protect V1987) ()) (cons (cons let (cons (protect W1988) (cons (cons let (cons (protect W1989) (cons (cons string. (cons (protect V1987) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1989) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W1990) (cons (cons shen.<-out (cons (protect W1989) ())) (cons (cons let (cons (protect W1991) (cons (cons shen.in-> (cons (protect W1989) ())) (cons (cons shen.comb (cons (protect W1991) (cons (protect W1990) ()))) ())))) ())))) ())))) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1988) ())) (cons (cons shen.parse-failure ()) (cons (protect W1988) ())))) ())))) ()))))) (do (shen.record-kl string. (cons defun (cons string. (cons (cons (protect V1995) ()) (cons (cons let (cons (protect W1996) (cons (cons if (cons (cons cons? (cons (protect V1995) ())) (cons (cons let (cons (protect W1997) (cons (cons head (cons (protect V1995) ())) (cons (cons let (cons (protect W1998) (cons (cons tail (cons (protect V1995) ())) (cons (cons if (cons (cons and (cons (cons not (cons (cons = (cons (protect W1997) (cons "}" ()))) ())) (cons (cons not (cons (cons = (cons (protect W1997) (cons "\" ()))) ())) ()))) (cons (cons shen.comb (cons (protect W1998) (cons (protect W1997) ()))) (cons (cons shen.parse-failure ()) ())))) ())))) ())))) (cons (cons shen.parse-failure ()) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W1996) ())) (cons (cons shen.parse-failure ()) (cons (protect W1996) ())))) ())))) ()))))) (do (shen.record-kl string. (cons defun (cons string. (cons (cons (protect V2002) ()) (cons (cons let (cons (protect W2003) (cons (cons if (cons (cons cons? (cons (protect V2002) ())) (cons (cons let (cons (protect W2004) (cons (cons head (cons (protect V2002) ())) (cons (cons let (cons (protect W2005) (cons (cons tail (cons (protect V2002) ())) (cons (cons if (cons (cons whitespace? (cons (protect W2004) ())) (cons (cons shen.comb (cons (protect W2005) (cons string.skip ()))) (cons (cons shen.parse-failure ()) ())))) ())))) ())))) (cons (cons shen.parse-failure ()) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W2003) ())) (cons (cons shen.parse-failure ()) (cons (protect W2003) ())))) ())))) ()))))) (do (shen.record-kl string. (cons defun (cons string. (cons (cons (protect V2008) ()) (cons (cons let (cons (protect W2009) (cons (cons let (cons (protect W2010) (cons (cons (cons fn (cons string. ())) (cons (protect V2008) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W2010) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W2011) (cons (cons shen.<-out (cons (protect W2010) ())) (cons (cons let (cons (protect W2012) (cons (cons shen.in-> (cons (protect W2010) ())) (cons (cons let (cons (protect W2013) (cons (cons (cons fn (cons string. ())) (cons (protect W2012) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W2013) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W2014) (cons (cons shen.<-out (cons (protect W2013) ())) (cons (cons let (cons (protect W2015) (cons (cons shen.in-> (cons (protect W2013) ())) (cons (cons shen.comb (cons (protect W2015) (cons (cons cn (cons (protect W2011) (cons (protect W2014) ()))) ()))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W2009) ())) (cons (cons let (cons (protect W2016) (cons (cons let (cons (protect W2017) (cons (cons (cons (protect V2008) ())) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W2017) ())) (cons (cons shen.parse-failure ()) (cons (cons let (cons (protect W2018) (cons (cons shen.in-> (cons (protect W2017) ())) (cons (cons shen.comb (cons (protect W2018) (cons "" ()))) ())))) ())))) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W2016) ())) (cons (cons shen.parse-failure ()) (cons (protect W2016) ())))) ())))) (cons (protect W2009) ())))) ())))) ()))))) (do (shen.record-kl string. (cons defun (cons string. (cons (cons (protect V2022) ()) (cons (cons let (cons (protect W2023) (cons (cons if (cons (cons cons? (cons (protect V2022) ())) (cons (cons let (cons (protect W2024) (cons (cons head (cons (protect V2022) ())) (cons (cons let (cons (protect W2025) (cons (cons tail (cons (protect V2022) ())) (cons (cons if (cons (cons and (cons (cons not (cons (cons = (cons (protect W2024) (cons "}" ()))) ())) (cons (cons and (cons (cons not (cons (cons = (cons (protect W2024) (cons "\" ()))) ())) (cons (cons not (cons (cons whitespace? (cons (protect W2024) ())) ())) ()))) ()))) (cons (cons shen.comb (cons (protect W2025) (cons (protect W2024) ()))) (cons (cons shen.parse-failure ()) ())))) ())))) ())))) (cons (cons shen.parse-failure ()) ())))) (cons (cons if (cons (cons shen.parse-failure? (cons (protect W2023) ())) (cons (cons shen.parse-failure ()) (cons (protect W2023) ())))) ())))) ()))))) (do (shen.record-kl vector.vector-macros (cons defun (cons vector.vector-macros (cons (cons (protect V2049) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2049) ())) (cons (cons and (cons (cons = (cons := (cons (cons hd (cons (protect V2049) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons vector.<-array (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2049) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons and (cons (cons = (cons := (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons vector.key (cons (cons hd (cons (protect V2049) ())) (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons vector.array-> (cons (cons hd (cons (protect V2049) ())) (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons vector.<-array (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ())) ()))) ())))) (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ())) ()))))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2049) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons and (cons (cons = (cons := (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ()))) (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ()))) ()))) ()))) ()))) (cons (cons vector.key (cons (cons hd (cons (protect V2049) ())) (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons vector.array-> (cons (cons hd (cons (protect V2049) ())) (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ())))) (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ()))))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2049) ())) (cons (cons and (cons (cons = (cons vector.array-> (cons (cons hd (cons (protect V2049) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons vector.array-> (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ())))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2049) ())) (cons (cons and (cons (cons = (cons array (cons (cons hd (cons (protect V2049) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ()))) ()))) ()))) ()))) (cons (cons vector.build-array (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2049) ())) (cons (cons and (cons (cons = (cons populate (cons (cons hd (cons (protect V2049) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ())) ())) (cons (cons and (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons vector.unfold-populate (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2049) ())) (cons (cons and (cons (cons = (cons vector->list (cons (cons hd (cons (protect V2049) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons vector->list (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons cons (cons () (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2049) ())) (cons (cons and (cons (cons = (cons v-op1 (cons (cons hd (cons (protect V2049) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons v-op1 (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons cons (cons () (cons () ()))) ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2049) ())) (cons (cons and (cons (cons = (cons v-op2 (cons (cons hd (cons (protect V2049) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons v-op2 (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2049) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2049) ())) ())) ())) ())) (cons (cons cons (cons () (cons () ()))) ()))) ()))) ()))) ()))) ())) (cons (cons true (cons (protect V2049) ())) ()))))))))))) ()))))) (do (shen.record-kl vector.key (cons defun (cons vector.key (cons (cons (protect V2065) (cons (protect V2066) (cons (protect V2067) (cons (protect V2068) ())))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V2068) ()))) (cons (protect V2067) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2068) ())) (cons (cons and (cons (cons = (cons error (cons (cons hd (cons (protect V2068) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (protect V2068) ())) ()))) ()))) ()))) (cons (protect V2067) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2068) ())) (cons (cons and (cons (cons = (cons ignore (cons (cons hd (cons (protect V2068) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (protect V2068) ())) ()))) ()))) ()))) (cons (cons cons (cons trap-error (cons (cons cons (cons (protect V2067) (cons (cons cons (cons (cons cons (cons /. (cons (cons cons (cons (cons newv ()) (cons (cons cons (cons (protect V2065) (cons () ()))) ()))) ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2068) ())) (cons (cons and (cons (cons = (cons insert (cons (cons hd (cons (protect V2068) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2068) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V2068) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons trap-error (cons (cons cons (cons (protect V2067) (cons (cons cons (cons (cons cons (cons /. (cons (cons cons (cons (cons newv ()) (cons (cons cons (cons (cons cons (cons (protect V2065) (cons (cons cons (cons (protect V2066) (cons (cons cons (cons := (cons (cons tl (cons (protect V2068) ())) ()))) ()))) ()))) (cons () ()))) ()))) ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2068) ())) (cons (cons and (cons (cons = (cons overwrite (cons (cons hd (cons (protect V2068) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (protect V2068) ())) ()))) ()))) ()))) (cons (cons cons (cons trap-error (cons (cons cons (cons (protect V2067) (cons (cons cons (cons (cons cons (cons /. (cons (cons cons (cons (cons newv ()) (cons (cons cons (cons (cons cons (cons depopulate (cons (cons cons (cons (protect V2065) (cons (cons cons (cons (protect V2066) (cons () ()))) ()))) ()))) (cons () ()))) ()))) ()))) (cons () ()))) ()))) ()))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "key not recognised " (cons (cons shen.app (cons (protect V2068) (cons " -" (cons shen.a ())))) ()))) ())) ())) ()))))))) ()))))) (do (shen.record-kl vector.build-array (cons defun (cons vector.build-array (cons (cons (protect V2073) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2073) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (protect V2073) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2073) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2073) ())) ())) ())) (cons (cons and (cons (cons = (cons () (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2073) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2073) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons vector (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2073) ())) ())) (cons () ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2073) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (protect V2073) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2073) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2073) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2073) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons let (cons (protect W2074) (cons (cons newv ()) (cons (cons let (cons (protect W2075) (cons (cons newv ()) (cons (cons cons (cons let (cons (cons cons (cons (protect W2075) (cons (cons cons (cons (cons cons (cons vector (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2073) ())) ())) (cons () ()))) ()))) (cons (cons cons (cons (cons cons (cons for (cons (cons cons (cons (protect W2074) (cons (cons cons (cons = (cons (cons cons (cons 1 (cons (cons cons (cons (cons cons (cons <= (cons (cons cons (cons (protect W2074) (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2073) ())) ())) (cons () ()))) ()))) ()))) (cons (cons cons (cons (cons cons (cons vector-> (cons (cons cons (cons (protect W2075) (cons (cons cons (cons (protect W2074) (cons (cons cons (cons (cons vector.build-array (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2073) ())) ())) ())) ())) (cons () ()))) ()))) ()))) ()))) (cons () ()))) ()))) ()))) ()))) ()))) ()))) (cons () ()))) ()))) ()))) ()))) ())))) ())))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "array cannot macro expand the dimensional argument " (cons (cons shen.app (cons (protect V2073) (cons " -" (cons shen.r ())))) ()))) ())) ())) ())))) ()))))) (do (shen.record-kl depopulate (cons defun (cons depopulate (cons (cons (protect V2079) (cons (protect V2080) ())) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2080) ())) (cons (cons = (cons () (cons (cons tl (cons (protect V2080) ())) ()))) ()))) (cons (cons address-> (cons (protect V2079) (cons (cons hd (cons (protect V2080) ())) (cons (cons fail ()) ())))) ())) (cons (cons (cons cons? (cons (protect V2080) ())) (cons (cons do (cons (cons depopulate (cons (cons <-vector (cons (protect V2079) (cons (cons hd (cons (protect V2080) ())) ()))) (cons (cons tl (cons (protect V2080) ())) ()))) (cons (protect V2079) ()))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "depopulate cannot use the dimensional argument " (cons (cons shen.app (cons (protect V2080) (cons " -" (cons shen.s ())))) ()))) ())) ())) ())))) ()))))) (do (shen.record-kl populated? (cons defun (cons populated? (cons (cons (protect V2083) (cons (protect V2084) ())) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2084) ())) (cons (cons = (cons () (cons (cons tl (cons (protect V2084) ())) ()))) ()))) (cons (cons not (cons (cons = (cons (cons <-address (cons (protect V2083) (cons (cons hd (cons (protect V2084) ())) ()))) (cons (cons fail ()) ()))) ())) ())) (cons (cons (cons cons? (cons (protect V2084) ())) (cons (cons populated? (cons (cons <-address (cons (protect V2083) (cons (cons hd (cons (protect V2084) ())) ()))) (cons (cons tl (cons (protect V2084) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons populated? ())) ())) ())))) ()))))) (do (shen.record-kl vector.unfold-populate (cons defun (cons vector.unfold-populate (cons (cons (protect V2087) (cons (protect V2088) ())) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2088) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (protect V2088) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2088) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2088) ())) ())) ())) (cons (cons and (cons (cons = (cons () (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2088) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2088) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons populate (cons (cons cons (cons (protect V2087) (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2088) ())) ())) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2088) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (protect V2088) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2088) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2088) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2088) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons populate (cons (cons cons (cons (cons cons (cons /. (cons (cons cons (cons (cons newv ()) (cons (cons cons (cons (cons vector.unfold-populate (cons (protect V2087) (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2088) ())) ())) ())) ()))) (cons () ()))) ()))) ()))) (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2088) ())) ())) (cons () ()))) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons vector.unfold-populate ())) ())) ())))) ()))))) (do (shen.record-kl populate (cons defun (cons populate (cons (cons (protect V2094) (cons (protect V2095) ())) (cons (cons let (cons (protect W2096) (cons (cons absvector (cons (cons + (cons (protect V2095) (cons 1 ()))) ())) (cons (cons let (cons (protect W2097) (cons (cons address-> (cons (protect W2096) (cons 0 (cons (protect V2095) ())))) (cons (cons for (cons 1 (cons (cons lambda (cons (protect Z2098) (cons (cons <= (cons (protect Z2098) (cons (protect V2095) ()))) ()))) (cons (cons lambda (cons (protect Z2099) (cons (cons address-> (cons (protect W2096) (cons (protect Z2099) (cons (cons (protect V2094) (cons (protect Z2099) ())) ())))) ()))) (cons (cons lambda (cons (protect Z2100) (cons (cons + (cons 1 (cons (protect Z2100) ()))) ()))) (cons (cons lambda (cons (protect Z2101) (cons (cons lambda (cons (protect Z2102) (cons (cons do (cons (protect Z2101) (cons (protect Z2102) ()))) ()))) ()))) ())))))) ())))) ())))) ()))))) (do (shen.record-kl vector.<-array (cons defun (cons vector.<-array (cons (cons (protect V2107) (cons (protect V2108) ())) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2108) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (protect V2108) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2108) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2108) ())) ())) ())) (cons (cons and (cons (cons = (cons () (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2108) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2108) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons <-vector (cons (cons cons (cons (protect V2107) (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2108) ())) ())) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2108) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (protect V2108) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2108) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2108) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2108) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons vector.<-array (cons (cons cons (cons <-vector (cons (cons cons (cons (protect V2107) (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2108) ())) ())) (cons () ()))) ()))) ()))) (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2108) ())) ())) ())) ()))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "cannot macro expand the dimensional argument " (cons (cons shen.app (cons (protect V2108) (cons " -" (cons shen.r ())))) ()))) ())) ())) ())))) ()))))) (do (shen.record-kl vector.array-> (cons defun (cons vector.array-> (cons (cons (protect V2111) (cons (protect V2112) (cons (protect V2113) ()))) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2112) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (protect V2112) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2112) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2112) ())) ())) ())) (cons (cons and (cons (cons = (cons () (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2112) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2112) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons cons (cons vector-> (cons (cons cons (cons (protect V2111) (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2112) ())) ())) (cons (cons cons (cons (protect V2113) (cons () ()))) ()))) ()))) ()))) ())) (cons (cons true (cons (cons let (cons (protect W2114) (cons (cons newv ()) (cons (cons cons (cons let (cons (cons cons (cons (protect W2114) (cons (cons cons (cons (protect V2111) (cons (cons cons (cons (cons vector.unfold-vector-assignment (cons (protect W2114) (cons (protect W2114) (cons (protect V2112) (cons (protect V2113) ()))))) (cons () ()))) ()))) ()))) ()))) ())))) ())) ()))) ()))))) (do (shen.record-kl vector.unfold-vector-assignment (cons defun (cons vector.unfold-vector-assignment (cons (cons (protect V2124) (cons (protect V2125) (cons (protect V2126) (cons (protect V2127) ())))) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2126) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (protect V2126) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2126) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2126) ())) ())) ())) (cons (cons and (cons (cons = (cons () (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2126) ())) ())) ())) ()))) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2126) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons let (cons (protect W2128) (cons (cons newv ()) (cons (cons cons (cons let (cons (cons cons (cons (protect W2128) (cons (cons cons (cons (cons cons (cons vector-> (cons (cons cons (cons (protect V2125) (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2126) ())) ())) (cons (cons cons (cons (protect V2127) (cons () ()))) ()))) ()))) ()))) (cons (cons cons (cons (protect V2124) (cons () ()))) ()))) ()))) ()))) ())))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2126) ())) (cons (cons and (cons (cons = (cons cons (cons (cons hd (cons (protect V2126) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2126) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2126) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2126) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) (cons (cons let (cons (protect W2129) (cons (cons newv ()) (cons (cons cons (cons let (cons (cons cons (cons (protect W2129) (cons (cons cons (cons (cons cons (cons <-vector (cons (cons cons (cons (protect V2125) (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2126) ())) ())) (cons () ()))) ()))) ()))) (cons (cons cons (cons (cons vector.unfold-vector-assignment (cons (protect V2124) (cons (protect W2129) (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2126) ())) ())) ())) (cons (protect V2127) ()))))) (cons () ()))) ()))) ()))) ()))) ())))) ())) (cons (cons true (cons (cons simple-error (cons (cons cn (cons "cannot macro expand the dimensional argument " (cons (cons shen.app (cons (protect V2126) (cons " -" (cons shen.r ())))) ()))) ())) ())) ())))) ()))))) (do (shen.record-kl compress (cons defun (cons compress (cons (cons (protect V2168) ()) (cons (cons list->vector (cons (cons vector->list (cons (protect V2168) (cons () ()))) ())) ()))))) (do (shen.record-kl vector.copy (cons defun (cons vector.copy (cons (cons (protect V2174) ()) (cons (cons let (cons (protect W2175) (cons (cons limit (cons (protect V2174) ())) (cons (cons let (cons (protect W2176) (cons (cons vector (cons (protect W2175) ())) (cons (cons for (cons 1 (cons (cons lambda (cons (protect Z2177) (cons (cons <= (cons (protect Z2177) (cons (protect W2175) ()))) ()))) (cons (cons lambda (cons (protect Z2178) (cons (cons trap-error (cons (cons vector-> (cons (protect W2176) (cons (protect Z2178) (cons (cons <-vector (cons (protect V2174) (cons (protect Z2178) ()))) ())))) (cons (cons lambda (cons (protect Z2179) (cons (cons depopulate (cons (protect W2176) (cons (cons cons (cons (protect Z2178) (cons () ()))) ()))) ()))) ()))) ()))) (cons (cons lambda (cons (protect Z2180) (cons (cons + (cons 1 (cons (protect Z2180) ()))) ()))) (cons (cons lambda (cons (protect Z2181) (cons (cons lambda (cons (protect Z2182) (cons (cons do (cons (protect Z2181) (cons (protect Z2182) ()))) ()))) ()))) ())))))) ())))) ())))) ()))))) (do (shen.record-kl vector.reverse (cons defun (cons vector.reverse (cons (cons (protect V2187) ()) (cons (cons let (cons (protect W2188) (cons (cons limit (cons (protect V2187) ())) (cons (cons let (cons (protect W2189) (cons (cons vector (cons (protect W2188) ())) (cons (cons let (cons (protect W2190) (cons (cons for (cons (protect W2188) (cons (cons lambda (cons (protect Z2191) (cons (cons > (cons (protect Z2191) (cons 0 ()))) ()))) (cons (cons lambda (cons (protect Z2192) (cons (cons trap-error (cons (cons vector-> (cons (protect W2189) (cons (protect Z2192) (cons (cons <-vector (cons (protect V2187) (cons (cons + (cons 1 (cons (cons - (cons (protect W2188) (cons (protect Z2192) ()))) ()))) ()))) ())))) (cons (cons lambda (cons (protect Z2193) (cons (cons depopulate (cons (protect W2189) (cons (cons cons (cons (protect Z2192) (cons () ()))) ()))) ()))) ()))) ()))) (cons (cons lambda (cons (protect Z2194) (cons (cons - (cons (protect Z2194) (cons 1 ()))) ()))) (cons (cons lambda (cons (protect Z2195) (cons (cons lambda (cons (protect Z2196) (cons (cons do (cons (protect Z2195) (cons (protect Z2196) ()))) ()))) ()))) ())))))) (cons (protect W2189) ())))) ())))) ())))) ()))))) (do (shen.record-kl vector.append (cons defun (cons vector.append (cons (cons (protect V2206) (cons (protect V2207) ())) (cons (cons let (cons (protect W2208) (cons (cons limit (cons (protect V2206) ())) (cons (cons let (cons (protect W2209) (cons (cons limit (cons (protect V2207) ())) (cons (cons let (cons (protect W2210) (cons (cons + (cons (protect W2208) (cons (protect W2209) ()))) (cons (cons let (cons (protect W2211) (cons (cons vector (cons (protect W2210) ())) (cons (cons let (cons (protect W2212) (cons (cons for (cons 1 (cons (cons lambda (cons (protect Z2213) (cons (cons <= (cons (protect Z2213) (cons (protect W2208) ()))) ()))) (cons (cons lambda (cons (protect Z2214) (cons (cons trap-error (cons (cons vector-> (cons (protect W2211) (cons (protect Z2214) (cons (cons <-vector (cons (protect V2206) (cons (protect Z2214) ()))) ())))) (cons (cons lambda (cons (protect Z2215) (cons (cons depopulate (cons (protect W2211) (cons (cons cons (cons (protect Z2214) (cons () ()))) ()))) ()))) ()))) ()))) (cons (cons lambda (cons (protect Z2216) (cons (cons + (cons 1 (cons (protect Z2216) ()))) ()))) (cons (cons lambda (cons (protect Z2217) (cons (cons lambda (cons (protect Z2218) (cons (cons do (cons (protect Z2217) (cons (protect Z2218) ()))) ()))) ()))) ())))))) (cons (cons let (cons (protect W2219) (cons (cons for (cons (cons + (cons (protect W2208) (cons 1 ()))) (cons (cons lambda (cons (protect Z2220) (cons (cons <= (cons (protect Z2220) (cons (protect W2210) ()))) ()))) (cons (cons lambda (cons (protect Z2221) (cons (cons trap-error (cons (cons vector-> (cons (protect W2211) (cons (protect Z2221) (cons (cons <-vector (cons (protect V2207) (cons (protect Z2221) ()))) ())))) (cons (cons lambda (cons (protect Z2222) (cons (cons depopulate (cons (protect W2211) (cons (cons cons (cons (protect Z2221) (cons () ()))) ()))) ()))) ()))) ()))) (cons (cons lambda (cons (protect Z2223) (cons (cons + (cons 1 (cons (protect Z2223) ()))) ()))) (cons (cons lambda (cons (protect Z2224) (cons (cons lambda (cons (protect Z2225) (cons (cons do (cons (protect Z2224) (cons (protect Z2225) ()))) ()))) ()))) ())))))) (cons (protect W2211) ())))) ())))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl vector.dfilter (cons defun (cons vector.dfilter (cons (cons (protect V2231) (cons (protect V2232) ())) (cons (cons let (cons (protect W2233) (cons (cons limit (cons (protect V2232) ())) (cons (cons let (cons (protect W2234) (cons (cons for (cons 1 (cons (cons lambda (cons (protect Z2235) (cons (cons <= (cons (protect Z2235) (cons (protect W2233) ()))) ()))) (cons (cons lambda (cons (protect Z2236) (cons (cons if (cons (cons and (cons (cons populated? (cons (protect V2232) (cons (cons cons (cons (protect Z2236) (cons () ()))) ()))) (cons (cons (protect V2231) (cons (cons <-vector (cons (protect V2232) (cons (protect Z2236) ()))) ())) ()))) (cons (cons vector-> (cons (protect V2232) (cons (protect Z2236) (cons (cons <-vector (cons (protect V2232) (cons (protect Z2236) ()))) ())))) (cons (cons depopulate (cons (protect V2232) (cons (cons cons (cons (protect Z2236) (cons () ()))) ()))) ())))) ()))) (cons (cons lambda (cons (protect Z2237) (cons (cons + (cons 1 (cons (protect Z2237) ()))) ()))) (cons (cons lambda (cons (protect Z2238) (cons (cons lambda (cons (protect Z2239) (cons (cons do (cons (protect Z2238) (cons (protect Z2239) ()))) ()))) ()))) ())))))) (cons (protect V2232) ())))) ())))) ()))))) (do (shen.record-kl vector.element? (cons defun (cons vector.element? (cons (cons (protect V2243) (cons (protect V2244) ())) (cons (cons let (cons (protect W2245) (cons (cons limit (cons (protect V2244) ())) (cons (cons let (cons (protect W2246) (cons (cons maths.lazyfor-or (cons 1 (cons (cons lambda (cons (protect Z2247) (cons (cons <= (cons (protect Z2247) (cons (protect W2245) ()))) ()))) (cons (cons lambda (cons (protect Z2248) (cons (cons if (cons (cons populated? (cons (protect V2244) (cons (cons cons (cons (protect Z2248) (cons () ()))) ()))) (cons (cons = (cons (protect V2243) (cons (cons <-vector (cons (protect V2244) (cons (protect Z2248) ()))) ()))) (cons false ())))) ()))) (cons (cons lambda (cons (protect Z2249) (cons (cons + (cons 1 (cons (protect Z2249) ()))) ()))) ()))))) (cons (protect W2246) ())))) ())))) ()))))) (do (shen.record-kl vector.map (cons defun (cons vector.map (cons (cons (protect V2256) (cons (protect V2257) ())) (cons (cons let (cons (protect W2258) (cons (cons limit (cons (protect V2257) ())) (cons (cons let (cons (protect W2259) (cons (cons vector (cons (protect W2258) ())) (cons (cons let (cons (protect W2260) (cons (cons for (cons 1 (cons (cons lambda (cons (protect Z2261) (cons (cons <= (cons (protect Z2261) (cons (protect W2258) ()))) ()))) (cons (cons lambda (cons (protect Z2262) (cons (cons if (cons (cons populated? (cons (protect V2257) (cons (cons cons (cons (protect Z2262) (cons () ()))) ()))) (cons (cons vector-> (cons (protect W2259) (cons (protect Z2262) (cons (cons (protect V2256) (cons (cons <-vector (cons (protect V2257) (cons (protect Z2262) ()))) ())) ())))) (cons (cons trap-error (cons (cons vector-> (cons (protect W2259) (cons (protect Z2262) (cons (cons <-vector (cons (protect W2259) (cons (protect Z2262) ()))) ())))) (cons (cons lambda (cons (protect Z2263) (cons (cons depopulate (cons (protect W2259) (cons (cons cons (cons (protect Z2262) (cons () ()))) ()))) ()))) ()))) ())))) ()))) (cons (cons lambda (cons (protect Z2264) (cons (cons + (cons 1 (cons (protect Z2264) ()))) ()))) (cons (cons lambda (cons (protect Z2265) (cons (cons lambda (cons (protect Z2266) (cons (cons do (cons (protect Z2265) (cons (protect Z2266) ()))) ()))) ()))) ())))))) (cons (protect W2259) ())))) ())))) ())))) ()))))) (do (shen.record-kl vector.dmap (cons defun (cons vector.dmap (cons (cons (protect V2273) (cons (protect V2274) ())) (cons (cons let (cons (protect W2275) (cons (cons limit (cons (protect V2274) ())) (cons (cons let (cons (protect W2276) (cons (cons for (cons 1 (cons (cons lambda (cons (protect Z2277) (cons (cons <= (cons (protect Z2277) (cons (protect W2275) ()))) ()))) (cons (cons lambda (cons (protect Z2278) (cons (cons if (cons (cons populated? (cons (protect V2274) (cons (cons cons (cons (protect Z2278) (cons () ()))) ()))) (cons (cons vector-> (cons (protect V2274) (cons (protect Z2278) (cons (cons (protect V2273) (cons (cons <-vector (cons (protect V2274) (cons (protect Z2278) ()))) ())) ())))) (cons (cons trap-error (cons (cons vector-> (cons (protect V2274) (cons (protect Z2278) (cons (cons <-vector (cons (protect V2274) (cons (protect Z2278) ()))) ())))) (cons (cons lambda (cons (protect Z2279) (cons (cons depopulate (cons (protect V2274) (cons (cons cons (cons (protect Z2278) (cons () ()))) ()))) ()))) ()))) ())))) ()))) (cons (cons lambda (cons (protect Z2280) (cons (cons + (cons 1 (cons (protect Z2280) ()))) ()))) (cons (cons lambda (cons (protect Z2281) (cons (cons lambda (cons (protect Z2282) (cons (cons do (cons (protect Z2281) (cons (protect Z2282) ()))) ()))) ()))) ())))))) (cons (protect V2274) ())))) ())))) ()))))) (do (shen.record-kl vector.every? (cons defun (cons vector.every? (cons (cons (protect V2286) (cons (protect V2287) ())) (cons (cons let (cons (protect W2288) (cons (cons limit (cons (protect V2287) ())) (cons (cons let (cons (protect W2289) (cons (cons maths.lazyfor-and (cons 1 (cons (cons lambda (cons (protect Z2290) (cons (cons <= (cons (protect Z2290) (cons (protect W2288) ()))) ()))) (cons (cons lambda (cons (protect Z2291) (cons (cons if (cons (cons populated? (cons (protect V2287) (cons (cons cons (cons (protect Z2291) (cons () ()))) ()))) (cons (cons (protect V2286) (cons (cons <-vector (cons (protect V2287) (cons (protect Z2291) ()))) ())) (cons true ())))) ()))) (cons (cons lambda (cons (protect Z2292) (cons (cons + (cons 1 (cons (protect Z2292) ()))) ()))) ()))))) (cons (protect W2289) ())))) ())))) ()))))) (do (shen.record-kl vector.some? (cons defun (cons vector.some? (cons (cons (protect V2296) (cons (protect V2297) ())) (cons (cons let (cons (protect W2298) (cons (cons limit (cons (protect V2297) ())) (cons (cons let (cons (protect W2299) (cons (cons maths.lazyfor-or (cons 1 (cons (cons lambda (cons (protect Z2300) (cons (cons <= (cons (protect Z2300) (cons (protect W2298) ()))) ()))) (cons (cons lambda (cons (protect Z2301) (cons (cons if (cons (cons populated? (cons (protect V2297) (cons (cons cons (cons (protect Z2301) (cons () ()))) ()))) (cons (cons (protect V2296) (cons (cons <-vector (cons (protect V2297) (cons (protect Z2301) ()))) ())) (cons false ())))) ()))) (cons (cons lambda (cons (protect Z2302) (cons (cons + (cons 1 (cons (protect Z2302) ()))) ()))) ()))))) (cons (protect W2299) ())))) ())))) ()))))) (do (shen.record-kl vector->list (cons defun (cons vector->list (cons (cons (protect V2308) (cons (protect V2309) ())) (cons (cons for (cons 1 (cons (cons lambda (cons (protect Z2310) (cons (cons <= (cons (protect Z2310) (cons (cons limit (cons (protect V2308) ())) ()))) ()))) (cons (cons lambda (cons (protect Z2311) (cons (cons if (cons (cons populated? (cons (protect V2308) (cons (cons cons (cons (protect Z2311) (cons () ()))) ()))) (cons (cons cons (cons (cons <-vector (cons (protect V2308) (cons (protect Z2311) ()))) (cons () ()))) (cons (protect V2309) ())))) ()))) (cons (cons lambda (cons (protect Z2312) (cons (cons + (cons 1 (cons (protect Z2312) ()))) ()))) (cons (cons lambda (cons (protect Z2313) (cons (cons lambda (cons (protect Z2314) (cons (cons append (cons (protect Z2313) (cons (protect Z2314) ()))) ()))) ()))) ())))))) ()))))) (do (shen.record-kl list->vector (cons defun (cons list->vector (cons (cons (protect V2317) ()) (cons (cons vector.list->vector-h (cons (protect V2317) (cons 1 (cons (cons vector (cons (cons length (cons (protect V2317) ())) ())) ())))) ()))))) (do (shen.record-kl vector.list->vector-h (cons defun (cons vector.list->vector-h (cons (cons (protect V2321) (cons (protect V2322) (cons (protect V2323) ()))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V2321) ()))) (cons (protect V2323) ())) (cons (cons (cons cons? (cons (protect V2321) ())) (cons (cons vector.list->vector-h (cons (cons tl (cons (protect V2321) ())) (cons (cons + (cons (protect V2322) (cons 1 ()))) (cons (cons vector-> (cons (protect V2323) (cons (protect V2322) (cons (cons hd (cons (protect V2321) ())) ())))) ())))) ())) (cons (cons true (cons (cons shen.f-error (cons vector.list->vector-h ())) ())) ())))) ()))))) (do (shen.record-kl vacant? (cons defun (cons vacant? (cons (cons (protect V2328) ()) (cons (cons maths.lazyfor-and (cons 1 (cons (cons lambda (cons (protect Z2329) (cons (cons <= (cons (protect Z2329) (cons (cons limit (cons (protect V2328) ())) ()))) ()))) (cons (cons lambda (cons (protect Z2330) (cons (cons not (cons (cons populated? (cons (protect V2328) (cons (cons cons (cons (protect Z2330) (cons () ()))) ()))) ())) ()))) (cons (cons lambda (cons (protect Z2331) (cons (cons + (cons 1 (cons (protect Z2331) ()))) ()))) ()))))) ()))))) (do (shen.record-kl dense? (cons defun (cons dense? (cons (cons (protect V2334) ()) (cons (cons maths.lazyfor-and (cons 1 (cons (cons lambda (cons (protect Z2335) (cons (cons <= (cons (protect Z2335) (cons (cons limit (cons (protect V2334) ())) ()))) ()))) (cons (cons lambda (cons (protect Z2336) (cons (cons populated? (cons (protect V2334) (cons (cons cons (cons (protect Z2336) (cons () ()))) ()))) ()))) (cons (cons lambda (cons (protect Z2337) (cons (cons + (cons 1 (cons (protect Z2337) ()))) ()))) ()))))) ()))))) (do (shen.record-kl porous? (cons defun (cons porous? (cons (cons (protect V2340) ()) (cons (cons maths.lazyfor-or (cons 1 (cons (cons lambda (cons (protect Z2341) (cons (cons <= (cons (protect Z2341) (cons (cons limit (cons (protect V2340) ())) ()))) ()))) (cons (cons lambda (cons (protect Z2342) (cons (cons not (cons (cons populated? (cons (protect V2340) (cons (cons cons (cons (protect Z2342) (cons () ()))) ()))) ())) ()))) (cons (cons lambda (cons (protect Z2343) (cons (cons + (cons 1 (cons (protect Z2343) ()))) ()))) ()))))) ()))))) (do (shen.record-kl sparse? (cons defun (cons sparse? (cons (cons (protect V2348) ()) (cons (cons let (cons (protect W2349) (cons (cons limit (cons (protect V2348) ())) (cons (cons let (cons (protect W2350) (cons (cons for (cons 1 (cons (cons lambda (cons (protect Z2351) (cons (cons <= (cons (protect Z2351) (cons (cons limit (cons (protect V2348) ())) ()))) ()))) (cons (cons lambda (cons (protect Z2352) (cons (cons if (cons (cons populated? (cons (protect V2348) (cons (cons cons (cons (protect Z2352) (cons () ()))) ()))) (cons 1 (cons 0 ())))) ()))) (cons (cons lambda (cons (protect Z2353) (cons (cons + (cons 1 (cons (protect Z2353) ()))) ()))) (cons (cons lambda (cons (protect Z2354) (cons (cons lambda (cons (protect Z2355) (cons (cons + (cons (protect Z2354) (cons (protect Z2355) ()))) ()))) ()))) ())))))) (cons (cons let (cons (protect W2356) (cons (cons - (cons (protect W2349) (cons (protect W2350) ()))) (cons (cons > (cons (protect W2356) (cons (protect W2350) ()))) ())))) ())))) ())))) ()))))) (do (shen.record-kl v-op1 (cons defun (cons v-op1 (cons (cons (protect V2358) (cons (protect V2359) (cons (protect V2360) ()))) (cons (cons list->vector (cons (cons (protect V2358) (cons (cons vector->list (cons (protect V2359) (cons (protect V2360) ()))) ())) ())) ()))))) (do (shen.record-kl v-op2 (cons defun (cons v-op2 (cons (cons (protect V2364) (cons (protect V2365) (cons (protect V2366) (cons (protect V2367) ())))) (cons (cons list->vector (cons (cons (cons (protect V2364) (cons (cons vector->list (cons (protect V2365) (cons (protect V2367) ()))) ())) (cons (cons vector->list (cons (protect V2366) (cons (protect V2367) ()))) ())) ())) ()))))) (do (shen.record-kl print.pprint-macro (cons defun (cons print.pprint-macro (cons (cons (protect V2453) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2453) ())) (cons (cons and (cons (cons = (cons pprint (cons (cons hd (cons (protect V2453) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2453) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V2453) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons pprint (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2453) ())) ())) (cons (cons cons (cons (cons cons (cons stoutput (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2453) ())) (cons (cons and (cons (cons = (cons pps (cons (cons hd (cons (protect V2453) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2453) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (protect V2453) ())) ())) ()))) ()))) ()))) ()))) (cons (cons cons (cons pps (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2453) ())) ())) (cons (cons cons (cons (cons cons (cons stoutput (cons () ()))) (cons () ()))) ()))) ()))) ())) (cons (cons true (cons (protect V2453) ())) ())))) ()))))) (do (shen.record-kl linelength (cons defun (cons linelength (cons () (cons (cons value (cons print.*linelength* ())) ()))))) (do (shen.record-kl indentation (cons defun (cons indentation (cons () (cons (cons value (cons print.*indentation* ())) ()))))) (do (shen.record-kl set-linelength (cons defun (cons set-linelength (cons (cons (protect V2455) ()) (cons (cons cond (cons (cons (cons and (cons (cons positive? (cons (protect V2455) ())) (cons (cons integer? (cons (protect V2455) ())) ()))) (cons (cons set (cons print.*linelength* (cons (protect V2455) ()))) ())) (cons (cons true (cons (cons simple-error (cons "line length must be a positive integer -" ())) ())) ()))) ()))))) (do (shen.record-kl set-indentation (cons defun (cons set-indentation (cons (cons (protect V2457) ()) (cons (cons cond (cons (cons (cons and (cons (cons positive? (cons (protect V2457) ())) (cons (cons integer? (cons (protect V2457) ())) ()))) (cons (cons set (cons print.*indentation* (cons (protect V2457) ()))) ())) (cons (cons true (cons (cons simple-error (cons "indentation must be a positive integer -" ())) ())) ()))) ()))))) (do (shen.record-kl pps (cons defun (cons pps (cons (cons (protect V2459) (cons (protect V2460) ())) (cons (cons let (cons (protect W2461) (cons (cons ps (cons (protect V2459) ())) (cons (cons let (cons (protect W2462) (cons (cons shen.app (cons (protect W2461) (cons "" (cons shen.r ())))) (cons (cons let (cons (protect W2463) (cons (cons pretty-string (cons (protect W2462) ())) (cons (cons let (cons (protect W2464) (cons (cons pr (cons (protect W2463) (cons (protect V2460) ()))) (cons (cons let (cons (protect W2465) (cons (cons nl (cons 1 ())) (cons (protect V2459) ())))) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl pprint (cons defun (cons pprint (cons (cons (protect V2468) (cons (protect V2469) ())) (cons (cons let (cons (protect W2470) (cons (cons shen.app (cons (protect V2468) (cons "" (cons shen.s ())))) (cons (cons let (cons (protect W2471) (cons (cons pretty-string (cons (protect W2470) ())) (cons (cons let (cons (protect W2472) (cons (cons pr (cons (protect W2471) (cons (protect V2469) ()))) (cons (cons let (cons (protect W2473) (cons (cons nl (cons 1 ())) (cons (protect V2468) ())))) ())))) ())))) ())))) ()))))) (do (shen.record-kl pretty-string (cons defun (cons pretty-string (cons (cons (protect V2476) ()) (cons (cons print.pretty-string-h (cons (protect V2476) (cons 0 (cons 0 ())))) ()))))) (do (shen.record-kl print.pretty-string-h (cons defun (cons print.pretty-string-h (cons (cons (protect V2482) (cons (protect V2483) (cons (protect V2484) ()))) (cons (cons cond (cons (cons (cons = (cons "" (cons (protect V2482) ()))) (cons "" ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V2482) ())) (cons (cons = (cons "[" (cons (cons hdstr (cons (protect V2482) ())) ()))) ()))) (cons (cons @s (cons (cons print.indent (cons (protect V2483) ())) (cons (cons @s (cons "[" (cons (cons print.pretty-string-h (cons (cons tlstr (cons (protect V2482) ())) (cons (cons + (cons (protect V2483) (cons 1 ()))) (cons 0 ())))) ()))) ()))) ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V2482) ())) (cons (cons = (cons "(" (cons (cons hdstr (cons (protect V2482) ())) ()))) ()))) (cons (cons @s (cons (cons print.indent (cons (protect V2483) ())) (cons (cons @s (cons "(" (cons (cons print.pretty-string-h (cons (cons tlstr (cons (protect V2482) ())) (cons (cons + (cons (protect V2483) (cons 1 ()))) (cons 0 ())))) ()))) ()))) ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V2482) ())) (cons (cons = (cons "]" (cons (cons hdstr (cons (protect V2482) ())) ()))) ()))) (cons (cons @s (cons "]" (cons (cons print.pretty-string-h (cons (cons tlstr (cons (protect V2482) ())) (cons (cons - (cons (protect V2483) (cons 1 ()))) (cons 0 ())))) ()))) ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V2482) ())) (cons (cons = (cons ")" (cons (cons hdstr (cons (protect V2482) ())) ()))) ()))) (cons (cons @s (cons ")" (cons (cons print.pretty-string-h (cons (cons tlstr (cons (protect V2482) ())) (cons (cons - (cons (protect V2483) (cons 1 ()))) (cons 0 ())))) ()))) ())) (cons (cons (cons and (cons (cons shen.+string? (cons (protect V2482) ())) (cons (cons and (cons (cons = (cons " " (cons (cons hdstr (cons (protect V2482) ())) ()))) (cons (cons > (cons (protect V2484) (cons (cons linelength ()) ()))) ()))) ()))) (cons (cons @s (cons (cons print.indent (cons (protect V2483) ())) (cons (cons print.pretty-string-h (cons (cons tlstr (cons (protect V2482) ())) (cons (protect V2483) (cons 0 ())))) ()))) ())) (cons (cons (cons shen.+string? (cons (protect V2482) ())) (cons (cons @s (cons (cons hdstr (cons (protect V2482) ())) (cons (cons print.pretty-string-h (cons (cons tlstr (cons (protect V2482) ())) (cons (protect V2483) (cons (cons + (cons (protect V2484) (cons 1 ()))) ())))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons print.pretty-string-h ())) ())) ()))))))))) ()))))) (do (shen.record-kl print.indent (cons defun (cons print.indent (cons (cons (protect V2488) ()) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V2488) ()))) (cons "" ())) (cons (cons true (cons (cons @s (cons " -" (cons (cons print.indent-h (cons (protect V2488) ())) ()))) ())) ()))) ()))))) (do (shen.record-kl print.indent-h (cons defun (cons print.indent-h (cons (cons (protect V2490) ()) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V2490) ()))) (cons "" ())) (cons (cons true (cons (cons cn (cons (cons print.n-space (cons (cons indentation ()) ())) (cons (cons print.indent-h (cons (cons - (cons (protect V2490) (cons 1 ()))) ())) ()))) ())) ()))) ()))))) (do (shen.record-kl print.n-space (cons defun (cons print.n-space (cons (cons (protect V2492) ()) (cons (cons cond (cons (cons (cons = (cons 0 (cons (protect V2492) ()))) (cons "" ())) (cons (cons true (cons (cons cn (cons " " (cons (cons print.n-space (cons (cons - (cons (protect V2492) (cons 1 ()))) ())) ()))) ())) ()))) ()))))) (do (shen.record-kl delete-file (cons defun (cons delete-file (cons (cons (protect V2495) ()) (cons (cons if (cons (cons = (cons (cons language ()) (cons "Common Lisp" ()))) (cons (cons (cons fn (cons lisp.delete-file ())) (cons (protect V2495) ())) (cons (cons close (cons (cons open (cons (protect V2495) (cons out ()))) ())) ())))) ()))))) (do (shen.record-kl file.file-macro (cons defun (cons file.file-macro (cons (cons (protect V2523) ()) (cons (cons cond (cons (cons (cons and (cons (cons cons? (cons (protect V2523) ())) (cons (cons and (cons (cons = (cons errout (cons (cons hd (cons (protect V2523) ())) ()))) (cons (cons and (cons (cons cons? (cons (cons tl (cons (protect V2523) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (protect V2523) ())) ())) ())) (cons (cons and (cons (cons cons? (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2523) ())) ())) ())) ())) (cons (cons = (cons () (cons (cons tl (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2523) ())) ())) ())) ())) ()))) ()))) ()))) ()))) ()))) ()))) (cons (cons let (cons (protect W2524) (cons (cons newv ()) (cons (cons let (cons (protect W2525) (cons (cons newv ()) (cons (cons let (cons (protect W2526) (cons (cons newv ()) (cons (cons let (cons (protect W2527) (cons (cons newv ()) (cons (cons let (cons (protect W2528) (cons (cons newv ()) (cons (cons cons (cons trap-error (cons (cons cons (cons (cons hd (cons (cons tl (cons (protect V2523) ())) ())) (cons (cons cons (cons (cons cons (cons /. (cons (cons cons (cons (protect W2528) (cons (cons cons (cons (cons cons (cons let (cons (cons cons (cons (protect W2524) (cons (cons cons (cons (cons cons (cons error-to-string (cons (cons cons (cons (protect W2528) (cons () ()))) ()))) (cons (cons cons (cons (protect W2525) (cons (cons cons (cons (cons cons (cons trap-error (cons (cons cons (cons (cons cons (cons reopen (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2523) ())) ())) ())) ()))) (cons (cons cons (cons (cons cons (cons /. (cons (cons cons (cons (protect W2528) (cons (cons cons (cons (cons cons (cons open (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (cons tl (cons (protect V2523) ())) ())) ())) ())) (cons (cons cons (cons out (cons () ()))) ()))) ()))) (cons () ()))) ()))) ()))) (cons () ()))) ()))) ()))) (cons (cons cons (cons (protect W2526) (cons (cons cons (cons (cons cons (cons pr (cons (cons cons (cons (protect W2524) (cons (cons cons (cons (protect W2525) (cons () ()))) ()))) ()))) (cons (cons cons (cons (protect W2527) (cons (cons cons (cons (cons cons (cons close (cons (cons cons (cons (protect W2525) (cons () ()))) ()))) (cons (cons cons (cons (cons hd (cons (cons tl (cons (cons tl (cons (protect V2523) ())) ())) ())) (cons () ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) ()))) (cons () ()))) ()))) ()))) (cons () ()))) ()))) ()))) ())))) ())))) ())))) ())))) ())))) ())) (cons (cons true (cons (protect V2523) ())) ()))) ()))))) (do (shen.record-kl append-files (cons defun (cons append-files (cons (cons (protect V2530) (cons (protect V2531) ())) (cons (cons let (cons (protect W2532) (cons (cons append-files-with-open-stream (cons (protect V2530) (cons (protect V2531) ()))) (cons (cons let (cons (protect W2533) (cons (cons close (cons (protect W2532) ())) (cons (protect V2531) ())))) ())))) ()))))) (do (shen.record-kl append-files-with-open-stream (cons defun (cons append-files-with-open-stream (cons (cons (protect V2536) (cons (protect V2537) ())) (cons (cons cond (cons (cons (cons element? (cons (protect V2537) (cons (protect V2536) ()))) (cons (cons simple-error (cons (cons cn (cons "cannot read and write to " (cons (cons shen.app (cons (protect V2537) (cons " at the same time -" (cons shen.a ())))) ()))) ())) ())) (cons (cons true (cons (cons let (cons (protect W2538) (cons (cons open (cons (protect V2537) (cons out ()))) (cons (cons let (cons (protect W2539) (cons (cons mapc (cons (cons lambda (cons (protect Z2540) (cons (cons file.read&write (cons (cons open (cons (protect Z2540) (cons in ()))) (cons (protect W2538) ()))) ()))) (cons (protect V2536) ()))) (cons (protect W2538) ())))) ())))) ())) ()))) ()))))) (do (shen.record-kl file.read&write (cons defun (cons file.read&write (cons (cons (protect V2543) (cons (protect V2544) ())) (cons (cons file.read&write-h (cons (cons read-byte (cons (protect V2543) ())) (cons (protect V2543) (cons (protect V2544) ())))) ()))))) (do (shen.record-kl file.read&write-h (cons defun (cons file.read&write-h (cons (cons (protect V2547) (cons (protect V2548) (cons (protect V2549) ()))) (cons (cons cond (cons (cons (cons = (cons -1 (cons (protect V2547) ()))) (cons -1 ())) (cons (cons true (cons (cons file.read&write-h (cons (cons read-byte (cons (protect V2548) ())) (cons (protect V2548) (cons (cons do (cons (cons write-byte (cons (protect V2547) (cons (protect V2549) ()))) (cons (protect V2549) ()))) ())))) ())) ()))) ()))))) (do (shen.record-kl reopen (cons defun (cons reopen (cons (cons (protect V2553) ()) (cons (cons let (cons (protect W2554) (cons (cons read-file-as-bytelist (cons (protect V2553) ())) (cons (cons let (cons (protect W2555) (cons (cons open (cons (protect V2553) (cons out ()))) (cons (cons let (cons (protect W2556) (cons (cons mapc (cons (cons lambda (cons (protect Z2557) (cons (cons write-byte (cons (protect Z2557) (cons (protect W2555) ()))) ()))) (cons (protect W2554) ()))) (cons (protect W2555) ())))) ())))) ())))) ()))))) (do (shen.record-kl copy-file (cons defun (cons copy-file (cons (cons (protect V2559) (cons (protect V2560) ())) (cons (cons append-files (cons (cons cons (cons (protect V2559) (cons () ()))) (cons (protect V2560) ()))) ()))))) (do (shen.record-kl copy-file-with-open-stream (cons defun (cons copy-file-with-open-stream (cons (cons (protect V2563) (cons (protect V2564) ())) (cons (cons append-files-with-open-stream (cons (cons cons (cons (protect V2563) (cons () ()))) (cons (protect V2564) ()))) ()))))) (do (shen.record-kl file-exists? (cons defun (cons file-exists? (cons (cons (protect V2567) ()) (cons (cons trap-error (cons (cons do (cons (cons close (cons (cons open (cons (protect V2567) (cons in ()))) ())) (cons true ()))) (cons (cons lambda (cons (protect Z2568) (cons false ()))) ()))) ()))))) (do (shen.record-kl file-size (cons defun (cons file-size (cons (cons (protect V2570) ()) (cons (cons let (cons (protect W2571) (cons (cons open (cons (protect V2570) (cons in ()))) (cons (cons let (cons (protect W2572) (cons (cons file.file-size-loop (cons (protect W2571) (cons 0 (cons (cons read-byte (cons (protect W2571) ())) ())))) (cons (cons let (cons (protect W2573) (cons (cons close (cons (protect W2571) ())) (cons (protect W2572) ())))) ())))) ())))) ()))))) (do (shen.record-kl file.file-size-loop (cons defun (cons file.file-size-loop (cons (cons (protect V2579) (cons (protect V2580) (cons (protect V2581) ()))) (cons (cons cond (cons (cons (cons = (cons -1 (cons (protect V2581) ()))) (cons (protect V2580) ())) (cons (cons true (cons (cons file.file-size-loop (cons (protect V2579) (cons (cons + (cons 1 (cons (protect V2580) ()))) (cons (cons read-byte (cons (protect V2579) ())) ())))) ())) ()))) ()))))) (do (shen.record-kl ascii (cons defun (cons ascii (cons (cons (protect V2585) (cons (protect V2586) (cons (protect V2587) ()))) (cons (cons let (cons (protect W2588) (cons (cons read-file-as-bytelist (cons (protect V2587) ())) (cons (cons file.scan-bytes (cons (protect V2585) (cons (protect V2586) (cons (protect W2588) (cons "" ()))))) ())))) ()))))) (do (shen.record-kl file.scan-bytes (cons defun (cons file.scan-bytes (cons (cons (protect V2594) (cons (protect V2595) (cons (protect V2596) (cons (protect V2597) ())))) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V2596) ()))) (cons (protect V2597) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2596) ())) (cons (cons and (cons (cons >= (cons (cons hd (cons (protect V2596) ())) (cons (protect V2594) ()))) (cons (cons <= (cons (cons hd (cons (protect V2596) ())) (cons (protect V2595) ()))) ()))) ()))) (cons (cons file.scan-bytes (cons (protect V2594) (cons (protect V2595) (cons (cons tl (cons (protect V2596) ())) (cons (cons cn (cons (protect V2597) (cons (cons n->string (cons (cons hd (cons (protect V2596) ())) ())) ()))) ()))))) ())) (cons (cons (cons cons? (cons (protect V2596) ())) (cons (cons simple-error (cons (cons cn (cons "character has code " (cons (cons shen.app (cons (cons hd (cons (protect V2596) ())) (cons (cons cn (cons ": parsed to here - -" (cons (cons shen.app (cons (protect V2597) (cons "" (cons shen.a ())))) ()))) (cons shen.a ())))) ()))) ())) ())) (cons (cons true (cons (cons shen.f-error (cons file.scan-bytes ())) ())) ()))))) ()))))) (do (shen.record-kl pairoff (cons defun (cons pairoff (cons (cons (protect V2616) (cons (protect V2617) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V2616) ()))) (cons () ())) (cons (cons (cons = (cons () (cons (protect V2617) ()))) (cons () ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2616) ())) (cons (cons cons? (cons (protect V2617) ())) ()))) (cons (cons cons (cons (cons @p (cons (cons hd (cons (protect V2616) ())) (cons (cons hd (cons (protect V2617) ())) ()))) (cons (cons pairoff (cons (cons tl (cons (protect V2616) ())) (cons (cons tl (cons (protect V2617) ())) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons pairoff ())) ())) ()))))) ()))))) (do (shen.record-kl assocp (cons defun (cons assocp (cons (cons (protect V2627) (cons (protect V2628) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V2628) ()))) (cons (cons simple-error (cons "pair not found -" ())) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2628) ())) (cons (cons and (cons (cons tuple? (cons (cons hd (cons (protect V2628) ())) ())) (cons (cons = (cons (protect V2627) (cons (cons fst (cons (cons hd (cons (protect V2628) ())) ())) ()))) ()))) ()))) (cons (cons hd (cons (protect V2628) ())) ())) (cons (cons (cons cons? (cons (protect V2628) ())) (cons (cons assocp (cons (protect V2627) (cons (cons tl (cons (protect V2628) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons assocp ())) ())) ()))))) ()))))) (do (shen.record-kl cartprodp (cons defun (cons cartprodp (cons (cons (protect V2633) (cons (protect V2634) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V2633) ()))) (cons () ())) (cons (cons (cons cons? (cons (protect V2633) ())) (cons (cons append (cons (cons map (cons (cons lambda (cons (protect Z2635) (cons (cons @p (cons (cons hd (cons (protect V2633) ())) (cons (protect Z2635) ()))) ()))) (cons (protect V2634) ()))) (cons (cons cartprodp (cons (cons tl (cons (protect V2633) ())) (cons (protect V2634) ()))) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons cartprodp ())) ())) ())))) ()))))) (do (shen.record-kl assocp-if (cons defun (cons assocp-if (cons (cons (protect V2643) (cons (protect V2644) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V2644) ()))) (cons (cons simple-error (cons "pair not found -" ())) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2644) ())) (cons (cons and (cons (cons tuple? (cons (cons hd (cons (protect V2644) ())) ())) (cons (cons (protect V2643) (cons (cons fst (cons (cons hd (cons (protect V2644) ())) ())) ())) ()))) ()))) (cons (cons hd (cons (protect V2644) ())) ())) (cons (cons (cons cons? (cons (protect V2644) ())) (cons (cons assocp-if (cons (protect V2643) (cons (cons tl (cons (protect V2644) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons assocp-if ())) ())) ()))))) ()))))) (shen.record-kl assocp-if-not (cons defun (cons assocp-if-not (cons (cons (protect V2652) (cons (protect V2653) ())) (cons (cons cond (cons (cons (cons = (cons () (cons (protect V2653) ()))) (cons (cons simple-error (cons "pair not found -" ())) ())) (cons (cons (cons and (cons (cons cons? (cons (protect V2653) ())) (cons (cons and (cons (cons tuple? (cons (cons hd (cons (protect V2653) ())) ())) (cons (cons not (cons (cons (protect V2652) (cons (cons fst (cons (cons hd (cons (protect V2653) ())) ())) ())) ())) ()))) ()))) (cons (cons hd (cons (protect V2653) ())) ())) (cons (cons (cons cons? (cons (protect V2653) ())) (cons (cons assocp-if-not (cons (protect V2652) (cons (cons tl (cons (protect V2653) ())) ()))) ())) (cons (cons true (cons (cons shen.f-error (cons assocp-if-not ())) ())) ()))))) ())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) - -(defun stlib.initialise-final () (do (let External (external stlib) (let ExternalF (filter (lambda X (> (arity X) -1)) External) (let SystemfResult (map (lambda Y2657 (systemf Y2657)) ExternalF) ok))) (do (preclude-all-but ()) (do (set shen.*userdefs* ()) (do (cd "") (tc -)))))) - -(defun stlib.initialise () (do (stlib.initialise-environment) (do (stlib.initialise-arities) (do (stlib.initialise-macros) (do (stlib.initialise-synonyms) (do (stlib.initialise-datatypes) (do (stlib.initialise-types) (do (stlib.initialise-sources) (stlib.initialise-final))))))))) - diff --git a/kernel/stlib/IO/delete-file.shen b/kernel/stlib/IO/delete-file.shen new file mode 100644 index 0000000..e03b82c --- /dev/null +++ b/kernel/stlib/IO/delete-file.shen @@ -0,0 +1,7 @@ +(define delete-file + {string --> (list A)} + File -> (cases (= (language) "Common Lisp") (lisp.delete-file File) + true (close (open File out)))) + +(declare delete-file [string --> [list A]]) + \ No newline at end of file diff --git a/kernel/stlib/IO/files.shen b/kernel/stlib/IO/files.shen new file mode 100644 index 0000000..0031f43 --- /dev/null +++ b/kernel/stlib/IO/files.shen @@ -0,0 +1,83 @@ +(package file [append-files append-files-with-open-stream mapc + copy-file file-size reopen errout copy-file-with-open-stream + file-exists? newv ascii] + +(defmacro file-macro + [errout X Default ErrFile] -> (let Err (newv) + Open (newv) + Record (newv) + Close (newv) + E (newv) + [trap-error X [/. E [let Err [error-to-string E] + Open [trap-error [reopen ErrFile] [/. E [open ErrFile out]]] + Record [pr Err Open] + Close [close Open] + Default]]])) + +(define append-files + {(list string) --> string --> string} + Files File -> (let Stream (append-files-with-open-stream Files File) + Close (close Stream) + File)) + +(define append-files-with-open-stream + {(list string) --> string --> (stream out)} + Files File -> (error "cannot read and write to ~A at the same time~%" File) where (element? File Files) + Files File -> (let OutStream (open File out) + Write (mapc (/. F (read&write (open F in) OutStream)) Files) + OutStream)) + +(define read&write + {(stream in) --> (stream out) --> number} + In Out -> (read&write-h (read-byte In) In Out)) + +(define read&write-h + {number --> (stream in) --> (stream out) --> number} + -1 In Out -> -1 + Byte In Out -> (read&write-h (read-byte In) In (do (write-byte Byte Out) Out))) + +(define reopen + {string --> (stream out)} + File -> (let ByteList (read-file-as-bytelist File) + Open (open File out) + Write (mapc (/. Byte (write-byte Byte Open)) ByteList) + Open)) + +(define copy-file + {string --> string --> string} + InFile OutFile -> (append-files [InFile] OutFile)) + +(define copy-file-with-open-stream + {string --> string --> (stream out)} + InFile OutFile -> (append-files-with-open-stream [InFile] OutFile)) + +(define file-exists? + {string --> boolean} + File -> (trap-error (do (close (open File in)) true) (/. E false))) + +(define file-size + {string --> number} + File -> (let Stream (open File in) + Size (file-size-loop Stream 0 (read-byte Stream)) + Close (close Stream) + Size)) + +(define file-size-loop + {(stream in) --> number --> number --> number} + _ Size -1 -> Size + Stream Size _ -> (file-size-loop Stream (+ 1 Size) (read-byte Stream))) + +(define ascii + {number --> number --> string --> string} + Min Max File -> (let Bytes (read-file-as-bytelist File) + (scan-bytes Min Max Bytes ""))) + +(define scan-bytes + {number --> number --> (list number) --> string --> string} + Min Max [] S -> S + Min Max [N | Ns] S + -> (scan-bytes Min Max Ns (cn S (n->string N))) + where (and (>= N Min) (<= N Max)) + Min Max [N | _] S -> (error "character has code ~A: parsed to here~%~%~A" N S)) ) + + \ No newline at end of file diff --git a/kernel/stlib/IO/prettyprint.shen b/kernel/stlib/IO/prettyprint.shen new file mode 100644 index 0000000..df9f6be --- /dev/null +++ b/kernel/stlib/IO/prettyprint.shen @@ -0,0 +1,83 @@ +(package print (append (external maths) + [pps pprint pretty-string linelength indentation set-linelength set-indentation]) + +(datatype print + + _______________________________ + (value *indentation*) : number; + + _______________________________ + (value *linelength*) : number;) + +(defmacro pprint-macro + [pprint X] -> [pprint X [stoutput]] + [pps F] -> [pps F [stoutput]]) + +(set *indentation* 1) +(set *linelength* 60) + +(define linelength + {--> number} + -> (value *linelength*)) + +(define indentation + {--> number} + -> (value *indentation*)) + +(define set-linelength + {number --> number} + N -> (set *linelength* N) where (and (positive? N) (integer? N)) + N -> (error "line length must be a positive integer~%")) + +(define set-indentation + {number --> number} + N -> (set *indentation* N) where (and (positive? N) (integer? N)) + N -> (error "indentation must be a positive integer~%")) + +(define pps + {symbol --> (stream out) --> symbol} + F Sink -> (let Code (ps F) + Ugly (make-string "~R" Code) + Pretty (pretty-string Ugly) + PrettyPrint (pr Pretty Sink) + NL (nl) + F)) + +(define pprint + {A --> (stream out) --> A} + X Stream -> (let Ugly (make-string "~S" X) + Pretty (pretty-string Ugly) + PrettyPrint (pr Pretty Stream) + NL (nl) + X)) + +(define pretty-string + {string --> string} + S -> (pretty-string-h S 0 0)) + +(define pretty-string-h + {string --> number --> number --> string} + "" _ _ -> "" + (@s "[" Ss) Depth Length -> (@s (indent Depth) "[" (pretty-string-h Ss (+ Depth 1) 0)) + (@s "(" Ss) Depth Length -> (@s (indent Depth) "(" (pretty-string-h Ss (+ Depth 1) 0)) + (@s "]" Ss) Depth Length -> (@s "]" (pretty-string-h Ss (- Depth 1) 0)) + (@s ")" Ss) Depth Length -> (@s ")" (pretty-string-h Ss (- Depth 1) 0)) + (@s " " Ss) Depth Length -> (@s (indent Depth) (pretty-string-h Ss Depth 0)) where (> Length (linelength)) + (@s S Ss) Depth Length -> (@s S (pretty-string-h Ss Depth (+ Length 1)))) + +(define indent + {number --> string} + 0 -> "" + N -> (@s "c#10;" (indent-h N))) + +(define indent-h + {number --> string} + 0 -> "" + N -> (cn (n-space (indentation)) (indent-h (- N 1)))) + + (define n-space + {number --> string} + 0 -> "" + N -> (cn " " (n-space (- N 1)))) + + (preclude [print])) \ No newline at end of file diff --git a/kernel/stlib/Lists/lists.shen b/kernel/stlib/Lists/lists.shen new file mode 100644 index 0000000..da4020c --- /dev/null +++ b/kernel/stlib/Lists/lists.shen @@ -0,0 +1,267 @@ +(package list [prefix? suffix? subset? set=? set? permute nthhd + cartprod powerset subbag? bag=? n-times + trim-right trim-left trim trim-right-if trim-left-if + trim-if assoc-if assoc-if-not infix? count-if count + remove-duplicates foldr foldl find mapf remove-if + some? every? mapc filter transitive-closure x->ascii + take take-last drop drop-last index index-last insert + splice sort partition] + +(define assoc-if + {(A --> boolean) --> (list (list A)) --> (list A)} + _ [] -> [] + F [[X | Y] | _] -> [X | Y] where (F X) + F [_ | Y] -> (assoc-if F Y)) + +(define assoc-if-not + {(A --> boolean) --> (list (list A)) --> (list A)} + _ [] -> [] + F [[X | Y] | _] -> [X | Y] where (not (F X)) + F [_ | Y] -> (assoc-if F Y)) + +(define drop + {number --> (list A) --> (list A)} + 0 L -> L + N [_ | Y] -> (drop (- N 1) Y)) + +(define drop-last + {number --> (list A) --> (list A)} + N L -> (reverse (drop N (reverse L)))) + +(define index + {A --> (list A) --> number} + X L -> (index-h X L 1)) + +(define index-h + {A --> (list A) --> number --> number} + _ [] _ -> -1 + X [X | _] N -> N + X [_ | Y] N -> (index-h X Y (+ N 1))) + +(define index-last + {A --> (list A) --> number} + X L -> (let Len (length L) + N (index X (reverse L)) + (if (= N -1) N (+ (- Len N) 1)))) + +(define insert + {number --> A --> (list A) --> (list A)} + _ X [] -> (error "cannot insert ~S into list: index out of range~%" X) + 1 X L -> [X | L] + N X [Y | Z] -> [Y | (insert (- N 1) X Z)]) + +(define remove-duplicates + {(list A) --> (list A)} + [] -> [] + [X | Y] -> (remove-duplicates Y) where (element? X Y) + [X | Y] -> [X | (remove-duplicates Y)]) + +(define trim-left-if + {(A --> boolean) --> (list A) --> (list A)} + _ [] -> [] + P [X | Y] -> (trim-left-if P Y) where (P X) + _ L -> L) + +(define trim-right-if + {(A --> boolean) --> (list A) --> (list A)} + P L -> (reverse (trim-left-if P (reverse L)))) + +(define trim-if + {(A --> boolean) --> (list A) --> (list A)} + P L -> (trim-right-if P (trim-left-if P L))) + +(define trim-left + {(list A) --> (list A) --> (list A)} + _ [] -> [] + Trim [X | Y] -> (trim-left Trim Y) where (element? X Trim) + _ L -> L) + +(define trim-right + {(list A) --> (list A) --> (list A)} + Trim L -> (reverse (trim-left Trim (reverse L)))) + +(define trim + {(list A) --> (list A) --> (list A)} + Trim L -> (trim-right Trim (trim-left Trim L))) + +(define prefix? + {(list A) --> (list A) --> boolean} + [] _ -> true + [X | Y] [X | Z] -> (prefix? Y Z) + _ _ -> false) + +(define infix? + {(list A) --> (list A) --> boolean} + L1 L2 -> true where (prefix? L1 L2) + _ [] -> false + L1 [_ | Y] -> (infix? L1 Y)) + +(define suffix? + {(list A) --> (list A) --> boolean} + L1 L2 -> (prefix? (reverse L1) (reverse L2))) + +(define subset? + {(list A) --> (list A) --> boolean} + [] _ -> true + [X | Y] Z -> (subset? Y Z) where (element? X Z) + _ _ -> false) + +(define set=? + {(list A) --> (list A) --> boolean} + L1 L2 -> (and (subset? L1 L2) (subset? L2 L1))) + +(define set? + {(list A) --> boolean} + [] -> true + [X | Y] -> false where (element? X Y) + [_ | Y] -> (set? Y)) + +(define n-times + {A --> number --> (list A)} + X N -> (n-times-h N X [])) + +(define n-times-h + {number --> A --> (list A) --> (list A)} + 0 X L -> L + N X L -> (n-times-h (- N 1) X [X | L])) + +(define subbag? + {(list A) --> (list A) --> boolean} + L1 L2 -> (every? (/. Z (= (count Z L1) (count Z L2))) L1)) + +(define bag=? + {(list A) --> (list A) --> boolean} + L1 L2 -> (and (subbag? L1 L2) (subbag? L2 L1))) + +(define mapc + {(A --> B) --> (list A) --> (list C)} + _ [] -> [] + F [X | Y] -> (mapc (do (F X) F) Y)) + +(define permute + {(list A) --> (list (list A))} + [] -> [[]] + XS -> (mapcan (/. EL (map (/. P [EL | P]) + (permute (remove EL XS)))) + XS)) + +(define count-if + {(A --> boolean) --> (list A) --> number} + P L -> (length (mapcan (/. Z (if (P Z) [Z] [])) L))) + +(define count + {A --> (list A) --> number} + X L -> (count-if (= X) L)) + +(define some? + {(A --> boolean) --> (list A) --> boolean} + _ [] -> false + P [X | _] -> true where (P X) + P [_ | Y] -> (some? P Y)) + +(define every? + {(A --> boolean) --> (list A) --> boolean} + _ [] -> true + P [X | Y] -> (every? P Y) where (P X) + _ _ -> false) + +(define sort + {(A --> A --> boolean) --> (list A) --> (list A)} + _ [] -> [] + _ [X] -> [X] + R [X | Y] -> (let Less (mapcan (/. Z (if (R Z X) [Z] [])) Y) + More (mapcan (/. Z (if (not (R Z X)) [Z] [])) Y) + (append (sort R Less) [X] (sort R More)))) + +(define find + {(A --> boolean) --> (list A) --> A} + _ [] -> (error "find has found no element~%") + P [X | _] -> X where (P X) + P [_ | Y] -> (find P Y)) + +(define foldr + {(A --> B --> B) --> B --> (list A) --> B} + _ X [] -> X + F X [Y | Z] -> (foldr F (F Y X) Z)) + +(define foldl + {(A --> B --> A) --> A --> (list B) --> A} + _ X [] -> X + F X [Y | Z] -> (foldl F (F X Y) Z)) + +(define mapf + {(A --> B) --> (list A) --> (B --> (list C) --> (list C)) --> (list C)} + _ [] _ -> [] + F [X | Y] C -> (C (F X) (mapf F Y C))) + +(define filter + {(A --> boolean) --> (list A) --> (list A)} + _ [] -> [] + F [X | Y] -> (if (F X) [X | (filter F Y)] (filter F Y))) + +(define remove-if + {(A --> boolean) --> (list A) --> (list A)} + _ [] -> [] + F [X | Y] -> (if (F X) (remove-if F Y) [X | (remove-if F Y)])) + +(define reduce + {(A --> B --> A) --> A --> (list B) --> A} + F Z [] -> Z + F Z [X | Xs] -> (reduce F (F Z X) Xs)) + +(define take + {number --> (list A) --> (list A)} + 0 _ -> [] + _ [] -> [] + N [X | L] -> [X | (take (- N 1) L)]) + +(define take-last + {number --> (list A) --> (list A)} + N L -> (reverse (take N (reverse L)))) + +(define cartprod + {(list A) --> (list A) --> (list (list A))} + [] _ -> [] + [X | Y] Z -> (append (map (/. W [X W]) Z) (cartprod Y Z))) + +(define powerset + {(list A) --> (list (list A))} + [] -> [[]] + [X | Y] -> (let P (powerset Y) + (append P (map (/. Z [X | Z]) P)))) + +(define partition + {(A --> A --> boolean) --> (list A) --> (list (list A))} + _ [] -> [] + R [X | Y] -> (let EQ (mapcan (/. Z (if (R X Z) [Z] [])) [X | Y]) + Remainder (difference [X | Y] EQ) + [EQ | (partition R Remainder)]) + _ _ -> (simple-error "partition equires a list")) + +(define transitive-closure + {(list (A * A)) --> (list (A * A))} + L -> (let T (transitive-pass L L) + (if (= T L) + T + (transitive-pass T T)))) + +(define transitive-pass + {(list (A * A)) --> (list (A * A)) --> (list (A * A))} + [] All -> All + [(@p X Y) | L] All -> (let Trans (find-trans X Y All) + (union Trans (transitive-pass L All)))) + +(define find-trans + {A --> A --> (list (A * A)) --> (list (A * A))} + _ _ [] -> [] + X Y [(@p Y Z) | All] -> [(@p X Z) | (find-trans X Y All)] + X Y [_ | All] -> (find-trans X Y All)) + +(define x->ascii + {A --> (list number)} + X -> (map (fn string->n) (explode X))) + +(define splice + {number --> (list A) --> (list A) --> (list A)} + 1 L1 L2 -> (append L1 L2) + N L [X | Y] -> [X | (splice (- N 1) L Y)]) ) \ No newline at end of file diff --git a/kernel/stlib/Maths/complex.dtype b/kernel/stlib/Maths/complex.dtype new file mode 100644 index 0000000..d16d3ba --- /dev/null +++ b/kernel/stlib/Maths/complex.dtype @@ -0,0 +1,31 @@ +(package complex [c# complex? real imaginary complex] + +(define c# + R I -> (let C (absvector 3) + PrintF (address-> C 0 print-complex) + Rumerator (address-> C 1 R) + Ienominator (address-> C 2 I) + C) where (and (number? R) (number? I)) + R I -> (error "real ~A and imaginary ~A must be numbers~%" R I)) + +(define print-complex + C -> (make-string (cn "(c" "# ~A ~A)") (<-address C 1) (<-address C 2))) + +(define complex? + C -> (trap-error (and (absvector? C) + (= (<-address C 0) print-complex) + (number? (<-address C 1)) + (number? (<-address C 2))) (/. E false))) + +(define real + C -> (<-address C 1)) + +(define imaginary + C -> (<-address C 2)) + +(declare c# [number --> [number --> complex]]) +(declare complex? [A --> boolean]) +(declare real [complex --> number]) +(declare imaginary [complex --> number]) ) + + \ No newline at end of file diff --git a/kernel/stlib/Maths/complex.shen b/kernel/stlib/Maths/complex.shen new file mode 100644 index 0000000..37726b7 --- /dev/null +++ b/kernel/stlib/Maths/complex.shen @@ -0,0 +1,38 @@ +(package complex (append [c+ c- c* c/] (external complex) (external maths)) + + (define c+ + {complex --> complex --> complex} + C1 C2 -> (let A (real C1) + B (imaginary C1) + C (real C2) + D (imaginary C2) + (c# (+ A C) (+ B D)))) + + (define c- + {complex --> complex --> complex} + C1 C2 -> (let A (real C1) + B (imaginary C1) + C (real C2) + D (imaginary C2) + (c# (- A C) (- B D)))) + + (define c* + {complex --> complex --> complex} + C1 C2 -> (let A (real C1) + B (imaginary C1) + C (real C2) + D (imaginary C2) + (c# (- (* A C) (* B D)) (+ (* B C) (* A D))))) + + (define c/ + {complex --> complex --> complex} + C1 C2 -> (let A (real C1) + B (imaginary C1) + C (real C2) + D (imaginary C2) + (c# (/ (+ (* A C) (* B D)) + (+ (* C C) (* D D))) + (/ (- (* B C) (* A D)) + (+ (* C C) (* D D)))))) + + ) \ No newline at end of file diff --git a/kernel/stlib/Maths/macros.shen b/kernel/stlib/Maths/macros.shen new file mode 100644 index 0000000..4cc0e0d --- /dev/null +++ b/kernel/stlib/Maths/macros.shen @@ -0,0 +1,55 @@ +(package maths [expt =r gcd lcd isqrt sqrt nthrt floor ceiling round mod lcm random min max + reseed ~ positive? negative? natural? converge series odd? even? + cos sin tan radians pi e tan30 cos30 cos45 sin45 sqrt2 tan60 sin120 + tan120 sin135 cos135 cos150 tan150 cos210 tan210 sin225 cos225 sin240 + tan240 sin300 tan300 sin315 cos315 cos330 tan330 sinh cosh tanh sech + csch power factorial prime? unix div modf product summation set-tolerance tolerance + coth for sq cube newv abs approx log log2 loge log10 g to stop done] + +(defmacro maths-macro + [log10 N] -> [log10 N [tolerance]] + [log2 N] -> [log2 N [tolerance]] + [loge N] -> [loge N [tolerance]] + [log M N] -> [log M N [tolerance]] + [sin N] -> [sin N [tolerance]] + [tan N] -> [tan N [tolerance]] + [cos N] -> [cos N [tolerance]] + [tanh N] -> [tanh N [tolerance]] + [cosh N] -> [cosh N [tolerance]] + [sinh N] -> [sinh N [tolerance]] + [sech N] -> [sech N [tolerance]] + [csch N] -> [csch N [tolerance]] + [coth N] -> [coth N [tolerance]] + [nthrt N Root] -> [nthrt N Root [tolerance]] + [sqrt N] -> [sqrt N [tolerance]] + [expt M N] -> [expt M N [tolerance]] + [max W X Y | Z] -> [max W [max X Y | Z]] + [min W X Y | Z] -> [min W [min X Y | Z]] + [tolerance N] -> [tolerance=n N] + [for X = Val stop Stop | Options+Procedure] -> [upto Val Stop | (process-options X Options+Procedure)] + [for X = Val to N | Options+Procedure] -> [upto Val [< N] | (process-options X Options+Procedure)]) + +(define process-options + X O+P -> (append (step-option O+P) + (constructor-option O+P) + (end-option O+P) + (process X O+P))) + +(define step-option + [] -> [[+ 1]] + [step Step | _] -> [Step] + [_ | O+P] -> (step-option O+P)) + +(define constructor-option + [] -> [[fn do]] + [constructor C | _] -> [C] + [_ | O+P] -> (constructor-option O+P)) + +(define end-option + [] -> [done] + [end End | _] -> [End] + [_ | O+P] -> (end-option O+P)) + +(define process + X [Process] -> [[/. X Process]] + X [_ | O+P] -> (process X O+P))) \ No newline at end of file diff --git a/kernel/stlib/Maths/maths.shen b/kernel/stlib/Maths/maths.shen new file mode 100644 index 0000000..849a3d1 --- /dev/null +++ b/kernel/stlib/Maths/maths.shen @@ -0,0 +1,542 @@ +(package maths [expt =r gcd lcd isqrt sqrt nthrt floor ceiling round mod lcm random min max + reseed ~ positive? negative? natural? converge series odd? even? + cos sin tan radians pi e tan30 cos30 cos45 sin45 sqrt2 tan60 sin120 + tan120 sin135 cos135 cos150 tan150 cos210 tan210 sin225 cos225 sin240 + tan240 sin300 tan300 sin315 cos315 cos330 tan330 sinh cosh tanh sech + csch power factorial prime? unix div modf product summation set-tolerance tolerance + coth for sq cube newv abs approx log log2 loge log10 g] + + + +(datatype maths + + _________________ + (value *seed*) : number; + + _______________________ + (value *tolerance*) : number;) + +(set *seed* 95795) +(set *tolerance* .0001) + +(define set-tolerance + {number --> number} + N -> (set *tolerance* N)) + +(define tolerance + {--> number} + -> (value *tolerance*)) + +(define sq + {number --> number} + X -> (* X X)) + +(define cube + {number --> number} + X -> (* X X X)) + +(define for + {number --> (number --> boolean) + --> (number --> A) --> (number --> number) + --> (A --> A --> A) --> A} + Count Continue? Loop Inc Acc -> (for-h (Inc Count) Continue? Loop Inc Acc (Loop Count))) + +(define for-h + {number --> (number --> boolean) + --> (number --> A) --> (number --> number) --> (A --> A --> A) --> A --> A} + Count Continue? _ _ _ Result -> Result where (not (Continue? Count)) + Count Continue? Loop Inc Acc Result + -> (for-h (Inc Count) Continue? Loop Inc Acc (Acc Result (Loop Count) ))) + +(define lazyfor-and + {number --> (number --> boolean) + --> (number --> boolean) --> (number --> number) --> boolean} + Count Continue? _ _ -> true where (not (Continue? Count)) + Count Continue? Loop Inc -> (lazyfor-and (Inc Count) Continue? Loop Inc) where (Loop Count) + _ _ _ _ -> false) + +(define lazyfor-or + {number --> (number --> boolean) + --> (number --> boolean) --> (number --> number) --> boolean} + Count Continue? Loop Inc -> false where (not (Continue? Count)) + Count _ Loop _ -> true where (Loop Count) + Count Continue? Loop Inc -> (lazyfor-or (Inc Count) Continue? Loop Inc)) + +(define max + {number --> number --> number} + M N -> N where (> N M) + M _ -> M) + +(define min + {number --> number --> number} + M N -> N where (< N M) + M _ -> M) + +(define expt + {number --> number --> number --> number} + M N Tolerance -> (cases (= N 0) 1 + (positive? N) (expt-h M (n->r N 1) Tolerance) + true (/ 1 (expt-h M (n->r (~ N) 1) Tolerance)))) + +(define n->r + {number --> number --> (number * number)} + N D -> (@p N D) where (integer? N) + N D -> (n->r (* N 10) (* D 10))) + +(define expt-h + {number --> (number * number) --> number --> number} + M (@p N D) Tolerance -> (power (nthrt M D Tolerance) N)) + +(define gcd + {number --> number --> number} + M N -> (if (and (integer? M) (integer? N)) + (let M* (abs M) + N* (abs N) + (if (> M* N*) + (gcd-help (- M* N*) N*) + (gcd-help M* (- N* M*)))) + (error "gcd expects integer inputs"))) + +(define gcd-help + {number --> number --> number} + M N -> (if (> M N) + (gcd-loop M N N) + (gcd-loop M N M))) + +(define gcd-loop + {number --> number --> number --> number} + _ _ 1 -> 1 + M N Divisor -> Divisor where (and (integer? (/ M Divisor)) (integer? (/ N Divisor))) + M N Divisor -> (gcd-loop M N (- Divisor 1))) + +(define lcd + {number --> number --> number} + M N -> 2 where (and (even? M) (even? N)) + M N -> (lcd-loop M N (if (> M N) N M) 3)) + +(define lcd-loop + {number --> number --> number --> number --> number} + _ _ Max Divisor -> 1 where (> Divisor Max) + M N _ Divisor -> Divisor where (and (integer? (/ M Divisor)) (integer? (/ N Divisor))) + M N Max Divisor -> (lcd-loop M N Max (+ 2 Divisor))) + +(define isqrt + {number --> number} + N -> (isqrt-loop N 0)) + +(define isqrt-loop + {number --> number --> number} + N Sqrt -> Sqrt where (= (* Sqrt Sqrt) N) + N Sqrt -> (- Sqrt 1) where (> (* Sqrt Sqrt) N) + N Sqrt -> (isqrt-loop N (+ Sqrt 1))) + +(define div + {number --> number --> number} + N D -> (floor (/ N D))) + +(define modf + {number --> (number * number)} + N -> (let Floor (floor N) (@p Floor (- N Floor)))) + +(define floor + {number --> number} + N -> (~ (ceiling (~ N))) where (negative? N) + N -> (rounding-loop floor N 15 0)) + +(define rounding-loop + {symbol --> number --> number --> number --> number} + _ N 0 N -> N + K N 0 Guess -> (cases (= K floor) (- Guess 1) + (= K ceiling) Guess + (= K round) (let Up (- Guess N) + Down (- N (- Guess 1)) + (if (> Up Down) + (- Guess 1) + Guess))) where (> Guess N) + K N Exponent Guess -> (rounding-loop K N Exponent + (+ Guess (power 10 Exponent))) where (> N Guess) + K N Exponent Guess -> (rounding-loop K N (- Exponent 1) (- Guess (power 10 Exponent)))) + +(define float->pair + {number --> (number * number)} + N -> (let Floor (floor N) (@p Floor (- N Floor)))) + +(define ceiling + {number --> number} + N -> (~ (floor (~ N))) where (negative? N) + N -> (rounding-loop ceiling N 15 0)) + +(define round + {number --> number} + N -> (~ (round (~ N))) where (negative? N) + N -> (rounding-loop round N 15 0)) + +(define mod + {number --> number --> number} + X Y -> (let Div (/ X Y) + FloorDiv (floor Div) + (if (and (integer? X) (integer? Y)) + (round (* Y (- Div FloorDiv))) + (* Y (- Div FloorDiv))))) + +(define lcm + {(list number) --> number} + L -> (let Greatest (greatest L) + (lcm-h Greatest Greatest L))) + +(define greatest + {(list number) --> number} + [N] -> N + [M N | Ns] -> (greatest [M | Ns]) where (> M N) + [_ N | Ns] -> (greatest [N | Ns])) + +(define lcm-h + {number --> number --> (list number) --> number} + LCM Greatest L -> LCM where (lcm? LCM L) + LCM Greatest L -> (lcm-h (+ LCM Greatest) Greatest L)) + +(define lcm? + {number --> (list number) --> boolean} + _ [] -> true + LCM [N | Ns] -> (and (integer? (/ LCM N)) (lcm? LCM Ns))) + +(define random + {number --> number --> number} + Lower Upper -> (let Random (bbs (value *seed*)) + NewSeed (set *seed* Random) + Min (min Lower Upper) + (+ Min (mod NewSeed (abs (+ 1 (- Upper Lower))))))) + +(define min + {number --> number --> number} + X Y -> Y where (> X Y) + X _ -> X) + +(define reseed + {--> number} + -> (set *seed* (get-time unix))) + +(define bbs + {number --> number} + Xn -> (let M (* 1201 1213) + (mod (* Xn Xn) M))) + +(define ~ + {number --> number} + N -> (- 0 N)) + +(define positive? + {number --> boolean} + N -> (> N 0)) + +(define negative? + {number --> boolean} + N -> (< N 0)) + +(define natural? + {number --> boolean} + 0 -> true + N -> (and (integer? N) (positive? N))) + +(define converge + {A --> (A --> A) --> (A --> A --> boolean) --> A} + X F R -> (converge-help F (F X) X R)) + +(define converge-help + {(A --> A) --> A --> A --> (A --> A --> boolean) --> A} + _ New Old R -> New where (R Old New) + F New _ R -> (converge-help F (F New) New R)) + +(define nthrt + {number --> number --> number --> number} + A Root Tolerance -> (converge A (/. Xk (compute-nthrt A Xk Root Tolerance)) (approx Tolerance)) where (positive? A) + A _ _ -> (error "nthrt: negA must be a positive numberneg%" A)) + +(define sqrt + {number --> number --> number} + N Tolerance -> (nthrt N 2 Tolerance)) + +(define compute-nthrt + {number --> number --> number --> number --> number} + A Xk N Tolerance -> (let Reciprocal (/ 1 N) + N-1Xk (* (- N 1) Xk) + Xk (expt Xk (- N 1) Tolerance) + A/Xk (/ A Xk) + Add (+ N-1Xk A/Xk) + (* Reciprocal Add))) + +(define approx + {number --> (number --> number --> boolean)} + N -> (/. X Y (let Z (- X Y) (>= N (abs Z))))) + +(define abs + {number --> number} + N -> (if (>= N 0) N (- 0 N))) + +(define series + {number --> (number --> number) --> number --> (number --> number --> number) --> number} + Start TermF Tolerance Op -> (series-h (+ Start 1) Tolerance TermF (TermF Start) Op)) + +(define series-h + {number --> number --> (number --> number) --> number --> (number --> number --> number) --> number} + Count Tolerance TermF SoFar Op + -> (let Next (Op (TermF Count) SoFar) + (if (<= (abs (- SoFar Next)) Tolerance) + Next + (series-h (+ Count 1) + Tolerance + TermF + Next + Op)))) + +(define product + {number --> (number --> number) --> number --> number} + Start TermF Tolerance -> (series Start TermF Tolerance (fn *))) + +(define summation + {number --> (number --> number) --> number --> number} + Start TermF Tolerance -> (series Start TermF Tolerance (fn +))) + +(define odd? + {number --> boolean} + N -> (and (integer? N) (not (integer? (/ N 2))))) + +(define even? + {number --> boolean} + N -> (and (integer? N) (integer? (/ N 2)))) + +(define compute-sine + {number --> number --> number} + X N -> (let N*2+1 (+ (* 2 N) 1) + Numerator (* (power -1 N) (power X N*2+1)) + Denominator (factorial N*2+1) + (/ Numerator Denominator))) + +(define compute-cos + {number --> number --> number} + X N -> (let N*2 (* 2 N) + Numerator (* (power -1 N) (power X N*2)) + Denominator (factorial N*2) + (/ Numerator Denominator))) + +(define cos + {number --> number --> number} + Degrees Tolerance -> (let Radians (radians Degrees) + (summation 0 (compute-cos Radians) Tolerance))) + +(define sin + {number --> number --> number} + Degrees Tolerance -> (let Radians (radians Degrees) + (summation 0 (compute-sine Radians) Tolerance))) + +(define tan + {number --> number --> number} + Degrees Tolerance -> (/ (sin Degrees Tolerance) (cos Degrees Tolerance))) + +(define radians + {number --> number} + Degrees -> (* (/ Degrees 180) (pi))) + +(define g + {--> number} + -> 1.6180339887498) + +(define pi + {--> number} + -> 3.1415926535897) + +(define e + {--> number} + -> 2.7182818284590) + +(define tan30 + {--> number} + -> 0.5773502691896) + +(define cos30 + {--> number} + -> 0.8660254037844) + +(define cos45 + {--> number} + -> 0.70710678118651) + +(define sin45 + {--> number} + -> 0.7071067811865) + +(define sqrt2 + {--> number} + -> 1.4142135623731) + +(define tan60 + {--> number} + -> 1.7320508075692) + +(define sin60 + {--> number} + -> 0.8660254037844) + +(define sin120 + {--> number} + -> 0.8660254037844) + +(define tan120 +{--> number} + -> -1.7320508075692) + +(define sin135 +{--> number} + -> 0.7071067811865) + +(define cos135 +{--> number} + -> -0.7071067811865) + +(define cos150 +{--> number} + -> -0.8660254037844) + +(define tan150 +{--> number} + -> -0.5773502691905) + +(define cos210 + {--> number} + -> -0.8660254037844) + +(define tan210 +{--> number} + -> 0.5773502691905) + +(define sin225 +{--> number} + -> -0.7071067811865) + +(define cos225 +{--> number} + -> -0.7071067811865) + +(define sin240 +{--> number} + -> -0.8660254037844) + +(define tan240 +{--> number} + -> 1.7320508075692) + +(define sin300 +{--> number} + -> -0.8660254037844) + +(define tan300 +{--> number} + -> -1.7320508075692) + +(define sin315 +{--> number} + -> -0.7071067811865) + +(define cos315 +{--> number} + -> 0.7071067811865) + +(define cos330 +{--> number} + -> 0.8660254037844) + +(define tan330 +{--> number} + -> -0.5773502691905) + +(define coth + {number --> number --> number} + N Tolerance -> (let E (e) + E-2N (expt E (~ (* 2 N)) Tolerance) + (/ (+ 1 E-2N) (- 1 E-2N)))) + +(define sinh + {number --> number --> number} + N Tolerance -> (let E (e) + EN (expt E N Tolerance) + E-N (expt E (~ N) Tolerance) + Diff (- EN E-N) + (/ Diff 2))) + +(define cosh + {number --> number --> number} + N Tolerance -> (let E (e) + EN (expt E N Tolerance) + E-N (expt E (~ N) Tolerance) + Sum (+ EN E-N) + (/ Sum 2))) + +(define tanh + {number --> number --> number} + N Tolerance -> (/ (sinh N Tolerance) (cosh N Tolerance))) + +(define sech + {number --> number --> number} + N Tolerance -> (/ 1 (cosh N Tolerance))) + +(define csch + {number --> number --> number} + N Tolerance -> (/ 1 (sinh N Tolerance))) + +(define power + {number --> number --> number} + _ 0 -> 1 + N M -> (* N (power N (- M 1)))) + +(define factorial + {number --> number} + 0 -> 1 + N -> (* N (factorial (- N 1)))) + +(define prime? + {number --> boolean} + 2 -> true + N -> false where (even? N) + N -> (prime-h N (isqrt N) 3)) + +(define prime-h + {number --> number --> number --> boolean} + _ Sqrt Div -> true where (> Div Sqrt) + N Sqrt Div -> false where (integer? (/ N Div)) + N Sqrt Div -> (prime-h N Sqrt (+ Div 2))) + +(define sign + {number --> number} + 0 -> 0 + N -> 1 where (positive? N) + _ -> -1) + +(define log + {number --> number --> number --> number} + N Base Tolerance -> (/ (log10 N Tolerance) (log10 Base Tolerance))) + +(define loge + {number --> number --> number} + N Tolerance -> (log N (e) Tolerance)) + +(define log2 + {number --> number --> number} + N Tolerance -> (log N 2 Tolerance)) + +(define log10 + {number --> number --> number} + N Tolerance -> (if (>= N 1) + (log10+ N Tolerance) + (~ (log10+ (/ 1 N) Tolerance)))) + +(define log10+ + {number --> number --> number} + Zero Tolerance -> 0 where (<= (abs Zero) Tolerance) + N Tolerance -> (+ 1 (log10+ (/ N 10) Tolerance)) where (>= N 10) + N Tolerance -> (* 0.1 (log10+ (power N 10) (* 10 Tolerance)))) + +(define upto + {A --> (A --> boolean) --> (A --> A) + --> (B --> C --> C) --> C --> (A --> B) --> C} + N Stop? _ _ End _ -> End where (Stop? N) + N Stop? Step Constructor End F -> (Constructor (F N) (upto (Step N) Stop? Step Constructor End F))) ) \ No newline at end of file diff --git a/kernel/stlib/Maths/numerals.dtype b/kernel/stlib/Maths/numerals.dtype new file mode 100644 index 0000000..5d8f9dd --- /dev/null +++ b/kernel/stlib/Maths/numerals.dtype @@ -0,0 +1,47 @@ +(package numerals (append (external maths) [numeral? numeral radix n#->ns n# n#->n]) + + (define n# + N Radix -> (let Vector (absvector 4) + PrintV (address-> Vector 0 print-numeral) + NumbersV (address-> Vector 1 (n->numeral N Radix)) + BaseV (address-> Vector 2 Radix) + NV (address-> Vector 3 N) + Vector) where (and (natural? N) (natural? Radix) (> Radix 0)) + N Radix -> (error "N = ~A, Radix = ~A; N and Radix must be natural numbers where Radix > 0~%" + N Radix)) + + (define radix + Numeral -> (<-address Numeral 2)) + + (define numerals + Numeral -> (<-address Numeral 1)) + + (define n#->n + Numeral -> (<-address Numeral 3)) + + (declare radix [numeral --> number]) + (declare n#->ns [numeral --> [list number]]) + (declare n#->n [numeral --> number]) + (declare n# [number --> [number --> numeral]]) + (declare numeral? [A --> boolean]) + + (define n#->ns + Numeral -> (<-address Numeral 1)) + + (define print-numeral + Numeral -> (let Base (radix Numeral) + Ns (numerals Numeral) + (@s (numeric->string Ns Base) "#" (str Base)))) + + (define numeric->string + {(list number) --> number --> string} + [] _ -> "" + [N | Ns] Base -> (let Char (cases (< N 10) (str N) + (> Base 36) (cn (str N) " ") + true (n->string (+ N 55))) + (cn Char (numeric->string Ns Base)))) + + (define numeral? + Num -> (and (absvector? Num) (= print-numeral (<-address Num 0)))) + + ) \ No newline at end of file diff --git a/kernel/stlib/Maths/numerals.shen b/kernel/stlib/Maths/numerals.shen new file mode 100644 index 0000000..92d89cf --- /dev/null +++ b/kernel/stlib/Maths/numerals.shen @@ -0,0 +1,91 @@ +(package numerals [hex octal duodecimal binary + n-op2 n-op1 n+ n- n* n/ + | (append (external numerals) (external maths))] + +(defmacro numeral-macro + [n-op2 Op M N] -> [n-op2 Op M N [radix M]] + [n-op1 Op M] -> [n-op1 Op M [radix M]] + [n+ M N] -> [n+ M N [radix M]] + [n- M N] -> [n- M N [radix M]] + [n* M N] -> [n* M N [radix M]] + [n/ M N] -> [n/ M N [radix M]]) + +(define n-op2 + {(number --> number --> number) --> numeral --> numeral --> number --> numeral} + Op M N Base -> (n# (Op (n#->n M) (n#->n N)) Base)) + +(define n-op1 + {(number --> number) --> numeral --> number --> numeral} + Op M Base -> (n# (Op (n#->n M)) Base)) + +(define n+ + {numeral --> numeral --> number --> numeral} + M N Base -> (n-op2 (fn +) M N Base)) + +(define n* + {numeral --> numeral --> number --> numeral} + M N Base -> (n-op2 (fn *) M N Base)) + +(define n- + {numeral --> numeral --> number --> numeral} + M N Base -> (n-op2 (fn -) M N Base)) + +(define n/ + {numeral --> numeral --> number --> numeral} + M N Base -> (n-op2 (fn /) M N Base)) + +(define binary + {number --> numeral} + N -> (n# N 2)) + +(define hex + {number --> numeral} + N -> (n# N 16)) + +(define octal + {number --> numeral} + N -> (n# N 8)) + +(define duodecimal + {number --> numeral} + N -> (n# N 12)) + +(define n->numeral + {number --> number --> (list number)} + N Base -> [N] where (> Base N) + N Base -> (let E (largest-expt N Base 0) + Unit (power Base E) + D (div N Unit) + Numeral [D | (n-zeros E)] + Remainder (- N (* D Unit)) + (add Numeral (n->numeral Remainder Base) Base))) + +(define largest-expt + {number --> number --> number --> number} + N Base Expt -> (- Expt 1) where (> (power Base Expt) N) + N Base Expt -> (largest-expt N Base (+ Expt 1))) + +(define n-zeros + {number --> (list number)} + 0 -> [] + N -> [0 | (n-zeros (- N 1))]) + +(define add + {(list number) --> (list number) --> number --> (list number)} + L1 L2 Base -> (reverse (add-h (reverse L1) (reverse L2) Base 0))) + +(define add-h + {(list number) --> (list number) --> number --> number --> (list number)} + [] [] _ 0 -> [] + [] [] _ Carry -> [Carry] + [] L2 Base Carry -> (add-h [0] L2 Base Carry) + L1 [] Base Carry -> (add-h L1 [0] Base Carry) + [N1 | L1] [N2 | L2] Base Carry -> (let M (+ N1 N2 Carry) + (if (< M Base) + [M | (add-h L1 L2 Base 0)] + [(- Base M) | (add-h L1 L2 Base 1)]))) + + ) + + + \ No newline at end of file diff --git a/kernel/stlib/Maths/rationals.dtype b/kernel/stlib/Maths/rationals.dtype new file mode 100644 index 0000000..5d81aac --- /dev/null +++ b/kernel/stlib/Maths/rationals.dtype @@ -0,0 +1,31 @@ +(package rational [r# rational? rational numerator denominator] + +(define r# + N D -> (let V (absvector 3) + PrintF (address-> V 0 print-rational) + Numerator (address-> V 1 N) + Denominator (address-> V 2 D) + V) where (and (integer? N) (integer? D)) + N D -> (error "numerator ~S and divisor ~S must be integers~%" N D)) + +(define print-rational + V -> (make-string "~S/~S" (<-address V 1) (<-address V 2))) + +(define rational? + R -> (trap-error (and (absvector? R) + (= (<-address R 0) print-rational) + (integer? (<-address R 1)) + (integer? (<-address R 2))) (/. E false))) + +(define numerator + V -> (<-address V 1)) + +(define denominator + V -> (<-address V 2)) + +(declare r# [number --> [number --> rational]]) +(declare rational? [A --> boolean]) +(declare numerator [rational --> number]) +(declare denominator [rational --> number]) ) + + \ No newline at end of file diff --git a/kernel/stlib/Maths/rationals.shen b/kernel/stlib/Maths/rationals.shen new file mode 100644 index 0000000..7e00b01 --- /dev/null +++ b/kernel/stlib/Maths/rationals.shen @@ -0,0 +1,126 @@ +(package rational (append [r-reduce r= r< r> r>= r<= r+ r- r* r/ r-expr +-inverse *-inverse + r-expt r->n r->pair n->r maths.n->r r-approx maths.lcd-loop + r-op1 r-op2] + (external rational) + (external maths)) + +(define r-op1 + {(number --> number) --> rational --> rational} + F R -> (n->r (F (r->n R)))) + +(define r-op2 + {(number --> number --> number) --> rational --> rational --> rational} + F R1 R2 -> (n->r (F (r->n R1) (r->n R2)))) + +(define r->n + {rational --> number} + R -> (/ (numerator R) (denominator R))) + +(define r->pair + {rational --> (number * number)} + R -> (@p (numerator R) (denominator R))) + +(define n->r + {number --> rational} + N -> (let Pair (maths.n->r N 1) + (r# (fst Pair) (snd Pair)))) + +(define r-reduce + {rational --> rational} + R -> (r-reduce-help (numerator R) (denominator R))) + +(define r-reduce-help + {number --> number --> rational} + N D -> (let LCD (lcd N D) + (if (= LCD 1) + (r# N D) + (r-reduce-help (/ N LCD) (/ D LCD))))) + +(define r= + {rational --> rational --> boolean} + R1 R2 -> (let A (numerator R1) + B (denominator R1) + C (numerator R2) + D (denominator R2) + (= (* A D) (* B C)))) + +(define r< + {rational --> rational --> boolean} + R1 R2 -> (let A (numerator R1) + B (denominator R1) + C (numerator R2) + D (denominator R2) + (< (* A D) (* B C)))) + +(define r> + {rational --> rational --> boolean} + R1 R2 -> (not (or (r= R1 R2) (r< R1 R2)))) + +(define r>= + {rational --> rational --> boolean} + R1 R2 -> (or (r= R1 R2) (r> R1 R2))) + +(define r<= + {rational --> rational --> boolean} + R1 R2 -> (or (r= R1 R2) (r< R1 R2))) + +(define r+ + {rational --> rational --> rational} + R1 R2 -> (let A (numerator R1) + B (denominator R1) + C (numerator R2) + D (denominator R2) + (r# (+ (* A D) (* B C)) (* B D)))) + +(define r- + {rational --> rational --> rational} + R1 R2 -> (let A (numerator R1) + B (denominator R1) + C (numerator R2) + D (denominator R2) + (r# (- (* A D) (* B C)) (* B D)))) + +(define r* + {rational --> rational --> rational} + R1 R2 -> (let A (numerator R1) + B (denominator R1) + C (numerator R2) + D (denominator R2) + (r# (* A C) (* B D)))) + +(define +-inverse + {rational --> rational} + R -> (let A (numerator R) + B (denominator R) + (r# (~ A) B))) + +(define *-inverse + {rational --> rational} + R -> (let A (numerator R) + B (denominator R) + (r# B A))) + +(define r/ + {rational --> rational --> rational} + R1 R2 -> (r* R1 (*-inverse R2))) + +(define r-expt + {rational --> number --> rational} + R N -> (let A (numerator R) + B (denominator R) + (r# (power A N) (power B N))) where (natural? N) + R N -> (let A (numerator R) + B (denominator R) + (r# (power B (~ N)) (power A (~ N)))) where (and (integer? N) (negative? N)) + _ N -> (error "cannot exponentiate a rational by a non-integer ~A~%" N)) + +(define r-approx + {rational --> number --> rational} + R D -> (approx-r-h (r->n R) D 0)) + +(define approx-r-h + {number --> number --> number --> rational} + Value D N -> (r# N D) where (> (/ N D) Value) + Value D N -> (approx-r-h Value D (+ N 1))) + + ) \ No newline at end of file diff --git a/kernel/stlib/PROVENANCE.md b/kernel/stlib/PROVENANCE.md new file mode 100644 index 0000000..2964e4c --- /dev/null +++ b/kernel/stlib/PROVENANCE.md @@ -0,0 +1,63 @@ +# Standard library provenance + +These are Mark Tarver's **S41.2 (2026-07-11 refresh)** standard-library +sources — the `Lib/StLib` tree of the refreshed Shen release. They are the +stdlib **source of truth** for this port, loaded at boot by +`crates/shen-rust/src/interp/boot.rs` (`load_stlib`), which runs upstream's +`install.shen`. This **retires the old community `stlib.kl` overlay** +(pre-compiled KLambda) that the port previously vendored under +`kernel/klambda/`. + +## Why sources, not the compiled overlay + +The community `ShenOSKernel-41.2` shipped the stdlib as a pre-compiled +`stlib.kl`. Installing those `defun`s bypassed the kernel's `load`/`define` +path, so stdlib functions ended up with the "unknown" arity `-1`: bare +`(fn filter)` and top-level `(filter …)` failed with +`fn: filter is undefined`. Loading the `.shen` sources through the real +`load` (as upstream's `install.shen` does) registers correct arities and +package namespacing, fixing that. Regression: +`crates/shen-rust/tests/library.rs::stdlib_loaded_from_source_has_real_arities`. + +## Canonical source + +- Repo: `pyrex41/shen-upstream` (the designated mirror of Tarver's uploads; + formerly `pyrex41/shen-s41.1` — old URLs redirect) +- Tag: `s41.2-pristine-20260711` +- Commit: `11fc51bdf53a4dcb505adeec6ec8352754cbe50f` +- Path in mirror: `Lib/StLib/` + +All files here are `diff`-verified byte-identical to that path at that tag +(22 files). Original upstream: the `Lib/StLib` directory of +`https://www.shenlanguage.org/Download/S41.2.zip` (Last-Modified +2026-07-11, zip sha256 `51becbf…3ee836`; see +`../klambda/PROVENANCE.md`). + +## What is vendored + +Exactly the files `install.shen` loads (plus `install.shen` and +`package-stlib.shen`): `Symbols/`, `Maths/` (incl. the `.dtype` +datatypes), `Lists/`, `Strings/`, `Vectors/`, `IO/`, `Tuples/`. The +StLib extras not referenced by `install.shen` (`Calendar/`, `Data/`, +`Maths/r.shen`, `Strings/regex.shen`, `Strings/smartmem.shen`) are **not** +vendored. + +## Load mechanism + +`load_stlib` rewrites `install.shen`'s relative `(load "…")` paths to +absolute paths under this directory (into a per-boot temp file) and loads +that, so no process-cwd mutation is needed and concurrent interpreter +boots stay re-entrant. The load runs under `*hush*` to keep the per-file +"…loaded"/type-signature chatter off the boot path. + +Note: package-internal (non-exported) stdlib functions are namespaced — +e.g. `reduce` lives inside `(package list …)` and is reachable as +`list.reduce`, not bare `reduce`. Exported names (`filter`, `sq`, …) are +global. Because exported stdlib functions become **system functions**, a +user `(define …)` over one is refused by the kernel (as on shen-cl). + +## Follow-up + +`shen_boot_embedded` (shenffi, no-filesystem iOS path) does not yet bundle +these sources, so that path brings up the kernel without the stdlib — +embedding the StLib sources for the no-fs boot is future work. diff --git a/kernel/stlib/README.txt b/kernel/stlib/README.txt new file mode 100644 index 0000000..a133f38 --- /dev/null +++ b/kernel/stlib/README.txt @@ -0,0 +1 @@ +to install the standard library, cd in Shen to this directory and enter install.shen \ No newline at end of file diff --git a/kernel/stlib/Strings/macros.shen b/kernel/stlib/Strings/macros.shen new file mode 100644 index 0000000..e00e9e7 --- /dev/null +++ b/kernel/stlib/Strings/macros.shen @@ -0,0 +1,3 @@ +(defmacro string-macros + [s-op1 F S] -> [s-op1 F S [/. (protect X) (protect X)]] + [s-op2 F S1 S2] -> [s-op2 F S1 S2 [/. (protect X) (protect X)]]) diff --git a/kernel/stlib/Strings/smart.shen b/kernel/stlib/Strings/smart.shen new file mode 100644 index 0000000..30b86f9 --- /dev/null +++ b/kernel/stlib/Strings/smart.shen @@ -0,0 +1,60 @@ +(package string [render-file render string->list file-extension whitespace?] + +(declare render [string --> string]) +(declare render-file [string --> [string --> string]]) + +(define render-file + File Extension -> (let Bytes (read-file-as-bytelist File) + Strings (bytes->strings Bytes []) + Render (compile (fn ) Strings) + Out (file-extension File Extension) + Write (write-to-file Out Render) + Out)) + +(define bytes->strings + [] Strings -> (reverse Strings) + [Byte | Bytes] Strings -> (bytes->strings Bytes [(n->string Byte) | Strings])) + +(define render + String -> (compile (fn ) (string->list String))) + +(define rendered? + "" -> true + (@s "{" _) -> false + (@s _ S) -> (rendered? S)) + +(defcc + "{" "}" := (cn (recapply (fn (intern )) ) ); + "{" "}" := (cn ((intern )) ); + := (cn ); + := "";) + +(defcc + S := S where (and (not (= S "}")) (not (= S "\")));) + +(define recapply + X [] -> X + Fn [X | Y] -> (recapply (Fn X) Y)) + +(defcc + "\" := [ | ]; + := [];) + +(defcc + ;) + +(defcc + Char := Char where (and (not (= Char "}")) + (not (= Char "\")));) + +(defcc + W := skip where (whitespace? W);) + +(defcc + := (cn ); + := "";) + +(defcc + Char := Char where (and (not (= Char "}")) + (not (= Char "\")) + (not (whitespace? Char)));)) \ No newline at end of file diff --git a/kernel/stlib/Strings/strings.shen b/kernel/stlib/Strings/strings.shen new file mode 100644 index 0000000..957ede8 --- /dev/null +++ b/kernel/stlib/Strings/strings.shen @@ -0,0 +1,300 @@ +(package string (append [s-op1 s-op2 string.reverse string.element? + string.infix? string.suffix? string.prefix? string.length string.difference + string.intersection string.nth whitespace? + lowercase? uppercase? digit? alpha? alphanum? + string.subset? string.set=? string.set? string.nth + string.trim string.trim-right string.trim-left + tokenise list->string string->list string.trim-left-if + string.trim-right-if string.trim-if uppercase lowercase + string.map file-extension strip-extension string.count + spell-number string>? string=? string<=? + string.some? string.every?] + (external list)) + +(define string->list + {string --> (list string)} + "" -> [] + S -> (s->l-h S 1 (pos S 0) [])) + +(define s->l-h + {string --> number --> string --> (list string) --> (list string)} + S N "" L -> (reverse L) + S N Char L -> (s->l-h S (+ N 1) (trap-error (pos S N) (/. E "")) [Char | L])) + +(define list->string + {(list string) --> string} + [] -> "" + [S | Ss] -> (cn S (list->string Ss))) + +(define s-op1 + {((list string) --> A) --> string --> (A --> B) --> B} + F S C -> (C (F (string->list S)))) + +(define s-op2 + {((list string) --> (list string) --> A) --> string --> string --> (A --> B) --> B} + F S1 S2 C -> (C (F (string->list S1) (string->list S2)))) + +(define string.count + {string --> string --> number} + _ "" -> 0 + S (@s S Ss) -> (+ 1 (string.count S Ss)) + S (@s _ Ss) -> (string.count S Ss)) + +(define string.reverse + {string --> string} + S -> (s-op1 (fn reverse) S (fn list->string))) + +(define string.element? + {string --> string --> boolean} + Char S -> (s-op1 (/. X (element? Char X)) S)) + +(define string.prefix? + {string --> string --> boolean} + S1 S2 -> (s-op2 (fn prefix?) S1 S2)) + +(define string.infix? + {string --> string --> boolean} + S1 S2 -> (s-op2 (fn infix?) S1 S2)) + +(define string.suffix? + {string --> string --> boolean} + S1 S2 -> (s-op2 (fn suffix?) S1 S2)) + +(define string.subset? + {string --> string --> boolean} + S1 S2 -> (s-op2 (fn subset?) S1 S2)) + +(define string.set=? + {string --> string --> boolean} + S1 S2 -> (s-op2 (fn set=?) S1 S2)) + +(define string.set? + {string --> boolean} + S -> (s-op1 (fn set?) S)) + +(define file-extension + {string --> string --> string} + Path Extension -> (cn (strip-extension Path) Extension)) + +(define strip-extension + {string --> string} + "" -> "" + (@s "." _) -> "" + (@s S Ss) -> (@s S (strip-extension Ss))) + +(define string.length + {string --> number} + S -> (s-op1 (fn length) S)) + +(define string.trim + {(list string) --> string --> string} + L S -> (s-op1 (trim L) S (fn list->string))) + +(define string.trim-if + {(string --> boolean) --> string --> string} + P S -> (s-op1 (trim-if P) S (fn list->string))) + +(define string.trim-right-if + {(string --> boolean) --> string --> string} + P S -> (s-op1 (trim-right-if P) S (fn list->string))) + +(define string.trim-left-if + {(string --> boolean) --> string --> string} + P S -> (s-op1 (trim-left-if P) S (fn list->string))) + +(define string.trim-right + {(list string) --> string --> string} + L S -> (s-op1 (trim-right L) S (fn list->string))) + +(define string.trim-left + {(list string) --> string --> string} + L S -> (s-op1 (trim-left L) S (fn list->string))) + +(define string.some? + {(string --> boolean) --> string --> boolean} + _ "" -> false + F (@s S Ss) -> (or (F S) (string.some? F Ss))) + +(define string.every? + {(string --> boolean) --> string --> boolean} + _ "" -> true + F (@s S Ss) -> (and (F S) (string.every? F Ss))) + +(define string.difference + {string --> string --> string} + S1 S2 -> (s-op2 (fn difference) S1 S2 (fn list->string))) + +(define string.intersection + {string --> string --> string} + S1 S2 -> (s-op2 (fn intersection) S1 S2 (fn list->string))) + +(define string.nth + {number --> string --> string} + N S -> (pos S (+ N 1))) + +(define whitespace? + {string --> boolean} + (@s S _) -> (let N (string->n S) + (element? N [9 10 13 32]))) + +(define uppercase? + {string --> boolean} + (@s S _) -> (let N (string->n S) + (and (> N 64) (< N 91)))) + +(define lowercase? + {string --> boolean} + (@s S _) -> (let N (string->n S) + (and (> N 96) (< N 123)))) + +(define digit? + {string --> boolean} + (@s S _) -> (let N (string->n S) + (and (> N 47) (< N 58)))) + +(define alpha? + {string --> boolean} + (@s S _) -> (let N (string->n S) + (or (and (> N 64) (< N 91)) + (and (> N 96) (< N 123)))) + _ -> false) + +(define alphanum? + {string --> boolean} + (@s S _) -> (let N (string->n S) + (or (and (> N 64) (< N 91)) + (and (> N 96) (< N 123)) + (and (> N 47) (< N 58)))) + _ -> false) + +(define tokenise + {(string --> boolean) --> string --> (list string)} + P S -> (tokenise-h P S "")) + +(define tokenise-h + {(string --> boolean) --> string --> string --> (list string)} + _ "" S -> [S] + P (@s S Ss) Token -> [Token | (tokenise-h P Ss "")] where (P S) + P (@s S Ss) Token -> (tokenise-h P Ss (@s Token S))) + +(define uppercase + {string --> string} + (@s S Ss) -> (if (lowercase? S) + (@s (n->string (- (string->n S) 32)) Ss) + (@s S Ss))) + +(define lowercase + {string --> string} + (@s S Ss) -> (if (uppercase? S) + (@s (n->string (+ (string->n S) 32)) Ss) + (@s S Ss))) + +(define string.map + {(string --> string) --> string --> string} + _ "" -> "" + F (@s S Ss) -> (@s (F S) (string.map F Ss))) + +(define spell-number + {number --> string} + 0 -> "zero" + N -> (scale (map (fn digits) (triples (explode N))))) + +(define digit + {string --> string} + "0" -> "" + "1" -> "one" + "2" -> "two" + "3" -> "three" + "4" -> "four" + "5" -> "five" + "6" -> "six" + "7" -> "seven" + "8" -> "eight" + "9" -> "nine") + +(define triples + {(list A) --> (list (list A))} + L -> (triples-h (reverse L) [])) + +(define triples-h + {(list A) --> (list (list A)) --> (list (list A))} + [W X Y | Z] Triples -> (triples-h Z [(reverse [W X Y]) | Triples]) + X Triples -> [(reverse X) | Triples]) + +(define digits + {(list string) --> string} + ["0" "0" "0"] -> "" + [N "0" "0"] -> (@s (digit N) " " "hundred") + ["0" "0" N] -> (@s "and" " " (digit N)) + ["0" N N'] -> (@s "and" " " (tens N N')) + [N "0" N'] -> (@s (digit N) " " "hundred" " " "and" " " (digit N')) + [N N' N''] -> (@s (digit N) " " "hundred" " " "and" " " (tens N' N'')) + [N N'] -> (tens N N') + [N] -> (digit N) + [] -> "") + +(define tens + {string --> string --> string} + "1" N -> (cases (= N "0") "ten" + (= N "1") "eleven" + (= N "2") "twelve" + (= N "3") "thirteen" + (= N "4") "fourteen" + (= N "5") "fifteen" + (= N "6") "sixteen" + (= N "7") "seventeen" + (= N "8") "eighteen" + (= N "9") "nineteen") + "2" N -> (@s "twenty" " " (digit N)) + "3" N -> (@s "thirty" " " (digit N)) + "4" N -> (@s "forty" " " (digit N)) + "5" N -> (@s "fifty" " " (digit N)) + "6" N -> (@s "sixty" " " (digit N)) + "7" N -> (@s "seventy" " " (digit N)) + "8" N -> (@s "eighty" " " (digit N)) + "9" N -> (@s "ninety" " " (digit N))) + +(define scale + {(list string) --> string} + [S] -> S + ["" | Ss] -> (scale Ss) + [S | Ss] -> (@s S (units (length [S | Ss])) (scale Ss))) + +(define units + {number --> string} + 2 -> " thousand " + 3 -> " million " + 4 -> " billion " + 5 -> " trillion " + _ -> (error "this number has a magnitude beyond our text representation")) + +(define string>? + {string --> string --> boolean} + "" _ -> false + _ "" -> true + (@s S Ss) (@s S* S*s) -> (let SN (string->n S) + S*N (string->n S*) + (cases (> SN S*N) true + (< SN S*N) false + true (string>? Ss S*s)))) + +(define string string --> boolean} + _ "" -> false + "" _ -> true + (@s S Ss) (@s S* S*s) -> (let SN (string->n S) + S*N (string->n S*) + (cases (< SN S*N) true + (> SN S*N) false + true (string=? + {string --> string --> boolean} + S S* -> (or (= S S*) (string>? S S*))) + +(define string<=? + {string --> string --> boolean} + S S* -> (or (= S S*) (string (let S1+S2 (concat S1 S2) + (if (symbol? S1+S2) + S1+S2 + (error "'~A' is not a symbol~%" S1+S2)))) + +(declare concat* [A --> [B --> symbol]]) ) + diff --git a/kernel/stlib/Symbols/symbols2.shen b/kernel/stlib/Symbols/symbols2.shen new file mode 100644 index 0000000..a880070 --- /dev/null +++ b/kernel/stlib/Symbols/symbols2.shen @@ -0,0 +1,9 @@ +(package symbol [newv | (external symbol)] + +(define newv + {--> symbol} + -> (gensym (protect X))) + + + + ) diff --git a/kernel/stlib/Tuples/tuples.shen b/kernel/stlib/Tuples/tuples.shen new file mode 100644 index 0000000..a9c77e1 --- /dev/null +++ b/kernel/stlib/Tuples/tuples.shen @@ -0,0 +1,30 @@ +(package tuple [pairoff assocp cartprodp assocp-if assocp-if-not] + + (define pairoff + {(list A) --> (list B) --> (list (A * B))} + [] _ -> [] + _ [] -> [] + [X | Y] [W | Z] -> [(@p X W) | (pairoff Y Z)]) + + (define assocp + {A --> (list (A * B)) --> (A * B)} + _ [] -> (error "pair not found~%") + X [(@p X Y) | _] -> (@p X Y) + X [_ | Pairs] -> (assocp X Pairs)) + + (define cartprodp + {(list A) --> (list B) --> (list (A * B))} + [] _ -> [] + [X | Y] Z -> (append (map (/. W (@p X W)) Z) (cartprodp Y Z))) + + (define assocp-if + {(A --> boolean) --> (list (A * B)) --> (A * B)} + _ [] -> (error "pair not found~%") + F? [(@p X Y) | _] -> (@p X Y) where (F? X) + F? [_ | Pairs] -> (assocp-if F? Pairs)) + + (define assocp-if-not + {(A --> boolean) --> (list (A * B)) --> (A * B)} + _ [] -> (error "pair not found~%") + F? [(@p X Y) | _] -> (@p X Y) where (not (F? X)) + F? [_ | Pairs] -> (assocp-if-not F? Pairs)) ) \ No newline at end of file diff --git a/kernel/stlib/Vectors/macros.shen b/kernel/stlib/Vectors/macros.shen new file mode 100644 index 0000000..f057f0d --- /dev/null +++ b/kernel/stlib/Vectors/macros.shen @@ -0,0 +1,26 @@ +(package vector [newv array for to] + +(defmacro vector-macros + + \\ read access + [:= V [cons I []]] -> [<-vector V I] + + [:= V [cons I Is]] -> [:= [<-vector V I] Is] + + \\ write access + [V [cons I []] := X] -> [vector-> V I X] + + [V [cons I Is] := X] -> (let V2 (newv) + [let V2 [<-vector V I] + [V2 Is := X]]) + \\ array construction + [array [cons Dim []]] -> [vector Dim] + [array [cons Dim Dims]] + -> (let V (newv) + N (newv) + [let V [vector Dim] + [do [for N = 1 to Dim + [vector-> V N [array Dims]]] + V]]))) + + \ No newline at end of file diff --git a/kernel/stlib/install.shen b/kernel/stlib/install.shen new file mode 100644 index 0000000..b993cca --- /dev/null +++ b/kernel/stlib/install.shen @@ -0,0 +1,51 @@ + +(load "Symbols/symbols1.shen") +(tc +) +(load "Symbols/symbols2.shen") +(tc -) +(factorise +) +(load "Maths/macros.shen") +(factorise -) +(tc +) +(load "Maths/maths.shen") +(tc -) +(load "Maths/rationals.dtype") +(tc +) +(load "Maths/rationals.shen") +(tc -) +(load "Maths/complex.dtype") +(tc +) +(load "Maths/complex.shen") +(tc -) +(load "Maths/numerals.dtype") +(tc +) +(load "Maths/numerals.shen") +(load "Lists/lists.shen") +(load "Strings/macros.shen") +(load "Strings/strings.shen") +(tc -) +(load "Strings/smart.shen") +(factorise +) +(load "Vectors/macros.shen") +(factorise -) +(tc +) +(load "IO/prettyprint.shen") +(tc -) +(load "IO/delete-file.shen") +(tc +) +(load "IO/files.shen") +(load "Tuples/tuples.shen") +(tc -) +(load "package-stlib.shen") + +\\ all external functions of the standard library are declared as system functions +(let External (external stlib) + ExternalF (filter (/. X (> (arity X) -1)) External) + Systemf (map (fn systemf) ExternalF) + ok) + +(preclude-all-but []) +(set shen.*userdefs* []) +(cd "") +(tc -) + diff --git a/kernel/stlib/package-stlib.shen b/kernel/stlib/package-stlib.shen new file mode 100644 index 0000000..4980a48 --- /dev/null +++ b/kernel/stlib/package-stlib.shen @@ -0,0 +1,4 @@ +(package stlib (mapcan (fn external) + [list string maths vector symbol + tuple file print]) + void) \ No newline at end of file