diff options
Diffstat (limited to 'src/eval/scope.rs')
| -rw-r--r-- | src/eval/scope.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/eval/scope.rs b/src/eval/scope.rs index 70338041..8f2bd1d5 100644 --- a/src/eval/scope.rs +++ b/src/eval/scope.rs @@ -86,6 +86,11 @@ impl Scope { self.values.insert(var.into(), Rc::new(RefCell::new(value.into()))); } + /// Define a variable with a slot. + pub fn def_slot(&mut self, var: impl Into<String>, slot: Slot) { + self.values.insert(var.into(), slot); + } + /// Look up the value of a variable. pub fn get(&self, var: &str) -> Option<&Slot> { self.values.get(var) |
