@@ -42,6 +42,7 @@ pub struct InterpreterContext {
4242 pub nouns: Nouns,
4343 pub big_uints: BigUints,
4444 pub memo: BTreeMap<Hash, Rc<Noun>>,
45+ pub slog: fn(&String) -> (),
4546}
4647
4748pub fn generate_interpreter_context() -> InterpreterContext {
@@ -83,6 +84,7 @@ pub fn generate_interpreter_context() -> InterpreterContext {
8384 },
8485 big_uints,
8586 memo: BTreeMap::new(),
87+ slog: |str: &String| eprintln!("{}", str),
8688 }
8789}
8890
@@ -300,7 +302,7 @@ fn tar_u32<'a>(
300302 let noun = tar(ctx, subj.clone(), &q)?;
301303 let (_prio, tank) = noun.as_cell().ok_or(TTanks::new())?;
302304
303− eprintln!("{}", ram(ctx, tank.clone()).unwrap_or(String::new()));
305+ (ctx.slog)(&ram(ctx, tank.clone()).unwrap_or(String::new()));
304306 eval(ctx)
305307 } else {
306308 eval(ctx)