diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-04 20:22:11 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-04 20:22:11 +0200 |
| commit | ef8aa763faa59fd62c90c6d6245e8d2c5eece35e (patch) | |
| tree | d36192af0c770b076a5004ba8bcae3c2df728c75 /src/eval/scope.rs | |
| parent | a41d7ab47dda1e30465bdf91fd02bca0e634a38d (diff) | |
Shorten some names ↔
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 { |
