summaryrefslogtreecommitdiff
path: root/src/eval/func.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-05-26 17:14:44 +0200
committerLaurenz <laurmaedje@gmail.com>2022-05-26 17:14:44 +0200
commit806d9f0d9ab381500318f3e106b9c20c5eabccb7 (patch)
tree7466967220be358c4fd8c5e26f0c3ca501fafa97 /src/eval/func.rs
parent22214a1e0a79666caefd486e41828f015878ecb0 (diff)
Pure functions!
Diffstat (limited to 'src/eval/func.rs')
-rw-r--r--src/eval/func.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eval/func.rs b/src/eval/func.rs
index f15549dc..12dbfb2e 100644
--- a/src/eval/func.rs
+++ b/src/eval/func.rs
@@ -206,7 +206,7 @@ impl Closure {
// Parse the arguments according to the parameter list.
for (param, default) in &self.params {
- scopes.top.def_mut(param, match default {
+ scopes.top.define(param, match default {
None => args.expect::<Value>(param)?,
Some(default) => {
args.named::<Value>(param)?.unwrap_or_else(|| default.clone())
@@ -216,7 +216,7 @@ impl Closure {
// Put the remaining arguments into the sink.
if let Some(sink) = &self.sink {
- scopes.top.def_mut(sink, args.take());
+ scopes.top.define(sink, args.take());
}
// Determine the route inside the closure.