From e35bbfffcb1f84b2fb0679759152ca0a5eabfad4 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 7 Feb 2021 13:39:05 +0100 Subject: =?UTF-8?q?Remove=20captured=20expression=20=F0=9F=97=91=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eval/scope.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/eval/scope.rs') 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, 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) -- cgit v1.2.3