@@ -9,7 +9,7 @@ use std::{
99
1010use crate::{
1111 interpreter::{slam, InterpreterContext},
12− noun::{self, cell, Atom, Noun},
12+ noun::{self, cell, Atom, Bite, Noun},
1313};
1414
1515pub type Jets = BTreeMap<noun::Hash, Jet>;
@@ -67,6 +67,7 @@ pub fn generate_jets() -> Jets {
6767 (88906713429699361214497715048276521868, CAT),
6868 (194217032002582779752566874231896746840, MET),
6969 (132848439781269254342687684309700447927, CUT),
70+ (184331043431916214773639930303095454137, FIL),
7071 ])
7172}
7273
@@ -638,3 +639,22 @@ static CUT: Jet = |ctx, n| {
638639 (d.as_atom().unwrap() >> (bits * b.as_u32().unwrap())) & mask,
639640 ))
640641};
642+
643+static FIL: Jet = |ctx, n| {
644+ let (a, b) = n.as_cell().unwrap();
645+ let (b, c) = b.as_cell().unwrap();
646+
647+ let bits = 2u32.pow(a.as_u32().unwrap());
648+
649+ let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
650+
651+ let src = c.as_atom().unwrap() & mask;
652+
653+ let mut target = ctx.big_uints.zero.clone();
654+
655+ for _ in 0..b.as_u32().unwrap() {
656+ target = (target << bits) | &src;
657+ }
658+
659+ Rc::new(Noun::Atom(target))
660+};