Skip to content

Commit

Permalink
jets: add jet for cap
Browse files Browse the repository at this point in the history
  • Loading branch information
ashelkovnykov committed Aug 24, 2023
1 parent 25f955d commit 15ae896
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hoon/scaffolding/cradle.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,20 @@
?: =(0 b) ~
[(end a b) $(b (rsh a b))]
::
:: Tree addressing
::
:: :: index in head or tail
++ cap :: %2 if in head
~/ %cap :: %3 if in teail
|= a=@
~> %sham.%cap
^- ?(%2 %3)
?- a
%2 %2
%3 %3
?(%0 %1) !!
* $(a (div a 2))
==
::
:: Lists
::
Expand Down
5 changes: 5 additions & 0 deletions rust/ares/src/jets.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
pub mod math;
pub mod mink;
pub mod tree;

use crate::jets::math::*;
use crate::jets::mink::*;
use crate::jets::tree::*;
use crate::mem::NockStack;
use crate::newt::Newt;
use crate::noun::{self, Noun, Slots};
Expand Down Expand Up @@ -66,6 +68,9 @@ pub fn get_jet(jet_name: Noun) -> Option<Jet> {
tas!(b"met") => Some(jet_met),
tas!(b"mug") => Some(jet_mug),
tas!(b"rev") => Some(jet_rev),
//
tas!(b"cap") => Some(jet_cap),
//
tas!(b"mink") => Some(jet_mink),
_ => {
// eprintln!("Unknown jet: {:?}", jet_name);
Expand Down

0 comments on commit 15ae896

Please sign in to comment.