diff options
Diffstat (limited to 'src/eval/scope.rs')
| -rw-r--r-- | src/eval/scope.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/eval/scope.rs b/src/eval/scope.rs index 7d69e1fc..fc530bbb 100644 --- a/src/eval/scope.rs +++ b/src/eval/scope.rs @@ -18,15 +18,15 @@ impl Scope { Self { functions: HashMap::new() } } - /// Associate the given name with the function. - pub fn insert(&mut self, name: impl Into<String>, function: ValueFunc) { - self.functions.insert(name.into(), function); - } - /// Return the function with the given name if there is one. - pub fn func(&self, name: &str) -> Option<&ValueFunc> { + pub fn get(&self, name: &str) -> Option<&ValueFunc> { self.functions.get(name) } + + /// Associate the given name with the function. + pub fn set(&mut self, name: impl Into<String>, function: ValueFunc) { + self.functions.insert(name.into(), function); + } } impl Debug for Scope { |
