@@ -7,7 +7,7 @@ use std::{
77};
88
99use crate::{
10− interpreter::InterpreterContext,
10+ interpreter::{call_gate, InterpreterContext},
1111 noun::{self, cell, Atom, Noun},
1212};
1313
@@ -38,6 +38,7 @@ pub fn generate_jets() -> Jets {
3838 (224124632134128248273067864092142254001, INTO),
3939 (22365719601138689598430859488399820563, JOIN),
4040 (211253539934007667533839299235896640130, LENT),
41+ (104838119266193725126177792605193739824, LEVY),
4142 ])
4243}
4344
@@ -287,3 +288,14 @@ static JOIN: Jet = |_ctx, n| {
287288};
288289
289290static LENT: Jet = |_ctx, n| Rc::new(Noun::from_u32(n.list_iter().fold(0u32, |l, _| l + 1)));
291+
292+static LEVY: Jet = |ctx, n| {
293+ let (a, b) = n.as_cell().unwrap();
294+ if a.list_iter()
295+ .all(|n| call_gate(ctx, b.clone(), n) == ctx.nouns.y)
296+ {
297+ ctx.nouns.y.clone()
298+ } else {
299+ ctx.nouns.n.clone()
300+ }
301+};