diff --git a/schala-lang/src/lib.rs b/schala-lang/src/lib.rs index f974559..176b8fd 100644 --- a/schala-lang/src/lib.rs +++ b/schala-lang/src/lib.rs @@ -40,7 +40,7 @@ pub struct Schala { } impl Schala { - pub fn new() -> Schala { + fn new_blank_env() -> Schala { let symbols = Rc::new(RefCell::new(symbol_table::SymbolTable::new())); Schala { symbol_table: symbols.clone(), @@ -48,6 +48,15 @@ impl Schala { state: eval::State::new(symbols), } } + + pub fn new() -> Schala { + let prelude = r#" +type Option = Some(T) | None + "#; + let mut s = Schala::new_blank_env(); + s.execute_pipeline(prelude, &EvalOptions::default()); + s + } } fn tokenizing(_handle: &mut Schala, input: &str, comp: Option<&mut UnfinishedComputation>) -> Result, String> {