summaryrefslogtreecommitdiff
path: root/src/eval/scope.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-07 13:39:05 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-07 13:39:05 +0100
commite35bbfffcb1f84b2fb0679759152ca0a5eabfad4 (patch)
tree28123506b60be4e90ec611f8f3f9bb0ab5bec2f6 /src/eval/scope.rs
parent062d99f70fe5eed0fbc81182565b51360495e465 (diff)
Remove captured expression 🗑️
Diffstat (limited to 'src/eval/scope.rs')
-rw-r--r--src/eval/scope.rs5
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)