wip: debugging stew

This commit is contained in:
Matthew LeVan 2023-12-09 10:25:24 -05:00
parent 1b26b00dc2
commit dd13cba5df
2 changed files with 17 additions and 13 deletions

View File

@ -454,19 +454,19 @@ pub const URBIT_HOT_STATE: &[HotEntry] = &[
jet_stir,
),
//
// (
// &[
// K_139,
// Left(b"one"),
// Left(b"two"),
// Left(b"tri"),
// Left(b"qua"),
// Left(b"stew"),
// Left(b"fun"),
// ],
// 1,
// jet_stew,
// ),
(
&[
K_139,
Left(b"one"),
Left(b"two"),
Left(b"tri"),
Left(b"qua"),
Left(b"stew"),
Left(b"fun"),
],
1,
jet_stew,
),
//
(
&[

View File

@ -292,6 +292,7 @@ pub fn jet_stir(context: &mut Context, subject: Noun) -> Result {
}
fn stew_wor(ort: Noun, wan: Noun) -> result::Result<bool, JetErr> {
eprintln!("stew_wor\r");
if !ort.as_atom()?.is_direct() {
return Err(JetErr::Fail(Error::Deterministic(D(0))));
} else {
@ -301,6 +302,7 @@ fn stew_wor(ort: Noun, wan: Noun) -> result::Result<bool, JetErr> {
} else {
let ort_dat = ort.as_direct()?.data();
let wan_dat = wan.as_direct()?.data();
eprintln!("stew wor: done\r");
return Ok(ort_dat < wan_dat);
}
} else {
@ -311,6 +313,7 @@ fn stew_wor(ort: Noun, wan: Noun) -> result::Result<bool, JetErr> {
} else {
let ort_dat = ort.as_direct()?.data();
let h_wan_dat = h_wan.as_direct()?.data();
eprintln!("stew wor: done\r");
return Ok(ort_dat < h_wan_dat);
}
}
@ -361,6 +364,7 @@ pub fn jet_stew(context: &mut Context, subject: Noun) -> Result {
}
if bit {
eprintln!("jet_stew: bit slam\r");
return slam(context, qn_hel, tub);
} else {
if stew_wor(iq_tub, pn_hel)? {