@@ -76,6 +76,7 @@ pub fn generate_jets() -> Jets {
7676 (111192034817574564051316537756194881830, RIP),
7777 (194882429025651072335997865399571359986, RUN),
7878 (52890757765966568893620799383929397067, RUT),
79+ (189837220965666741450798472864087835815, SEW),
7980 ])
8081}
8182
@@ -802,3 +803,24 @@ static RUT: Jet = |ctx, n| {
802803
803804 Noun::list(target.iter().cloned().map(Noun::Atom))
804805};
806+
807+static SEW: Jet = |ctx, n| {
808+ let (a, b) = n.as_cell().unwrap();
809+ let (b, recipient) = b.as_cell().unwrap();
810+ let (sew_start, c) = b.as_cell().unwrap();
811+ let (number_of_blocks, donor) = c.as_cell().unwrap();
812+ let recipient = recipient.as_atom().unwrap();
813+ let donor = donor.as_atom().unwrap();
814+
815+ let bloq = a.as_u32().unwrap();
816+ let bits = 2u32.pow(bloq);
817+ let mask = ((&ctx.big_uints.one << (bits * number_of_blocks.as_u32().unwrap()))
818+ - &ctx.big_uints.one)
819+ << (sew_start.as_u32().unwrap() * bits);
820+
821+ let apendix = recipient & &mask;
822+
823+ let target = (recipient ^ apendix) | (donor & mask);
824+
825+ Rc::new(Noun::Atom(target))
826+};