From 73623745791a943a7cc87f4c5d69a21721841fb7 Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Fri, 27 Oct 2023 14:02:36 -0500 Subject: [PATCH 1/4] noun: We need a hack value for NONE until we figure out what to do about mint_ut --- rust/ares/src/noun.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ares/src/noun.rs b/rust/ares/src/noun.rs index 1e9849c..9d0c5da 100644 --- a/rust/ares/src/noun.rs +++ b/rust/ares/src/noun.rs @@ -39,7 +39,7 @@ const FORWARDING_MASK: u64 = CELL_MASK; /** Loobeans */ pub const YES: Noun = D(0); pub const NO: Noun = D(1); -pub const NONE: Noun = unsafe { DirectAtom::new_unchecked(u64::MAX).as_noun() }; +pub const NONE: Noun = unsafe { DirectAtom::new_unchecked(tas!(b"MORMAGIC").as_noun() }; #[cfg(feature = "check_acyclic")] #[macro_export] From 46275f51839f7532ed8265a5b44b8166596563e4 Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Fri, 27 Oct 2023 14:04:56 -0500 Subject: [PATCH 2/4] noun: lost paren --- rust/ares/src/noun.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ares/src/noun.rs b/rust/ares/src/noun.rs index 9d0c5da..27994fa 100644 --- a/rust/ares/src/noun.rs +++ b/rust/ares/src/noun.rs @@ -39,7 +39,7 @@ const FORWARDING_MASK: u64 = CELL_MASK; /** Loobeans */ pub const YES: Noun = D(0); pub const NO: Noun = D(1); -pub const NONE: Noun = unsafe { DirectAtom::new_unchecked(tas!(b"MORMAGIC").as_noun() }; +pub const NONE: Noun = unsafe { DirectAtom::new_unchecked(tas!(b"MORMAGIC")).as_noun() }; #[cfg(feature = "check_acyclic")] #[macro_export] From c214118c2da61f2b41835ba769411514dd420e6e Mon Sep 17 00:00:00 2001 From: Alex Shelkovnykov Date: Wed, 15 Nov 2023 13:15:40 +0100 Subject: [PATCH 3/4] jets: fix cache assignment bug --- rust/ares/src/jets/lute.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rust/ares/src/jets/lute.rs b/rust/ares/src/jets/lute.rs index ccf4393..f282d8b 100644 --- a/rust/ares/src/jets/lute.rs +++ b/rust/ares/src/jets/lute.rs @@ -31,7 +31,7 @@ pub fn jet_crop(context: &mut Context, subject: Noun) -> Result { Some(pro) => Ok(pro), None => { let pro = interpret(context, subject, slot(subject, 2)?)?; - context.cache.insert(&mut context.stack, &mut key, pro); + context.cache = context.cache = context.cache.insert(&mut context.stack, &mut key, pro); Ok(pro) } } @@ -61,7 +61,7 @@ pub fn jet_fish(context: &mut Context, subject: Noun) -> Result { Some(pro) => Ok(pro), None => { let pro = interpret(context, subject, slot(subject, 2)?)?; - context.cache.insert(&mut context.stack, &mut key, pro); + context.cache = context.cache.insert(&mut context.stack, &mut key, pro); Ok(pro) } } @@ -90,7 +90,7 @@ pub fn jet_ut_fuse(context: &mut Context, subject: Noun) -> Result { Some(pro) => Ok(pro), None => { let pro = interpret(context, subject, slot(subject, 2)?)?; - context.cache.insert(&mut context.stack, &mut key, pro); + context.cache = context.cache.insert(&mut context.stack, &mut key, pro); Ok(pro) } } @@ -112,7 +112,7 @@ pub fn jet_ut_mint(context: &mut Context, subject: Noun) -> Result { Some(pro) => Ok(pro), None => { let pro = interpret(context, subject, slot(subject, 2)?)?; - context.cache.insert(&mut context.stack, &mut key, pro); + context.cache = context.cache.insert(&mut context.stack, &mut key, pro); Ok(pro) } } @@ -143,7 +143,7 @@ pub fn jet_ut_mull(context: &mut Context, subject: Noun) -> Result { Some(pro) => Ok(pro), None => { let pro = interpret(context, subject, slot(subject, 2)?)?; - context.cache.insert(&mut context.stack, &mut key, pro); + context.cache = context.cache.insert(&mut context.stack, &mut key, pro); Ok(pro) } } @@ -181,7 +181,7 @@ pub fn jet_ut_nest(context: &mut Context, subject: Noun) -> Result { if unsafe { pro.raw_equals(YES) && reg.raw_equals(D(0)) } || unsafe { pro.raw_equals(NO) && seg.raw_equals(D(0)) } { - context.cache.insert(&mut context.stack, &mut key, pro); + context.cache = context.cache.insert(&mut context.stack, &mut key, pro); } Ok(pro) } @@ -211,7 +211,7 @@ pub fn jet_ut_rest(context: &mut Context, subject: Noun) -> Result { Some(pro) => Ok(pro), None => { let pro = interpret(context, subject, slot(subject, 2)?)?; - context.cache.insert(&mut context.stack, &mut key, pro); + context.cache = context.cache.insert(&mut context.stack, &mut key, pro); Ok(pro) } } From af7398133a00b9ca2f4f370dca4824c1183dbb19 Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Wed, 15 Nov 2023 06:23:24 -0600 Subject: [PATCH 4/4] jet_crop: fix doubled assignment to cache --- rust/ares/src/jets/lute.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ares/src/jets/lute.rs b/rust/ares/src/jets/lute.rs index f282d8b..966ff1d 100644 --- a/rust/ares/src/jets/lute.rs +++ b/rust/ares/src/jets/lute.rs @@ -31,7 +31,7 @@ pub fn jet_crop(context: &mut Context, subject: Noun) -> Result { Some(pro) => Ok(pro), None => { let pro = interpret(context, subject, slot(subject, 2)?)?; - context.cache = context.cache = context.cache.insert(&mut context.stack, &mut key, pro); + context.cache = context.cache.insert(&mut context.stack, &mut key, pro); Ok(pro) } }