From 6223fc20f3d5c338b333be52668a1c62ed84a4e3 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 27 Nov 2017 00:57:26 -0800 Subject: [PATCH] List datatype --- src/rukka_lang/mod.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/rukka_lang/mod.rs b/src/rukka_lang/mod.rs index 6f1dde3..e8e3827 100644 --- a/src/rukka_lang/mod.rs +++ b/src/rukka_lang/mod.rs @@ -18,7 +18,19 @@ impl ProgrammingLanguageInterface for Rukka { fn evaluate_in_repl(&mut self, input: &str, _eval_options: &EvalOptions) -> ReplOutput { let mut output = ReplOutput::default(); - output.add_output(format!("Everything is ()")); + output.add_output(eval(input)); output } } + +fn eval(input: &str) -> String { + let a = List { next: None }; + let b = List { next: Some(&a) }; + + format!("Everything is () {:?}", b) +} + +#[derive(Debug)] +struct List<'a> { + next: Option<&'a List<'a>>, +}