@@ -2,15 +2,14 @@ use core::panic;
2use murmur3::murmur3_32;
2use murmur3::murmur3_32;
3use num_integer::Integer;
3use num_integer::Integer;
6 collections::BTreeMap,
5 collections::BTreeMap,
7 iter::{once, repeat_n, zip},
6 iter::{once, repeat_n, zip},
11use crate::{
10use crate::{
12− interpreter::{slam_pulled_gate, InterpreterContext, TTanks, EMPTY_TANKS},
11+ interpreter::{slam_pulled_gate, InterpreterContext, Tanks},
13− noun::{self, cell, AsNoun, Atom, Edge, Hair, Nail, Noun},
12+ noun::{self, cell, Atom, Edge, Hair, Nail, Noun},
16fn traverse_iter_result<E: Clone, T: Clone, I: Iterator<Item = Result<T, E>>>(
15fn traverse_iter_result<E: Clone, T: Clone, I: Iterator<Item = Result<T, E>>>(
@@ -108,23 +107,18 @@ pub fn generate_jets() -> Jets {
108 (124976064672625230427889101290245200507, TRIP),
107 (124976064672625230427889101290245200507, TRIP),
109 (4078279288073906183633157465551067635, MUK),
108 (4078279288073906183633157465551067635, MUK),
110 (261900159748071234702685239353558471892, MUG),
109 (261900159748071234702685239353558471892, MUG),
111− (198191257620924788695943358402651905954, AOR),
112− (299422828284010240628877806738195667652, DOR),
113− (166326796552601297695313176538120818632, GOR),
114− (7942398240152905363972500667649380756, MOR),
115− (315687984998079865981003916817293521765, LOOK),
119−pub type Jet = fn(ctx: &mut InterpreterContext, &Rc<Noun>) -> Result<Rc<Noun>, TTanks>;
113+pub type Jet = fn(ctx: &mut InterpreterContext, &Rc<Noun>) -> Result<Rc<Noun>, Tanks>;
120pub type DoubleJet = fn(ctx: &mut InterpreterContext, &Rc<Noun>, &Rc<Noun>) -> Option<Rc<Noun>>;
114pub type DoubleJet = fn(ctx: &mut InterpreterContext, &Rc<Noun>, &Rc<Noun>) -> Option<Rc<Noun>>;
122−static BINARY_ATOM: fn(&Rc<Noun>, fn(&Atom, &Atom) -> Atom) -> Result<Rc<Noun>, TTanks> =
116+static BINARY_ATOM: fn(&Rc<Noun>, fn(&Atom, &Atom) -> Atom) -> Result<Rc<Noun>, Tanks> =
123 |n: &Rc<Noun>, f: fn(&Atom, &Atom) -> Atom| {
117 |n: &Rc<Noun>, f: fn(&Atom, &Atom) -> Atom| {
124− let (p, q) = n.as_cell().ok_or(TTanks::new())?;
118+ let (p, q) = n.as_cell().ok_or(Tanks::new())?;
125 Ok(Rc::new(Noun::Atom(f(
119 Ok(Rc::new(Noun::Atom(f(
126− p.as_atom().ok_or(TTanks::new())?,
120+ p.as_atom().ok_or(Tanks::new())?,
127− q.as_atom().ok_or(TTanks::new())?,
121+ q.as_atom().ok_or(Tanks::new())?,
@@ -132,13 +126,13 @@ static BINARY_ATOM_LOOB: fn(
132 &InterpreterContext,
126 &InterpreterContext,
133 &Rc<Noun>,
127 &Rc<Noun>,
134 fn(&Atom, &Atom) -> bool,
128 fn(&Atom, &Atom) -> bool,
135−) -> Result<Rc<Noun>, TTanks> =
129+) -> Result<Rc<Noun>, Tanks> =
136 |ctx: &InterpreterContext, n: &Rc<Noun>, f: fn(&Atom, &Atom) -> bool| {
130 |ctx: &InterpreterContext, n: &Rc<Noun>, f: fn(&Atom, &Atom) -> bool| {
137− let (p, q) = n.as_cell().ok_or(TTanks::new())?;
131+ let (p, q) = n.as_cell().ok_or(Tanks::new())?;
140− p.as_atom().ok_or(TTanks::new())?,
134+ p.as_atom().ok_or(Tanks::new())?,
141− q.as_atom().ok_or(TTanks::new())?,
135+ q.as_atom().ok_or(Tanks::new())?,
143 Ok(ctx.nouns.sig.clone())
137 Ok(ctx.nouns.sig.clone())
@@ -149,22 +143,18 @@ static BINARY_ATOM_LOOB: fn(
149static BINARY_ATOM_PAIR: fn(
143static BINARY_ATOM_PAIR: fn(
150 &Rc<Noun>,
144 &Rc<Noun>,
151 fn(&Atom, &Atom) -> (Atom, Atom),
145 fn(&Atom, &Atom) -> (Atom, Atom),
152−) -> Result<Rc<Noun>, TTanks> = |n: &Rc<Noun>, f: fn(&Atom, &Atom) -> (Atom, Atom)| {
146+) -> Result<Rc<Noun>, Tanks> = |n: &Rc<Noun>, f: fn(&Atom, &Atom) -> (Atom, Atom)| {
153− let (p, q) = n.as_cell().ok_or(TTanks::new())?;
147+ let (p, q) = n.as_cell().ok_or(Tanks::new())?;
155 let (a, b) = f(
149 let (a, b) = f(
156− p.as_atom().ok_or(TTanks::new())?,
150+ p.as_atom().ok_or(Tanks::new())?,
157− q.as_atom().ok_or(TTanks::new())?,
151+ q.as_atom().ok_or(Tanks::new())?,
159 Ok(cell(&Rc::new(Noun::Atom(a)), &Rc::new(Noun::Atom(b))))
153 Ok(cell(&Rc::new(Noun::Atom(a)), &Rc::new(Noun::Atom(b))))
162static ADD: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a + b);
156static ADD: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a + b);
163−static DEC: Jet = |_ctx, n| {
164− Ok(Rc::new(Noun::Atom(
165− n.as_atom().ok_or(TTanks::new())? - 1u32,
157+static DEC: Jet = |_ctx, n| Ok(Rc::new(Noun::Atom(n.as_atom().ok_or(Tanks::new())? - 1u32)));
168static DVR: Jet = |_ctx, n| BINARY_ATOM_PAIR(n, |a, b| a.div_rem(&b));
158static DVR: Jet = |_ctx, n| BINARY_ATOM_PAIR(n, |a, b| a.div_rem(&b));
169static DIV: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a / b);
159static DIV: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a / b);
170static GTE: Jet = |ctx, n| BINARY_ATOM_LOOB(ctx, n, |a, b| a >= b);
160static GTE: Jet = |ctx, n| BINARY_ATOM_LOOB(ctx, n, |a, b| a >= b);
@@ -178,30 +168,30 @@ static MUL: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a * b);
178static SUB: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a - b);
168static SUB: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a - b);
180static CAP: Jet = |ctx, n| {
170static CAP: Jet = |ctx, n| {
181− let n = n.as_atom().ok_or(TTanks::new())?;
171+ let n = n.as_atom().ok_or(Tanks::new())?;
182 CAP_ATOM(ctx, n.clone())
172 CAP_ATOM(ctx, n.clone())
185−static CAP_ATOM: fn(&InterpreterContext, Atom) -> Result<Rc<Noun>, TTanks> = |ctx, n: Atom| {
175+static CAP_ATOM: fn(&InterpreterContext, Atom) -> Result<Rc<Noun>, Tanks> = |ctx, n: Atom| {
186 let mut n_iter = n.iter_u32_digits();
176 let mut n_iter = n.iter_u32_digits();
188 match n_iter.len() {
178 match n_iter.len() {
189− 0 => Err(TTanks::new()),
179+ 0 => Err(Tanks::new()),
190 1 => CAP_U32(ctx, n_iter.next().unwrap()),
180 1 => CAP_U32(ctx, n_iter.next().unwrap()),
191 _ => CAP_ATOM(ctx, n >> 1),
181 _ => CAP_ATOM(ctx, n >> 1),
194−static CAP_U32: fn(ctx: &InterpreterContext, u32) -> Result<Rc<Noun>, TTanks> = |ctx, n| match n {
184+static CAP_U32: fn(ctx: &InterpreterContext, u32) -> Result<Rc<Noun>, Tanks> = |ctx, n| match n {
195− 0 | 1 => Err(TTanks::new()),
185+ 0 | 1 => Err(Tanks::new()),
196 2 => Ok(ctx.nouns.two.clone()),
186 2 => Ok(ctx.nouns.two.clone()),
197 3 => Ok(ctx.nouns.three.clone()),
187 3 => Ok(ctx.nouns.three.clone()),
198 n => CAP_U32(ctx, n >> 1),
188 n => CAP_U32(ctx, n >> 1),
201static MAS: Jet = |ctx, n| {
191static MAS: Jet = |ctx, n| {
202− let n = n.as_atom().ok_or(TTanks::new())?;
192+ let n = n.as_atom().ok_or(Tanks::new())?;
203 Ok(Rc::new(Noun::Atom(
193 Ok(Rc::new(Noun::Atom(
204− MAS_ATOM(ctx, n.clone()).ok_or(TTanks::new())?,
194+ MAS_ATOM(ctx, n.clone()).ok_or(Tanks::new())?,
207static MAS_ATOM: fn(&InterpreterContext, Atom) -> Option<Atom> = |ctx, n| {
197static MAS_ATOM: fn(&InterpreterContext, Atom) -> Option<Atom> = |ctx, n| {
@@ -223,22 +213,22 @@ static MAS_U32: fn(u32) -> u32 = |n| match n {
225static PEG: Jet = |ctx, n| {
215static PEG: Jet = |ctx, n| {
226− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
216+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
228− let a = a.as_atom().ok_or(TTanks::new())?;
218+ let a = a.as_atom().ok_or(Tanks::new())?;
229− let b = b.as_atom().ok_or(TTanks::new())?;
219+ let b = b.as_atom().ok_or(Tanks::new())?;
231 if *a == Atom::ZERO {
221 if *a == Atom::ZERO {
232− return Err(TTanks::new());
222+ return Err(Tanks::new());
235 Ok(Rc::new(Noun::Atom(PEG_ATOM(ctx, a, b.clone())?)))
225 Ok(Rc::new(Noun::Atom(PEG_ATOM(ctx, a, b.clone())?)))
237−static PEG_ATOM: fn(&InterpreterContext, &Atom, Atom) -> Result<Atom, TTanks> = |ctx, a, b| {
227+static PEG_ATOM: fn(&InterpreterContext, &Atom, Atom) -> Result<Atom, Tanks> = |ctx, a, b| {
238 let mut b_iter = b.iter_u32_digits();
228 let mut b_iter = b.iter_u32_digits();
240 match b_iter.len() {
230 match b_iter.len() {
241− 0 => Err(TTanks::new()),
231+ 0 => Err(Tanks::new()),
242 1 => Ok(PEG_U32(a, b_iter.next().unwrap())),
232 1 => Ok(PEG_U32(a, b_iter.next().unwrap())),
243 _ => Ok((&b & &ctx.big_uints.one) + (PEG_ATOM(ctx, a, b >> 1)? << 1)),
233 _ => Ok((&b & &ctx.big_uints.one) + (PEG_ATOM(ctx, a, b >> 1)? << 1)),
@@ -252,7 +242,7 @@ static PEG_U32: fn(&Atom, u32) -> Atom = |a, b| match b {
254static FAND: Jet = |ctx, n| {
244static FAND: Jet = |ctx, n| {
255− let (nedl, hstk) = n.as_cell().ok_or(TTanks::new())?;
245+ let (nedl, hstk) = n.as_cell().ok_or(Tanks::new())?;
256 if nedl.is_sig() || hstk.is_sig() {
246 if nedl.is_sig() || hstk.is_sig() {
257 return Ok(ctx.nouns.sig.clone());
247 return Ok(ctx.nouns.sig.clone());
@@ -282,7 +272,7 @@ static FAND: Jet = |ctx, n| {
284static FIND: Jet = |ctx, n| {
274static FIND: Jet = |ctx, n| {
285− let (nedl, hstk) = n.as_cell().ok_or(TTanks::new())?;
275+ let (nedl, hstk) = n.as_cell().ok_or(Tanks::new())?;
286 if nedl.is_sig() || hstk.is_sig() {
276 if nedl.is_sig() || hstk.is_sig() {
287 return Ok(ctx.nouns.sig.clone());
277 return Ok(ctx.nouns.sig.clone());
@@ -315,13 +305,13 @@ static FLOP: Jet = |ctx, n| {
317static GULF: Jet = |_ctx, n| {
307static GULF: Jet = |_ctx, n| {
318− let (from, to) = n.as_cell().ok_or(TTanks::new())?;
308+ let (from, to) = n.as_cell().ok_or(Tanks::new())?;
320− let mut from = (*from.as_atom().ok_or(TTanks::new())?).clone();
310+ let mut from = (*from.as_atom().ok_or(Tanks::new())?).clone();
321− let to = to.as_atom().ok_or(TTanks::new())?.clone();
311+ let to = to.as_atom().ok_or(Tanks::new())?.clone();
323 if from > to {
313 if from > to {
324− return Err(TTanks::new());
314+ return Err(Tanks::new());
327 let mut tmp = Vec::new();
317 let mut tmp = Vec::new();
@@ -335,10 +325,10 @@ static GULF: Jet = |_ctx, n| {
337static INTO: Jet = |_ctx, n| {
327static INTO: Jet = |_ctx, n| {
338− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
328+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
339− let (b, c) = b.as_cell().ok_or(TTanks::new())?;
329+ let (b, c) = b.as_cell().ok_or(Tanks::new())?;
341− let mut b_iter = b.as_atom().ok_or(TTanks::new())?.iter_u32_digits();
331+ let mut b_iter = b.as_atom().ok_or(Tanks::new())?.iter_u32_digits();
343 match b_iter.len() {
333 match b_iter.len() {
344 0 => Ok(cell(&c, &a)),
334 0 => Ok(cell(&c, &a)),
@@ -368,7 +358,7 @@ static INTO: Jet = |_ctx, n| {
370static JOIN: Jet = |_ctx, n| {
360static JOIN: Jet = |_ctx, n| {
371− let (sep, list) = n.as_cell().ok_or(TTanks::new())?;
361+ let (sep, list) = n.as_cell().ok_or(Tanks::new())?;
372 Ok(Noun::list_refs(
362 Ok(Noun::list_refs(
373 list.list_iter()
363 list.list_iter()
374 .intersperse(sep)
364 .intersperse(sep)
@@ -386,7 +376,7 @@ static LENT: Jet = |_ctx, n| {
388static LEVY: Jet = |ctx, n| {
378static LEVY: Jet = |ctx, n| {
389− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
379+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
390 if traverse_iter_result(a.list_iter().map(|n| slam_pulled_gate(ctx, b, n)))?
380 if traverse_iter_result(a.list_iter().map(|n| slam_pulled_gate(ctx, b, n)))?
392 .all(|x| x.is_y())
382 .all(|x| x.is_y())
@@ -398,7 +388,7 @@ static LEVY: Jet = |ctx, n| {
400static LIEN: Jet = |ctx, n| {
390static LIEN: Jet = |ctx, n| {
401− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
391+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
402 if traverse_iter_result(a.list_iter().map(|n| slam_pulled_gate(ctx, b, n)))?
392 if traverse_iter_result(a.list_iter().map(|n| slam_pulled_gate(ctx, b, n)))?
404 .any(|x| x.is_y())
394 .any(|x| x.is_y())
@@ -410,7 +400,7 @@ static LIEN: Jet = |ctx, n| {
412static MURN: Jet = |ctx, n| {
402static MURN: Jet = |ctx, n| {
413− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
403+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
415 Ok(Noun::list_refs(
405 Ok(Noun::list_refs(
416 traverse_iter_result(
406 traverse_iter_result(
@@ -423,7 +413,7 @@ static MURN: Jet = |ctx, n| {
425static REAP: Jet = |_ctx, n| {
415static REAP: Jet = |_ctx, n| {
426− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
416+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
428 Ok(Noun::list_refs(repeat_n(
418 Ok(Noun::list_refs(repeat_n(
429 b.clone(),
419 b.clone(),
@@ -431,17 +421,17 @@ static REAP: Jet = |_ctx, n| {
434−static REAR: Jet = |_ctx, n| n.list_iter().last().ok_or(TTanks::new()).cloned();
424+static REAR: Jet = |_ctx, n| n.list_iter().last().ok_or(Tanks::new()).cloned();
436static REEL: Jet = |ctx, n| {
426static REEL: Jet = |ctx, n| {
437− let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
427+ let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
439 list.list_iter().collect::<Vec<_>>().iter().rfold(
429 list.list_iter().collect::<Vec<_>>().iter().rfold(
441 .gate_sample()
431 .gate_sample()
442− .ok_or(TTanks::new())?
432+ .ok_or(Tanks::new())?
443 .as_cell()
433 .as_cell()
444− .ok_or(TTanks::new())?
434+ .ok_or(Tanks::new())?
446 .clone()),
436 .clone()),
447 |acc, next| {
437 |acc, next| {
@@ -452,15 +442,15 @@ static REEL: Jet = |ctx, n| {
454static ROLL: Jet = |ctx, n| {
444static ROLL: Jet = |ctx, n| {
455− let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
445+ let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
457 list.list_iter().fold(
447 list.list_iter().fold(
460 .gate_sample()
450 .gate_sample()
461− .ok_or(TTanks::new())?
451+ .ok_or(Tanks::new())?
462 .as_cell()
452 .as_cell()
463− .ok_or(TTanks::new())?
453+ .ok_or(Tanks::new())?
465 .clone()),
455 .clone()),
466 |acc, next| {
456 |acc, next| {
@@ -471,7 +461,7 @@ static ROLL: Jet = |ctx, n| {
473static SCAG: Jet = |_ctx, n| {
463static SCAG: Jet = |_ctx, n| {
474− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
464+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
476 Ok(Noun::list_refs(
466 Ok(Noun::list_refs(
477 b.list_iter()
467 b.list_iter()
@@ -484,7 +474,7 @@ static SCAG: Jet = |_ctx, n| {
486static SKID: Jet = |ctx, n| {
476static SKID: Jet = |ctx, n| {
487− let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
477+ let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
489 let slammed_n = traverse_iter_result(
479 let slammed_n = traverse_iter_result(
490 list.list_iter()
480 list.list_iter()
@@ -499,7 +489,7 @@ static SKID: Jet = |ctx, n| {
501static SKIM: Jet = |ctx, n| {
491static SKIM: Jet = |ctx, n| {
502− let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
492+ let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
504 Ok(Noun::list_refs(
494 Ok(Noun::list_refs(
505 traverse_iter_result(
495 traverse_iter_result(
@@ -513,7 +503,7 @@ static SKIM: Jet = |ctx, n| {
515static SKIP: Jet = |ctx, n| {
505static SKIP: Jet = |ctx, n| {
516− let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
506+ let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
518 Ok(Noun::list_refs(
508 Ok(Noun::list_refs(
519 traverse_iter_result(
509 traverse_iter_result(
@@ -527,9 +517,9 @@ static SKIP: Jet = |ctx, n| {
529static SLAG: Jet = |ctx, n| {
519static SLAG: Jet = |ctx, n| {
530− let (a, list) = n.as_cell().ok_or(TTanks::new())?;
520+ let (a, list) = n.as_cell().ok_or(Tanks::new())?;
532− let mut a_iter = a.as_atom().ok_or(TTanks::new())?.iter_u32_digits();
522+ let mut a_iter = a.as_atom().ok_or(Tanks::new())?.iter_u32_digits();
534 match a_iter.len() {
524 match a_iter.len() {
535 0 => Ok(list.clone()),
525 0 => Ok(list.clone()),
@@ -546,12 +536,12 @@ static SLAG: Jet = |ctx, n| {
548static SNAG: Jet = |_ctx, n| {
538static SNAG: Jet = |_ctx, n| {
549− let (a, list) = n.as_cell().ok_or(TTanks::new())?;
539+ let (a, list) = n.as_cell().ok_or(Tanks::new())?;
551 list.list_iter()
541 list.list_iter()
552 .nth(a.as_u32().unwrap() as usize)
542 .nth(a.as_u32().unwrap() as usize)
553 .cloned()
543 .cloned()
554− .ok_or(TTanks::new())
544+ .ok_or(Tanks::new())
557static SNIP: Jet = |_ctx, n| {
547static SNIP: Jet = |_ctx, n| {
@@ -568,7 +558,7 @@ static SNIP: Jet = |_ctx, n| {
570static SNOC: Jet = |_ctx, n| {
560static SNOC: Jet = |_ctx, n| {
571− let (list, b) = n.as_cell().ok_or(TTanks::new())?;
561+ let (list, b) = n.as_cell().ok_or(Tanks::new())?;
573 Ok(Noun::list_refs(
563 Ok(Noun::list_refs(
574 list.list_iter()
564 list.list_iter()
@@ -599,15 +589,15 @@ static SNOC: Jet = |_ctx, n| {
601static SPIN: Jet = |ctx, n| {
591static SPIN: Jet = |ctx, n| {
602− let (list, b) = n.as_cell().ok_or(TTanks::new())?;
592+ let (list, b) = n.as_cell().ok_or(Tanks::new())?;
603− let (acc, gate) = b.as_cell().ok_or(TTanks::new())?;
593+ let (acc, gate) = b.as_cell().ok_or(Tanks::new())?;
605 let mut res = Vec::new();
595 let mut res = Vec::new();
606 let mut acc = acc.clone();
596 let mut acc = acc.clone();
608 for n in list.list_iter() {
598 for n in list.list_iter() {
609 let foo = slam_pulled_gate(ctx, gate, &cell(&n, &acc))?;
599 let foo = slam_pulled_gate(ctx, gate, &cell(&n, &acc))?;
610− let (el, new_acc) = foo.as_cell().ok_or(TTanks::new())?;
600+ let (el, new_acc) = foo.as_cell().ok_or(Tanks::new())?;
611 acc = new_acc.clone();
601 acc = new_acc.clone();
612 res.push(el.clone());
602 res.push(el.clone());
@@ -616,20 +606,20 @@ static SPIN: Jet = |ctx, n| {
618static SPUN: Jet = |ctx, n| {
608static SPUN: Jet = |ctx, n| {
619− let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
609+ let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
621 let mut res = Vec::new();
611 let mut res = Vec::new();
622 let mut acc = gate
612 let mut acc = gate
623 .gate_sample()
613 .gate_sample()
624− .ok_or(TTanks::new())?
614+ .ok_or(Tanks::new())?
625 .as_cell()
615 .as_cell()
626− .ok_or(TTanks::new())?
616+ .ok_or(Tanks::new())?
628 .clone();
618 .clone();
630 for n in list.list_iter() {
620 for n in list.list_iter() {
631 let foo = slam_pulled_gate(ctx, gate, &cell(&n, &acc))?;
621 let foo = slam_pulled_gate(ctx, gate, &cell(&n, &acc))?;
632− let (el, new_acc) = foo.as_cell().ok_or(TTanks::new())?;
622+ let (el, new_acc) = foo.as_cell().ok_or(Tanks::new())?;
633 acc = new_acc.clone();
623 acc = new_acc.clone();
634 res.push(el.clone());
624 res.push(el.clone());
@@ -638,7 +628,7 @@ static SPUN: Jet = |ctx, n| {
640static TURN: Jet = |ctx, n| {
630static TURN: Jet = |ctx, n| {
641− let (list, gate) = n.as_cell().ok_or(TTanks::new())?;
631+ let (list, gate) = n.as_cell().ok_or(Tanks::new())?;
642 Ok(Noun::list_refs(
632 Ok(Noun::list_refs(
643 traverse_iter_result(list.list_iter().map(|x| slam_pulled_gate(ctx, gate, x)))?
633 traverse_iter_result(list.list_iter().map(|x| slam_pulled_gate(ctx, gate, x)))?
@@ -647,7 +637,7 @@ static TURN: Jet = |ctx, n| {
649static WELD: Jet = |_ctx, n| {
639static WELD: Jet = |_ctx, n| {
650− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
640+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
652 Ok(Noun::list_refs(
642 Ok(Noun::list_refs(
653 a.list_iter()
643 a.list_iter()
@@ -680,20 +670,18 @@ static BEX: Jet = |ctx, n| {
682static END: Jet = |ctx, n| {
672static END: Jet = |ctx, n| {
683− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
673+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
684 let bite = a.as_bite();
674 let bite = a.as_bite();
686 let bits = bite.bits();
676 let bits = bite.bits();
688 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
678 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
690− Ok(Rc::new(Noun::Atom(
691− mask & b.as_atom().ok_or(TTanks::new())?,
680+ Ok(Rc::new(Noun::Atom(mask & b.as_atom().ok_or(Tanks::new())?)))
695static CAN: Jet = |ctx, n| {
683static CAN: Jet = |ctx, n| {
696− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
684+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
697 let bloq = a.as_u32().unwrap();
685 let bloq = a.as_u32().unwrap();
698 let bloq_ = 2u32.pow(bloq);
686 let bloq_ = 2u32.pow(bloq);
@@ -708,16 +696,16 @@ static CAN: Jet = |ctx, n| {
708 Some((acc? << bits) | (mask & q.as_atom()?))
696 Some((acc? << bits) | (mask & q.as_atom()?))
711− Ok(Rc::new(Noun::Atom(atom.ok_or(TTanks::new())?)))
699+ Ok(Rc::new(Noun::Atom(atom.ok_or(Tanks::new())?)))
714static CAT: Jet = |_ctx, n| {
702static CAT: Jet = |_ctx, n| {
715− let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
703+ let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
716− let (b, c) = b.as_cell().ok_or(TTanks::new())?;
704+ let (b, c) = b.as_cell().ok_or(Tanks::new())?;
718− let bloq = bloq.as_u32().ok_or(TTanks::new())?;
706+ let bloq = bloq.as_u32().ok_or(Tanks::new())?;
719− let b = b.as_atom().ok_or(TTanks::new())?;
707+ let b = b.as_atom().ok_or(Tanks::new())?;
720− let c = c.as_atom().ok_or(TTanks::new())?;
708+ let c = c.as_atom().ok_or(Tanks::new())?;
722 Ok(Rc::new(Noun::Atom(
710 Ok(Rc::new(Noun::Atom(
723 (c << (met(bloq, &b) * 2u32.pow(bloq))) | b,
711 (c << (met(bloq, &b) * 2u32.pow(bloq))) | b,
@@ -725,8 +713,8 @@ static CAT: Jet = |_ctx, n| {
727static MET: Jet = |_ctx, n| {
715static MET: Jet = |_ctx, n| {
728− let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
716+ let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
729− let b: Atom = b.as_atom().ok_or(TTanks::new())?.clone();
717+ let b: Atom = b.as_atom().ok_or(Tanks::new())?.clone();
730 let bloq = bloq.as_u32().unwrap();
718 let bloq = bloq.as_u32().unwrap();
732 Ok(Rc::new(Noun::from_u32(met(bloq, &b))))
720 Ok(Rc::new(Noun::from_u32(met(bloq, &b))))
@@ -737,28 +725,28 @@ fn met(bloq: u32, a: &Atom) -> u32 {
739static CUT: Jet = |ctx, n| {
727static CUT: Jet = |ctx, n| {
740− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
728+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
741− let (b, d) = b.as_cell().ok_or(TTanks::new())?;
729+ let (b, d) = b.as_cell().ok_or(Tanks::new())?;
742− let (b, c) = b.as_cell().ok_or(TTanks::new())?;
730+ let (b, c) = b.as_cell().ok_or(Tanks::new())?;
744 let bits = 2u32.pow(a.as_u32().unwrap());
732 let bits = 2u32.pow(a.as_u32().unwrap());
746 let mask = (&ctx.big_uints.one << (bits * c.as_u32().unwrap())) - &ctx.big_uints.one;
734 let mask = (&ctx.big_uints.one << (bits * c.as_u32().unwrap())) - &ctx.big_uints.one;
748 Ok(Rc::new(Noun::Atom(
736 Ok(Rc::new(Noun::Atom(
749− (d.as_atom().ok_or(TTanks::new())? >> (bits * b.as_u32().unwrap())) & mask,
737+ (d.as_atom().ok_or(Tanks::new())? >> (bits * b.as_u32().unwrap())) & mask,
753static FIL: Jet = |ctx, n| {
741static FIL: Jet = |ctx, n| {
754− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
742+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
755− let (b, c) = b.as_cell().ok_or(TTanks::new())?;
743+ let (b, c) = b.as_cell().ok_or(Tanks::new())?;
757 let bits = 2u32.pow(a.as_u32().unwrap());
745 let bits = 2u32.pow(a.as_u32().unwrap());
759 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
747 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
761− let src = c.as_atom().ok_or(TTanks::new())? & mask;
749+ let src = c.as_atom().ok_or(Tanks::new())? & mask;
763 let mut target = ctx.big_uints.zero.clone();
751 let mut target = ctx.big_uints.zero.clone();
@@ -770,30 +758,30 @@ static FIL: Jet = |ctx, n| {
772static LSH: Jet = |_ctx, n| {
760static LSH: Jet = |_ctx, n| {
773− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
761+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
774 let a = a.as_bite();
762 let a = a.as_bite();
775− let b = b.as_atom().ok_or(TTanks::new())?;
763+ let b = b.as_atom().ok_or(Tanks::new())?;
777 Ok(Rc::new(Noun::Atom(b << a.bits())))
765 Ok(Rc::new(Noun::Atom(b << a.bits())))
780static RSH: Jet = |_ctx, n| {
768static RSH: Jet = |_ctx, n| {
781− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
769+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
782 let a = a.as_bite();
770 let a = a.as_bite();
783− let b = b.as_atom().ok_or(TTanks::new())?;
771+ let b = b.as_atom().ok_or(Tanks::new())?;
785 Ok(Rc::new(Noun::Atom(b >> a.bits())))
773 Ok(Rc::new(Noun::Atom(b >> a.bits())))
788−pub static RAP: Jet = |ctx, n| {
776+static RAP: Jet = |ctx, n| {
789− let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
777+ let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
790 let bloq = bloq.as_u32().unwrap();
778 let bloq = bloq.as_u32().unwrap();
791 let bits = 2u32.pow(bloq);
779 let bits = 2u32.pow(bloq);
793 let mut target = ctx.big_uints.zero.clone();
781 let mut target = ctx.big_uints.zero.clone();
795 for el in b.list_iter().collect::<Vec<_>>().iter().rev() {
783 for el in b.list_iter().collect::<Vec<_>>().iter().rev() {
796− let el = el.as_atom().ok_or(TTanks::new())?;
784+ let el = el.as_atom().ok_or(Tanks::new())?;
797 if el != &ctx.big_uints.zero {
785 if el != &ctx.big_uints.zero {
798 target = (target << (bits * met(bloq, &el))) | el;
786 target = (target << (bits * met(bloq, &el))) | el;
@@ -803,7 +791,7 @@ pub static RAP: Jet = |ctx, n| {
805static REP: Jet = |ctx, n| {
793static REP: Jet = |ctx, n| {
806− let (bite, b) = n.as_cell().ok_or(TTanks::new())?;
794+ let (bite, b) = n.as_cell().ok_or(Tanks::new())?;
807 let bite = bite.as_bite();
795 let bite = bite.as_bite();
809 let bits = bite.bits();
797 let bits = bite.bits();
@@ -812,18 +800,18 @@ static REP: Jet = |ctx, n| {
812 let mut target = ctx.big_uints.zero.clone();
800 let mut target = ctx.big_uints.zero.clone();
814 for el in b.list_iter().collect::<Vec<_>>().iter().rev() {
802 for el in b.list_iter().collect::<Vec<_>>().iter().rev() {
815− target = (target << bits) | (el.as_atom().ok_or(TTanks::new())? & &mask);
803+ target = (target << bits) | (el.as_atom().ok_or(Tanks::new())? & &mask);
818 Ok(Rc::new(Noun::Atom(target)))
806 Ok(Rc::new(Noun::Atom(target)))
821static REV: Jet = |ctx, n| {
809static REV: Jet = |ctx, n| {
822− let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
810+ let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
823− let (len, dat) = b.as_cell().ok_or(TTanks::new())?;
811+ let (len, dat) = b.as_cell().ok_or(Tanks::new())?;
824 let bloq = bloq.as_u32().unwrap();
812 let bloq = bloq.as_u32().unwrap();
825 let len = len.as_u32().unwrap();
813 let len = len.as_u32().unwrap();
826− let mut dat: Atom = dat.as_atom().ok_or(TTanks::new())?.clone();
814+ let mut dat: Atom = dat.as_atom().ok_or(Tanks::new())?.clone();
828 let bits = 2u32.pow(bloq);
816 let bits = 2u32.pow(bloq);
829 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
817 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
@@ -839,9 +827,9 @@ static REV: Jet = |ctx, n| {
841static RIP: Jet = |ctx, n| {
829static RIP: Jet = |ctx, n| {
842− let (bite, b) = n.as_cell().ok_or(TTanks::new())?;
830+ let (bite, b) = n.as_cell().ok_or(Tanks::new())?;
843 let bite = bite.as_bite();
831 let bite = bite.as_bite();
844− let mut b: Atom = b.as_atom().ok_or(TTanks::new())?.clone();
832+ let mut b: Atom = b.as_atom().ok_or(Tanks::new())?.clone();
846 let bits = bite.bits();
834 let bits = bite.bits();
847 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
835 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
@@ -857,11 +845,11 @@ static RIP: Jet = |ctx, n| {
859static RUN: Jet = |ctx, n| {
847static RUN: Jet = |ctx, n| {
860− let (bite, b) = n.as_cell().ok_or(TTanks::new())?;
848+ let (bite, b) = n.as_cell().ok_or(Tanks::new())?;
861− let (b, gate) = b.as_cell().ok_or(TTanks::new())?;
849+ let (b, gate) = b.as_cell().ok_or(Tanks::new())?;
863 let bite = bite.as_bite();
851 let bite = bite.as_bite();
864− let mut b: Atom = b.as_atom().ok_or(TTanks::new())?.clone();
852+ let mut b: Atom = b.as_atom().ok_or(Tanks::new())?.clone();
866 let bits = bite.bits();
854 let bits = bite.bits();
867 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
855 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
@@ -872,7 +860,7 @@ static RUN: Jet = |ctx, n| {
872 target = (target << bits)
860 target = (target << bits)
873 | ((*slam_pulled_gate(ctx, gate, &Rc::new(Noun::Atom(&mask & &b)))?)
861 | ((*slam_pulled_gate(ctx, gate, &Rc::new(Noun::Atom(&mask & &b)))?)
874 .as_atom()
862 .as_atom()
875− .ok_or(TTanks::new())?
863+ .ok_or(Tanks::new())?
876 & &mask);
864 & &mask);
877 b = b >> bits;
865 b = b >> bits;
@@ -881,11 +869,11 @@ static RUN: Jet = |ctx, n| {
883static RUT: Jet = |ctx, n| {
871static RUT: Jet = |ctx, n| {
884− let (bite, b) = n.as_cell().ok_or(TTanks::new())?;
872+ let (bite, b) = n.as_cell().ok_or(Tanks::new())?;
885− let (b, gate) = b.as_cell().ok_or(TTanks::new())?;
873+ let (b, gate) = b.as_cell().ok_or(Tanks::new())?;
887 let bite = bite.as_bite();
875 let bite = bite.as_bite();
888− let mut b: Atom = b.as_atom().ok_or(TTanks::new())?.clone();
876+ let mut b: Atom = b.as_atom().ok_or(Tanks::new())?.clone();
890 let bits = bite.bits();
878 let bits = bite.bits();
891 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
879 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
@@ -896,7 +884,7 @@ static RUT: Jet = |ctx, n| {
896 target.push(
884 target.push(
897 (*slam_pulled_gate(ctx, gate, &Rc::new(Noun::Atom(&mask & &b)))?)
885 (*slam_pulled_gate(ctx, gate, &Rc::new(Noun::Atom(&mask & &b)))?)
898 .as_atom()
886 .as_atom()
899− .ok_or(TTanks::new())?
887+ .ok_or(Tanks::new())?
902 b = b >> bits;
890 b = b >> bits;
@@ -906,12 +894,12 @@ static RUT: Jet = |ctx, n| {
908static SEW: Jet = |ctx, n| {
896static SEW: Jet = |ctx, n| {
909− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
897+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
910− let (b, recipient) = b.as_cell().ok_or(TTanks::new())?;
898+ let (b, recipient) = b.as_cell().ok_or(Tanks::new())?;
911− let (sew_start, c) = b.as_cell().ok_or(TTanks::new())?;
899+ let (sew_start, c) = b.as_cell().ok_or(Tanks::new())?;
912− let (number_of_blocks, donor) = c.as_cell().ok_or(TTanks::new())?;
900+ let (number_of_blocks, donor) = c.as_cell().ok_or(Tanks::new())?;
913− let recipient = recipient.as_atom().ok_or(TTanks::new())?;
901+ let recipient = recipient.as_atom().ok_or(Tanks::new())?;
914− let donor = donor.as_atom().ok_or(TTanks::new())?;
902+ let donor = donor.as_atom().ok_or(Tanks::new())?;
916 let bloq = a.as_u32().unwrap();
904 let bloq = a.as_u32().unwrap();
917 let bits = 2u32.pow(bloq);
905 let bits = 2u32.pow(bloq);
@@ -927,12 +915,12 @@ static SEW: Jet = |ctx, n| {
929static SWP: Jet = |ctx, n| {
917static SWP: Jet = |ctx, n| {
930− let (bloq, b) = n.as_cell().ok_or(TTanks::new())?;
918+ let (bloq, b) = n.as_cell().ok_or(Tanks::new())?;
931 let bloq = bloq.as_u32().unwrap();
919 let bloq = bloq.as_u32().unwrap();
932 let bits = 2u32.pow(bloq);
920 let bits = 2u32.pow(bloq);
933 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
921 let mask = (&ctx.big_uints.one << bits) - &ctx.big_uints.one;
935− let mut source = b.as_atom().ok_or(TTanks::new())?.clone();
923+ let mut source = b.as_atom().ok_or(Tanks::new())?.clone();
936 let mut target = ctx.big_uints.zero.clone();
924 let mut target = ctx.big_uints.zero.clone();
938 while source > ctx.big_uints.zero {
926 while source > ctx.big_uints.zero {
@@ -944,7 +932,7 @@ static SWP: Jet = |ctx, n| {
946static XEB: Jet = |_ctx, n| {
934static XEB: Jet = |_ctx, n| {
947− let mut a = n.as_atom().ok_or(TTanks::new())?.clone();
935+ let mut a = n.as_atom().ok_or(Tanks::new())?.clone();
949 let mut c = 0;
937 let mut c = 0;
@@ -961,22 +949,22 @@ static DIS: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a & b);
961static MIX: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a ^ b);
949static MIX: Jet = |_ctx, n| BINARY_ATOM(n, |a, b| a ^ b);
963static NOT: Jet = |ctx, n| {
951static NOT: Jet = |ctx, n| {
964− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
952+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
965− let (b, c) = b.as_cell().ok_or(TTanks::new())?;
953+ let (b, c) = b.as_cell().ok_or(Tanks::new())?;
967 let bloq = a.as_u32().unwrap();
955 let bloq = a.as_u32().unwrap();
968 let bits = 2u32.pow(bloq);
956 let bits = 2u32.pow(bloq);
969 let mask = (&ctx.big_uints.one << (bits * b.as_u32().unwrap())) - &ctx.big_uints.one;
957 let mask = (&ctx.big_uints.one << (bits * b.as_u32().unwrap())) - &ctx.big_uints.one;
971− let target = c.as_atom().ok_or(TTanks::new())? ^ &mask;
959+ let target = c.as_atom().ok_or(Tanks::new())? ^ &mask;
973 Ok(Rc::new(Noun::Atom(target)))
961 Ok(Rc::new(Noun::Atom(target)))
976static LAST: Jet = |_ctx, n| {
964static LAST: Jet = |_ctx, n| {
977− let (a, b) = n.as_cell().ok_or(TTanks::new())?;
965+ let (a, b) = n.as_cell().ok_or(Tanks::new())?;
978− let a = a.as_hair().ok_or(TTanks::new())?;
966+ let a = a.as_hair().ok_or(Tanks::new())?;
979− let b = b.as_hair().ok_or(TTanks::new())?;
967+ let b = b.as_hair().ok_or(Tanks::new())?;
980 Ok(Noun::from_hair(last(&a, &b)))
968 Ok(Noun::from_hair(last(&a, &b)))
@@ -997,185 +985,22 @@ fn last<'a>(a: &'a Hair, b: &'a Hair) -> &'a Hair {
999static TRIP: Jet = |_ctx, n| {
987static TRIP: Jet = |_ctx, n| {
1000− let a = n.as_atom().ok_or(TTanks::new())?;
988+ let a = n.as_atom().ok_or(Tanks::new())?;
1001 Ok(Noun::list(
989 Ok(Noun::list(
1002 a.to_bytes_le().iter().map(|b| Noun::from_u32(*b as u32)),
990 a.to_bytes_le().iter().map(|b| Noun::from_u32(*b as u32)),
1006static MUK: Jet = |_ctx, n| {
994static MUK: Jet = |_ctx, n| {
1007− let (seed, len) = n.as_cell().ok_or(TTanks::new())?;
995+ let (seed, len) = n.as_cell().ok_or(Tanks::new())?;
1008− let (len, key) = len.as_cell().ok_or(TTanks::new())?;
996+ let (len, key) = len.as_cell().ok_or(Tanks::new())?;
1009− let seed = seed.as_u32().ok_or(TTanks::new())?;
997+ let seed = seed.as_u32().ok_or(Tanks::new())?;
1010− let len = len.as_u32().ok_or(TTanks::new())?;
998+ let len = len.as_u32().ok_or(Tanks::new())?;
1011− let key = key.as_atom().ok_or(TTanks::new())?;
999+ let key = key.as_atom().ok_or(Tanks::new())?;
1013 Ok(Rc::new(Noun::from_u32(muk(seed, len, key))))
1001 Ok(Rc::new(Noun::from_u32(muk(seed, len, key))))
1016−static AOR: Jet = |ctx, n| {
1017− let (a, b) = n.as_cell().ok_or(EMPTY_TANKS)?;
1020− Ok(ctx.nouns.y.clone())
1022− match (a.borrow(), b.borrow()) {
1023− (Noun::Cell { .. }, Noun::Atom(_)) => Ok(ctx.nouns.n.clone()),
1024− (Noun::Cell { p: a_p, q: a_q, .. }, Noun::Cell { p: b_p, q: b_q, .. }) => {
1026− AOR(ctx, &cell(a_q, b_q))
1028− AOR(ctx, &cell(a_p, b_p))
1031− (Noun::Atom(_), Noun::Cell { .. }) => Ok(ctx.nouns.y.clone()),
1032− (Noun::Atom(a), Noun::Atom(b)) => {
1033− let a = a.to_bytes_le();
1034− let b = b.to_bytes_le();
1038− let c = a.get(i).unwrap_or(&0);
1039− let d = b.get(i).unwrap_or(&0);
1045− return Ok(ctx.nouns.y.clone());
1047− return Ok(ctx.nouns.n.clone());
1056−static DOR: Jet = |ctx, n| {
1057− let (a, b) = n.as_cell().ok_or(EMPTY_TANKS)?;
1060− Ok(ctx.nouns.y.clone())
1062− match (a.borrow(), b.borrow()) {
1063− (Noun::Cell { .. }, Noun::Atom(_)) => Ok(ctx.nouns.n.clone()),
1064− (Noun::Cell { p: a_p, q: a_q, .. }, Noun::Cell { p: b_p, q: b_q, .. }) => {
1066− DOR(ctx, &cell(a_q, b_q))
1068− DOR(ctx, &cell(a_p, b_p))
1071− (Noun::Atom(_), Noun::Cell { .. }) => Ok(ctx.nouns.y.clone()),
1072− (Noun::Atom(a), Noun::Atom(b)) => {
1074− Ok(ctx.nouns.y.clone())
1076− Ok(ctx.nouns.n.clone())
1083−static GOR: Jet = |ctx, n| {
1084− let (a, b) = n.as_cell().ok_or(EMPTY_TANKS)?;
1092− Ok(ctx.nouns.y.clone())
1094− Ok(ctx.nouns.n.clone())
1099−static GOR_PAIR: fn(&mut InterpreterContext, &Rc<Noun>, &Rc<Noun>) -> Result<bool, TTanks> =
1105− Ok(DOR(ctx, &(a.clone(), b.clone()).as_noun())? == ctx.nouns.y)
1111−static MOR: Jet = |ctx, n| {
1112− let (a, b) = n.as_cell().ok_or(EMPTY_TANKS)?;
1113− let c = Noun::from_u32(a.mug()).mug();
1114− let d = Noun::from_u32(b.mug()).mug();
1120− Ok(ctx.nouns.y.clone())
1122− Ok(ctx.nouns.n.clone())
1127−static LOOK: Jet = |ctx, n| {
1128− let (cog, dab) = n.as_cell().ok_or(EMPTY_TANKS)?;
1129− LOOK_PAIR(ctx, Atom::new(vec![1]), cog, dab)
1132−static LOOK_PAIR: fn(
1133− &mut InterpreterContext,
1137−) -> Result<Rc<Noun>, TTanks> = |ctx, axe, cog, dab| {
1139− Ok(ctx.nouns.sig.clone())
1141− let (node, b, c) = dab.tuple_3().ok_or(EMPTY_TANKS)?;
1144− let (p, q) = node.as_cell().ok_or(EMPTY_TANKS)?;
1145− if b.is_sig() && c.is_sig() {
1147− Ok((ctx.nouns.sig.clone(), Noun::Atom(axe), q.clone()).as_noun())
1149− Ok(ctx.nouns.sig.clone())
1151− } else if b.is_sig() {
1153− Ok((ctx.nouns.sig.clone(), PEG_U32(&axe, 2), q.clone()).as_noun())
1154− } else if GOR_PAIR(ctx, cog, p)? {
1155− Ok(ctx.nouns.sig.clone())
1157− LOOK_PAIR(ctx, PEG_U32(&axe, 3), cog, r)
1159− } else if c.is_sig() {
1161− Ok((ctx.nouns.sig.clone(), PEG_U32(&axe, 2), q.clone()).as_noun())
1162− } else if GOR_PAIR(ctx, cog, p)? {
1163− LOOK_PAIR(ctx, PEG_U32(&axe, 3), cog, l)
1165− Ok(ctx.nouns.sig.clone())
1169− Ok((ctx.nouns.sig.clone(), PEG_U32(&axe, 2), q.clone()).as_noun())
1170− } else if GOR_PAIR(ctx, cog, p)? {
1171− LOOK_PAIR(ctx, PEG_U32(&axe, 6), cog, l)
1173− LOOK_PAIR(ctx, PEG_U32(&axe, 7), cog, r)
1179static JUST: DoubleJet = |ctx, n, m| {
1004static JUST: DoubleJet = |ctx, n, m| {
1180 let char = n.as_atom()?;
1005 let char = n.as_atom()?;
1181 let nail = m.as_nail()?;
1006 let nail = m.as_nail()?;