@@ -8,7 +8,7 @@ use std::{
88};
99
1010use crate::{
11− interpreter::{slam_pulled_gate, InterpreterContext, Tanks},
11+ interpreter::{slam_pulled_gate, InterpreterContext, TTanks},
1212 noun::{self, cell, Atom, Edge, Hair, Nail, Noun},
1313};
1414
@@ -110,15 +110,15 @@ pub fn generate_jets() -> Jets {
110110 ])
111111}
112112
113−pub type Jet = fn(ctx: &mut InterpreterContext, &Rc<Noun>) -> Result<Rc<Noun>, Tanks>;
113+pub type Jet = fn(ctx: &mut InterpreterContext, &Rc<Noun>) -> Result<Rc<Noun>, TTanks>;
114114pub type DoubleJet = fn(ctx: &mut InterpreterContext, &Rc<Noun>, &Rc<Noun>) -> Option<Rc<Noun>>;
115115
116−static BINARY_ATOM: fn(&Rc<Noun>, fn(&Atom, &Atom) -> Atom) -> Result<Rc<Noun>, Tanks> =
116+static BINARY_ATOM: fn(&Rc<Noun>, fn(&Atom, &Atom) -> Atom) -> Result<Rc<Noun>, TTanks> =
117117 |n: &Rc<Noun>, f: fn(&Atom, &Atom) -> Atom| {
118− let (p, q) = n.as_cell().ok_or(Tanks::new())?;
118+ let (p, q) = n.as_cell().ok_or(TTanks::new())?;
119119 Ok(Rc::new(Noun::Atom(f(
120− p.as_atom().ok_or(Tanks::new())?,
121− q.as_atom().ok_or(Tanks::new())?,
120+ p.as_atom().ok_or(TTanks::new())?,
121+ q.as_atom().ok_or(TTanks::new())?,
122122 ))))
123123 };
124124
@@ -126,13 +126,13 @@ static BINARY_ATOM_LOOB: fn(
126126 &InterpreterContext,
127127 &Rc<Noun>,
128128 fn(&Atom, &Atom) -> bool,
129−) -> Result<Rc<Noun>, Tanks> =
129+) -> Result<Rc<Noun>, TTanks> =
130130 |ctx: &InterpreterContext, n: &Rc<Noun>, f: fn(&Atom, &Atom) -> bool| {
131− let (p, q) = n.as_cell().ok_or(Tanks::new())?;
131+ let (p, q) = n.as_cell().ok_or(TTanks::new())?;
132132
133133 if f(
134− p.as_atom().ok_or(Tanks::new())?,
135− q.as_atom().ok_or(Tanks::new())?,
134+ p.as_atom().ok_or(TTanks::new())?,
135+ q.as_atom().ok_or(TTanks::new())?,
136136 ) {
137137 Ok(ctx.nouns.sig.clone())
138138 } else {
@@ -143,18 +143,22 @@ static BINARY_ATOM_LOOB: fn(
143143static BINARY_ATOM_PAIR: fn(
144144 &Rc<Noun>,
145145 fn(&Atom, &Atom) -> (Atom, Atom),
146−) -> Result<Rc<Noun>, Tanks> = |n: &Rc<Noun>, f: fn(&Atom, &Atom) -> (Atom, Atom)| {
147− let (p, q) = n.as_cell().ok_or(Tanks::new())?;
146+) -> Result<Rc<Noun>, TTanks> = |n: &Rc<Noun>, f: fn(&Atom, &Atom) -> (Atom, Atom)| {
147+ let (p, q) = n.as_cell().ok_or(TTanks::new())?;
148148
149149 let (a, b) = f(
150− p.as_atom().ok_or(Tanks::new())?,
151− q.as_atom().ok_or(Tanks::new())?,
150+ p.as_atom().ok_or(TTanks::new())?,
151+ q.as_atom().ok_or(TTanks::new())?,
152152 );
153153 Ok(cell(&Rc::new(Noun::Atom(a)), &Rc::new(Noun::Atom(b))))
154154};
155155
156156static ADD: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a + b);
157−static DEC: Jet = |_ctx, n| Ok(Rc::new(Noun::Atom(n.as_atom().ok_or(Tanks::new())? - 1u32)));
157+static DEC: Jet = |_ctx, n| {
158+ Ok(Rc::new(Noun::Atom(
159+ n.as_atom().ok_or(TTanks::new())? - 1u32,
160+ )))
161+};
158162static DVR: Jet = |_ctx, n| BINARY_ATOM_PAIR(n, |a, b| a.div_rem(&b));
159163static DIV: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a / b);
160164static GTE: Jet = |ctx, n| BINARY_ATOM_LOOB(ctx, n, |a, b| a >= b);
@@ -168,30 +172,30 @@ static MUL: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a * b);
168172static SUB: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a - b);
169173
170174static CAP: Jet = |ctx, n| {
171− let n = n.as_atom().ok_or(Tanks::new())?;
175+ let n = n.as_atom().ok_or(TTanks::new())?;
172176 CAP_ATOM(ctx, n.clone())
173177};
174178
175−static CAP_ATOM: fn(&InterpreterContext, Atom) -> Result<Rc<Noun>, Tanks> = |ctx, n: Atom| {
179+static CAP_ATOM: fn(&InterpreterContext, Atom) -> Result<Rc<Noun>, TTanks> = |ctx, n: Atom| {
176180 let mut n_iter = n.iter_u32_digits();
177181
178182 match n_iter.len() {
179− 0 => Err(Tanks::new()),
183+ 0 => Err(TTanks::new()),
180184 1 => CAP_U32(ctx, n_iter.next().unwrap()),
181185 _ => CAP_ATOM(ctx, n >> 1),
182186 }
183187};
184−static CAP_U32: fn(ctx: &InterpreterContext, u32) -> Result<Rc<Noun>, Tanks> = |ctx, n| match n {
185− 0 | 1 => Err(Tanks::new()),
188+static CAP_U32: fn(ctx: &InterpreterContext, u32) -> Result<Rc<Noun>, TTanks> = |ctx, n| match n {
189+ 0 | 1 => Err(TTanks::new()),
186190 2 => Ok(ctx.nouns.two.clone()),
187191 3 => Ok(ctx.nouns.three.clone()),
188192 n => CAP_U32(ctx, n >> 1),
189193};
190194
191195static MAS: Jet = |ctx, n| {
192− let n = n.as_atom().ok_or(Tanks::new())?;
196+ let n = n.as_atom().ok_or(TTanks::new())?;
193197 Ok(Rc::new(Noun::Atom(
194− MAS_ATOM(ctx, n.clone()).ok_or(Tanks::new())?,
198+ MAS_ATOM(ctx, n.clone()).ok_or(TTanks::new())?,
195199 )))
196200};
197201static MAS_ATOM: fn(&InterpreterContext, Atom) -> Option<Atom> = |ctx, n| {
@@ -213,22 +217,22 @@ static MAS_U32: fn(u32) -> u32 = |n| match n {
213217};
214218
215219static PEG: Jet = |ctx, n| {
216− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
220+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
217221
218− let a = a.as_atom().ok_or(Tanks::new())?;
219− let b = b.as_atom().ok_or(Tanks::new())?;
222+ let a = a.as_atom().ok_or(TTanks::new())?;
223+ let b = b.as_atom().ok_or(TTanks::new())?;
220224
221225 if *a == Atom::ZERO {
222− return Err(Tanks::new());
226+ return Err(TTanks::new());
223227 };
224228
225229 Ok(Rc::new(Noun::Atom(PEG_ATOM(ctx, a, b.clone())?)))
226230};
227−static PEG_ATOM: fn(&InterpreterContext, &Atom, Atom) -> Result<Atom, Tanks> = |ctx, a, b| {
231+static PEG_ATOM: fn(&InterpreterContext, &Atom, Atom) -> Result<Atom, TTanks> = |ctx, a, b| {
228232 let mut b_iter = b.iter_u32_digits();
229233
230234 match b_iter.len() {
231− 0 => Err(Tanks::new()),
235+ 0 => Err(TTanks::new()),
232236 1 => Ok(PEG_U32(a, b_iter.next().unwrap())),
233237 _ => Ok((&b & &ctx.big_uints.one) + (PEG_ATOM(ctx, a, b >> 1)? << 1)),
234238 }
@@ -242,7 +246,7 @@ static PEG_U32: fn(&Atom, u32) -> Atom = |a, b| match b {
242246};
243247
244248static FAND: Jet = |ctx, n| {
245− let (nedl, hstk) = n.as_cell().ok_or(Tanks::new())?;
249+ let (nedl, hstk) = n.as_cell().ok_or(TTanks::new())?;
246250 if nedl.is_sig() || hstk.is_sig() {
247251 return Ok(ctx.nouns.sig.clone());
248252 }
@@ -272,7 +276,7 @@ static FAND: Jet = |ctx, n| {
272276};
273277
274278static FIND: Jet = |ctx, n| {
275− let (nedl, hstk) = n.as_cell().ok_or(Tanks::new())?;
279+ let (nedl, hstk) = n.as_cell().ok_or(TTanks::new())?;
276280 if nedl.is_sig() || hstk.is_sig() {
277281 return Ok(ctx.nouns.sig.clone());
278282 }
@@ -305,13 +309,13 @@ static FLOP: Jet = |ctx, n| {
305309};
306310
307311static GULF: Jet = |_ctx, n| {
308− let (from, to) = n.as_cell().ok_or(Tanks::new())?;
312+ let (from, to) = n.as_cell().ok_or(TTanks::new())?;
309313
310− let mut from = (*from.as_atom().ok_or(Tanks::new())?).clone();
311− let to = to.as_atom().ok_or(Tanks::new())?.clone();
314+ let mut from = (*from.as_atom().ok_or(TTanks::new())?).clone();
315+ let to = to.as_atom().ok_or(TTanks::new())?.clone();
312316
313317 if from > to {
314− return Err(Tanks::new());
318+ return Err(TTanks::new());
315319 }
316320
317321 let mut tmp = Vec::new();
@@ -325,10 +329,10 @@ static GULF: Jet = |_ctx, n| {
325329};
326330
327331static INTO: Jet = |_ctx, n| {
328− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
329− let (b, c) = b.as_cell().ok_or(Tanks::new())?;
332+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
333+ let (b, c) = b.as_cell().ok_or(TTanks::new())?;
330334
331− let mut b_iter = b.as_atom().ok_or(Tanks::new())?.iter_u32_digits();
335+ let mut b_iter = b.as_atom().ok_or(TTanks::new())?.iter_u32_digits();
332336
333337 match b_iter.len() {
334338 0 => Ok(cell(&c, &a)),
@@ -358,7 +362,7 @@ static INTO: Jet = |_ctx, n| {
358362};
359363
360364static JOIN: Jet = |_ctx, n| {
361− let (sep, list) = n.as_cell().ok_or(Tanks::new())?;
365+ let (sep, list) = n.as_cell().ok_or(TTanks::new())?;
362366 Ok(Noun::list_refs(
363367 list.list_iter()
364368 .intersperse(sep)
@@ -376,7 +380,7 @@ static LENT: Jet = |_ctx, n| {
376380};
377381
378382static LEVY: Jet = |ctx, n| {
379− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
383+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
380384 if traverse_iter_result(a.list_iter().map(|n| slam_pulled_gate(ctx, b, n)))?
381385 .iter()
382386 .all(|x| x.is_y())
@@ -388,7 +392,7 @@ static LEVY: Jet = |ctx, n| {
388392};
389393
390394static LIEN: Jet = |ctx, n| {
391− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
395+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
392396 if traverse_iter_result(a.list_iter().map(|n| slam_pulled_gate(ctx, b, n)))?
393397 .iter()
394398 .any(|x| x.is_y())
@@ -400,7 +404,7 @@ static LIEN: Jet = |ctx, n| {
400404};
401405
402406static MURN: Jet = |ctx, n| {
403− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
407+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
404408
405409 Ok(Noun::list_refs(
406410 traverse_iter_result(
@@ -413,7 +417,7 @@ static MURN: Jet = |ctx, n| {
413417};
414418
415419static REAP: Jet = |_ctx, n| {
416− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
420+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
417421
418422 Ok(Noun::list_refs(repeat_n(
419423 b.clone(),
@@ -421,17 +425,17 @@ static REAP: Jet = |_ctx, n| {
421425 )))
422426};
423427
424−static REAR: Jet = |_ctx, n| n.list_iter().last().ok_or(Tanks::new()).cloned();
428+static REAR: Jet = |_ctx, n| n.list_iter().last().ok_or(TTanks::new()).cloned();
425429
426430static REEL: Jet = |ctx, n| {
427− let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
431+ let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
428432
429433 list.list_iter().collect::<Vec<_>>().iter().rfold(
430434 Ok(gate
431435 .gate_sample()
432− .ok_or(Tanks::new())?
436+ .ok_or(TTanks::new())?
433437 .as_cell()
434− .ok_or(Tanks::new())?
438+ .ok_or(TTanks::new())?
435439 .1
436440 .clone()),
437441 |acc, next| {
@@ -442,15 +446,15 @@ static REEL: Jet = |ctx, n| {
442446};
443447
444448static ROLL: Jet = |ctx, n| {
445− let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
449+ let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
446450
447451 list.list_iter().fold(
448452 Ok(gate
449453 .clone()
450454 .gate_sample()
451− .ok_or(Tanks::new())?
455+ .ok_or(TTanks::new())?
452456 .as_cell()
453− .ok_or(Tanks::new())?
457+ .ok_or(TTanks::new())?
454458 .1
455459 .clone()),
456460 |acc, next| {
@@ -461,7 +465,7 @@ static ROLL: Jet = |ctx, n| {
461465};
462466
463467static SCAG: Jet = |_ctx, n| {
464− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
468+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
465469
466470 Ok(Noun::list_refs(
467471 b.list_iter()
@@ -474,7 +478,7 @@ static SCAG: Jet = |_ctx, n| {
474478};
475479
476480static SKID: Jet = |ctx, n| {
477− let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
481+ let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
478482
479483 let slammed_n = traverse_iter_result(
480484 list.list_iter()
@@ -489,7 +493,7 @@ static SKID: Jet = |ctx, n| {
489493};
490494
491495static SKIM: Jet = |ctx, n| {
492− let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
496+ let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
493497
494498 Ok(Noun::list_refs(
495499 traverse_iter_result(
@@ -503,7 +507,7 @@ static SKIM: Jet = |ctx, n| {
503507};
504508
505509static SKIP: Jet = |ctx, n| {
506− let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
510+ let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
507511
508512 Ok(Noun::list_refs(
509513 traverse_iter_result(
@@ -517,9 +521,9 @@ static SKIP: Jet = |ctx, n| {
517521};
518522
519523static SLAG: Jet = |ctx, n| {
520− let (a, list) = n.as_cell().ok_or(Tanks::new())?;
524+ let (a, list) = n.as_cell().ok_or(TTanks::new())?;
521525
522− let mut a_iter = a.as_atom().ok_or(Tanks::new())?.iter_u32_digits();
526+ let mut a_iter = a.as_atom().ok_or(TTanks::new())?.iter_u32_digits();
523527
524528 match a_iter.len() {
525529 0 => Ok(list.clone()),
@@ -536,12 +540,12 @@ static SLAG: Jet = |ctx, n| {
536540};
537541
538542static SNAG: Jet = |_ctx, n| {
539− let (a, list) = n.as_cell().ok_or(Tanks::new())?;
543+ let (a, list) = n.as_cell().ok_or(TTanks::new())?;
540544
541545 list.list_iter()
542546 .nth(a.as_u32().unwrap() as usize)
543547 .cloned()
544− .ok_or(Tanks::new())
548+ .ok_or(TTanks::new())
545549};
546550
547551static SNIP: Jet = |_ctx, n| {
@@ -558,7 +562,7 @@ static SNIP: Jet = |_ctx, n| {
558562};
559563
560564static SNOC: Jet = |_ctx, n| {
561− let (list, b) = n.as_cell().ok_or(Tanks::new())?;
565+ let (list, b) = n.as_cell().ok_or(TTanks::new())?;
562566
563567 Ok(Noun::list_refs(
564568 list.list_iter()
@@ -589,15 +593,15 @@ static SNOC: Jet = |_ctx, n| {
589593// };
590594
591595static SPIN: Jet = |ctx, n| {
592− let (list, b) = n.as_cell().ok_or(Tanks::new())?;
593− let (acc, gate) = b.as_cell().ok_or(Tanks::new())?;
596+ let (list, b) = n.as_cell().ok_or(TTanks::new())?;
597+ let (acc, gate) = b.as_cell().ok_or(TTanks::new())?;
594598
595599 let mut res = Vec::new();
596600 let mut acc = acc.clone();
597601
598602 for n in list.list_iter() {
599603 let foo = slam_pulled_gate(ctx, gate, &cell(&n, &acc))?;
600− let (el, new_acc) = foo.as_cell().ok_or(Tanks::new())?;
604+ let (el, new_acc) = foo.as_cell().ok_or(TTanks::new())?;
601605 acc = new_acc.clone();
602606 res.push(el.clone());
603607 }
@@ -606,20 +610,20 @@ static SPIN: Jet = |ctx, n| {
606610};
607611
608612static SPUN: Jet = |ctx, n| {
609− let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
613+ let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
610614
611615 let mut res = Vec::new();
612616 let mut acc = gate
613617 .gate_sample()
614− .ok_or(Tanks::new())?
618+ .ok_or(TTanks::new())?
615619 .as_cell()
616− .ok_or(Tanks::new())?
620+ .ok_or(TTanks::new())?
617621 .1
618622 .clone();
619623
620624 for n in list.list_iter() {
621625 let foo = slam_pulled_gate(ctx, gate, &cell(&n, &acc))?;
622− let (el, new_acc) = foo.as_cell().ok_or(Tanks::new())?;
626+ let (el, new_acc) = foo.as_cell().ok_or(TTanks::new())?;
623627 acc = new_acc.clone();
624628 res.push(el.clone());
625629 }
@@ -628,7 +632,7 @@ static SPUN: Jet = |ctx, n| {
628632};
629633
630634static TURN: Jet = |ctx, n| {
631− let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
635+ let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
632636 Ok(Noun::list_refs(
633637 traverse_iter_result(list.list_iter().map(|x| slam_pulled_gate(ctx, gate, x)))?
634638 .iter()
@@ -637,7 +641,7 @@ static TURN: Jet = |ctx, n| {
637641};
638642
639643static WELD: Jet = |_ctx, n| {
640− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
644+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
641645
642646 Ok(Noun::list_refs(
643647 a.list_iter()
@@ -670,18 +674,20 @@ static BEX: Jet = |ctx, n| {
670674};
671675
672676static END: Jet = |ctx, n| {
673− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
677+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
674678 let bite = a.as_bite();
675679
676680 let bits = bite.bits();
677681
678682 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
679683
680− Ok(Rc::new(Noun::Atom(mask & b.as_atom().ok_or(Tanks::new())?)))
684+ Ok(Rc::new(Noun::Atom(
685+ mask & b.as_atom().ok_or(TTanks::new())?,
686+ )))
681687};
682688
683689static CAN: Jet = |ctx, n| {
684− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
690+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
685691 let bloq = a.as_u32().unwrap();
686692 let bloq_ = 2u32.pow(bloq);
687693
@@ -696,16 +702,16 @@ static CAN: Jet = |ctx, n| {
696702 Some((acc? << bits) | (mask & q.as_atom()?))
697703 },
698704 );
699− Ok(Rc::new(Noun::Atom(atom.ok_or(Tanks::new())?)))
705+ Ok(Rc::new(Noun::Atom(atom.ok_or(TTanks::new())?)))
700706};
701707
702708static CAT: Jet = |_ctx, n| {
703− let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
704− let (b, c) = b.as_cell().ok_or(Tanks::new())?;
709+ let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
710+ let (b, c) = b.as_cell().ok_or(TTanks::new())?;
705711
706− let bloq = bloq.as_u32().ok_or(Tanks::new())?;
707− let b = b.as_atom().ok_or(Tanks::new())?;
708− let c = c.as_atom().ok_or(Tanks::new())?;
712+ let bloq = bloq.as_u32().ok_or(TTanks::new())?;
713+ let b = b.as_atom().ok_or(TTanks::new())?;
714+ let c = c.as_atom().ok_or(TTanks::new())?;
709715
710716 Ok(Rc::new(Noun::Atom(
711717 (c << (met(bloq, &b) * 2u32.pow(bloq))) | b,
@@ -713,8 +719,8 @@ static CAT: Jet = |_ctx, n| {
713719};
714720
715721static MET: Jet = |_ctx, n| {
716− let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
717− let b: Atom = b.as_atom().ok_or(Tanks::new())?.clone();
722+ let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
723+ let b: Atom = b.as_atom().ok_or(TTanks::new())?.clone();
718724 let bloq = bloq.as_u32().unwrap();
719725
720726 Ok(Rc::new(Noun::from_u32(met(bloq, &b))))
@@ -725,28 +731,28 @@ fn met(bloq: u32, a: &Atom) -> u32 {
725731}
726732
727733static CUT: Jet = |ctx, n| {
728− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
729− let (b, d) = b.as_cell().ok_or(Tanks::new())?;
730− let (b, c) = b.as_cell().ok_or(Tanks::new())?;
734+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
735+ let (b, d) = b.as_cell().ok_or(TTanks::new())?;
736+ let (b, c) = b.as_cell().ok_or(TTanks::new())?;
731737
732738 let bits = 2u32.pow(a.as_u32().unwrap());
733739
734740 let mask = (&ctx.big_uints.one << (bits * c.as_u32().unwrap())) - &ctx.big_uints.one;
735741
736742 Ok(Rc::new(Noun::Atom(
737− (d.as_atom().ok_or(Tanks::new())? >> (bits * b.as_u32().unwrap())) & mask,
743+ (d.as_atom().ok_or(TTanks::new())? >> (bits * b.as_u32().unwrap())) & mask,
738744 )))
739745};
740746
741747static FIL: Jet = |ctx, n| {
742− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
743− let (b, c) = b.as_cell().ok_or(Tanks::new())?;
748+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
749+ let (b, c) = b.as_cell().ok_or(TTanks::new())?;
744750
745751 let bits = 2u32.pow(a.as_u32().unwrap());
746752
747753 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
748754
749− let src = c.as_atom().ok_or(Tanks::new())? & mask;
755+ let src = c.as_atom().ok_or(TTanks::new())? & mask;
750756
751757 let mut target = ctx.big_uints.zero.clone();
752758
@@ -758,30 +764,30 @@ static FIL: Jet = |ctx, n| {
758764};
759765
760766static LSH: Jet = |_ctx, n| {
761− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
767+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
762768 let a = a.as_bite();
763− let b = b.as_atom().ok_or(Tanks::new())?;
769+ let b = b.as_atom().ok_or(TTanks::new())?;
764770
765771 Ok(Rc::new(Noun::Atom(b << a.bits())))
766772};
767773
768774static RSH: Jet = |_ctx, n| {
769− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
775+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
770776 let a = a.as_bite();
771− let b = b.as_atom().ok_or(Tanks::new())?;
777+ let b = b.as_atom().ok_or(TTanks::new())?;
772778
773779 Ok(Rc::new(Noun::Atom(b >> a.bits())))
774780};
775781
776−static RAP: Jet = |ctx, n| {
777− let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
782+pub static RAP: Jet = |ctx, n| {
783+ let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
778784 let bloq = bloq.as_u32().unwrap();
779785 let bits = 2u32.pow(bloq);
780786
781787 let mut target = ctx.big_uints.zero.clone();
782788
783789 for el in b.list_iter().collect::<Vec<_>>().iter().rev() {
784− let el = el.as_atom().ok_or(Tanks::new())?;
790+ let el = el.as_atom().ok_or(TTanks::new())?;
785791 if el != &ctx.big_uints.zero {
786792 target = (target << (bits * met(bloq, &el))) | el;
787793 }
@@ -791,7 +797,7 @@ static RAP: Jet = |ctx, n| {
791797};
792798
793799static REP: Jet = |ctx, n| {
794− let (bite, b) = n.as_cell().ok_or(Tanks::new())?;
800+ let (bite, b) = n.as_cell().ok_or(TTanks::new())?;
795801 let bite = bite.as_bite();
796802
797803 let bits = bite.bits();
@@ -800,18 +806,18 @@ static REP: Jet = |ctx, n| {
800806 let mut target = ctx.big_uints.zero.clone();
801807
802808 for el in b.list_iter().collect::<Vec<_>>().iter().rev() {
803− target = (target << bits) | (el.as_atom().ok_or(Tanks::new())? & &mask);
809+ target = (target << bits) | (el.as_atom().ok_or(TTanks::new())? & &mask);
804810 }
805811
806812 Ok(Rc::new(Noun::Atom(target)))
807813};
808814
809815static REV: Jet = |ctx, n| {
810− let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
811− let (len, dat) = b.as_cell().ok_or(Tanks::new())?;
816+ let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
817+ let (len, dat) = b.as_cell().ok_or(TTanks::new())?;
812818 let bloq = bloq.as_u32().unwrap();
813819 let len = len.as_u32().unwrap();
814− let mut dat: Atom = dat.as_atom().ok_or(Tanks::new())?.clone();
820+ let mut dat: Atom = dat.as_atom().ok_or(TTanks::new())?.clone();
815821
816822 let bits = 2u32.pow(bloq);
817823 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
@@ -827,9 +833,9 @@ static REV: Jet = |ctx, n| {
827833};
828834
829835static RIP: Jet = |ctx, n| {
830− let (bite, b) = n.as_cell().ok_or(Tanks::new())?;
836+ let (bite, b) = n.as_cell().ok_or(TTanks::new())?;
831837 let bite = bite.as_bite();
832− let mut b: Atom = b.as_atom().ok_or(Tanks::new())?.clone();
838+ let mut b: Atom = b.as_atom().ok_or(TTanks::new())?.clone();
833839
834840 let bits = bite.bits();
835841 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
@@ -845,11 +851,11 @@ static RIP: Jet = |ctx, n| {
845851};
846852
847853static RUN: Jet = |ctx, n| {
848− let (bite, b) = n.as_cell().ok_or(Tanks::new())?;
849− let (b, gate) = b.as_cell().ok_or(Tanks::new())?;
854+ let (bite, b) = n.as_cell().ok_or(TTanks::new())?;
855+ let (b, gate) = b.as_cell().ok_or(TTanks::new())?;
850856
851857 let bite = bite.as_bite();
852− let mut b: Atom = b.as_atom().ok_or(Tanks::new())?.clone();
858+ let mut b: Atom = b.as_atom().ok_or(TTanks::new())?.clone();
853859
854860 let bits = bite.bits();
855861 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
@@ -860,7 +866,7 @@ static RUN: Jet = |ctx, n| {
860866 target = (target << bits)
861867 | ((*slam_pulled_gate(ctx, gate, &Rc::new(Noun::Atom(&mask & &b)))?)
862868 .as_atom()
863− .ok_or(Tanks::new())?
869+ .ok_or(TTanks::new())?
864870 & &mask);
865871 b = b >> bits;
866872 }
@@ -869,11 +875,11 @@ static RUN: Jet = |ctx, n| {
869875};
870876
871877static RUT: Jet = |ctx, n| {
872− let (bite, b) = n.as_cell().ok_or(Tanks::new())?;
873− let (b, gate) = b.as_cell().ok_or(Tanks::new())?;
878+ let (bite, b) = n.as_cell().ok_or(TTanks::new())?;
879+ let (b, gate) = b.as_cell().ok_or(TTanks::new())?;
874880
875881 let bite = bite.as_bite();
876− let mut b: Atom = b.as_atom().ok_or(Tanks::new())?.clone();
882+ let mut b: Atom = b.as_atom().ok_or(TTanks::new())?.clone();
877883
878884 let bits = bite.bits();
879885 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
@@ -884,7 +890,7 @@ static RUT: Jet = |ctx, n| {
884890 target.push(
885891 (*slam_pulled_gate(ctx, gate, &Rc::new(Noun::Atom(&mask & &b)))?)
886892 .as_atom()
887− .ok_or(Tanks::new())?
893+ .ok_or(TTanks::new())?
888894 & &mask,
889895 );
890896 b = b >> bits;
@@ -894,12 +900,12 @@ static RUT: Jet = |ctx, n| {
894900};
895901
896902static SEW: Jet = |ctx, n| {
897− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
898− let (b, recipient) = b.as_cell().ok_or(Tanks::new())?;
899− let (sew_start, c) = b.as_cell().ok_or(Tanks::new())?;
900− let (number_of_blocks, donor) = c.as_cell().ok_or(Tanks::new())?;
901− let recipient = recipient.as_atom().ok_or(Tanks::new())?;
902− let donor = donor.as_atom().ok_or(Tanks::new())?;
903+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
904+ let (b, recipient) = b.as_cell().ok_or(TTanks::new())?;
905+ let (sew_start, c) = b.as_cell().ok_or(TTanks::new())?;
906+ let (number_of_blocks, donor) = c.as_cell().ok_or(TTanks::new())?;
907+ let recipient = recipient.as_atom().ok_or(TTanks::new())?;
908+ let donor = donor.as_atom().ok_or(TTanks::new())?;
903909
904910 let bloq = a.as_u32().unwrap();
905911 let bits = 2u32.pow(bloq);
@@ -915,12 +921,12 @@ static SEW: Jet = |ctx, n| {
915921};
916922
917923static SWP: Jet = |ctx, n| {
918− let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
924+ let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
919925 let bloq = bloq.as_u32().unwrap();
920926 let bits = 2u32.pow(bloq);
921927 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
922928
923− let mut source = b.as_atom().ok_or(Tanks::new())?.clone();
929+ let mut source = b.as_atom().ok_or(TTanks::new())?.clone();
924930 let mut target = ctx.big_uints.zero.clone();
925931
926932 while source > ctx.big_uints.zero {
@@ -932,7 +938,7 @@ static SWP: Jet = |ctx, n| {
932938};
933939
934940static XEB: Jet = |_ctx, n| {
935− let mut a = n.as_atom().ok_or(Tanks::new())?.clone();
941+ let mut a = n.as_atom().ok_or(TTanks::new())?.clone();
936942
937943 let mut c = 0;
938944
@@ -949,22 +955,22 @@ static DIS: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a & b);
949955static MIX: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a ^ b);
950956
951957static NOT: Jet = |ctx, n| {
952− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
953− let (b, c) = b.as_cell().ok_or(Tanks::new())?;
958+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
959+ let (b, c) = b.as_cell().ok_or(TTanks::new())?;
954960
955961 let bloq = a.as_u32().unwrap();
956962 let bits = 2u32.pow(bloq);
957963 let mask = (&ctx.big_uints.one << (bits * b.as_u32().unwrap())) - &ctx.big_uints.one;
958964
959− let target = c.as_atom().ok_or(Tanks::new())? ^ &mask;
965+ let target = c.as_atom().ok_or(TTanks::new())? ^ &mask;
960966
961967 Ok(Rc::new(Noun::Atom(target)))
962968};
963969
964970static LAST: Jet = |_ctx, n| {
965− let (a, b) = n.as_cell().ok_or(Tanks::new())?;
966− let a = a.as_hair().ok_or(Tanks::new())?;
967− let b = b.as_hair().ok_or(Tanks::new())?;
971+ let (a, b) = n.as_cell().ok_or(TTanks::new())?;
972+ let a = a.as_hair().ok_or(TTanks::new())?;
973+ let b = b.as_hair().ok_or(TTanks::new())?;
968974 Ok(Noun::from_hair(last(&a, &b)))
969975};
970976
@@ -985,18 +991,18 @@ fn last<'a>(a: &'a Hair, b: &'a Hair) -> &'a Hair {
985991}
986992
987993static TRIP: Jet = |_ctx, n| {
988− let a = n.as_atom().ok_or(Tanks::new())?;
994+ let a = n.as_atom().ok_or(TTanks::new())?;
989995 Ok(Noun::list(
990996 a.to_bytes_le().iter().map(|b| Noun::from_u32(*b as u32)),
991997 ))
992998};
993999
9941000static MUK: Jet = |_ctx, n| {
995− let (seed, len) = n.as_cell().ok_or(Tanks::new())?;
996− let (len, key) = len.as_cell().ok_or(Tanks::new())?;
997− let seed = seed.as_u32().ok_or(Tanks::new())?;
998− let len = len.as_u32().ok_or(Tanks::new())?;
999− let key = key.as_atom().ok_or(Tanks::new())?;
1001+ let (seed, len) = n.as_cell().ok_or(TTanks::new())?;
1002+ let (len, key) = len.as_cell().ok_or(TTanks::new())?;
1003+ let seed = seed.as_u32().ok_or(TTanks::new())?;
1004+ let len = len.as_u32().ok_or(TTanks::new())?;
1005+ let key = key.as_atom().ok_or(TTanks::new())?;
10001006
10011007 Ok(Rc::new(Noun::from_u32(muk(seed, len, key))))
10021008};