diff --git a/schala-lang/language/src/lib.rs b/schala-lang/language/src/lib.rs index f986e21..8b82cb8 100644 --- a/schala-lang/language/src/lib.rs +++ b/schala-lang/language/src/lib.rs @@ -80,7 +80,7 @@ impl Schala { let prelude = include_str!("prelude.schala"); let mut s = Schala::new_blank_env(); - let request = ComputationRequest { source: prelude.to_string(), debug_requests: vec![] }; + let request = ComputationRequest { source: prelude, debug_requests: vec![] }; s.run_computation(request); s } diff --git a/schala-repl/src/language.rs b/schala-repl/src/language.rs index 2433699..989c3e5 100644 --- a/schala-repl/src/language.rs +++ b/schala-repl/src/language.rs @@ -17,9 +17,8 @@ pub trait ProgrammingLanguageInterface { } } -//TODO source can probably be a &str -pub struct ComputationRequest { - pub source: String, +pub struct ComputationRequest<'a> { + pub source: &'a str, pub debug_requests: Vec, } diff --git a/schala-repl/src/repl/mod.rs b/schala-repl/src/repl/mod.rs index 38bf025..1f04063 100644 --- a/schala-repl/src/repl/mod.rs +++ b/schala-repl/src/repl/mod.rs @@ -175,7 +175,7 @@ impl Repl { let ref mut language_state = self.get_cur_language_state(); let request = ComputationRequest { - source: input.to_string(), + source: input, debug_requests: vec![], };