summaryrefslogtreecommitdiff
path: root/src/eval
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-03-03 18:15:33 +0100
committerLaurenz <laurmaedje@gmail.com>2021-03-03 18:15:33 +0100
commit1cfc3c72b59f96d1cef3f2e6e488b645648c36ab (patch)
tree11bceb52a84d6cc17f0b14d39d5b5b291393b3e9 /src/eval
parentc94a18833f23d2b57de1b87971458fd54b56d088 (diff)
Show name of user-defined functions in representation 🦋
Diffstat (limited to 'src/eval')
-rw-r--r--src/eval/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/eval/mod.rs b/src/eval/mod.rs
index f30ee7a7..17620161 100644
--- a/src/eval/mod.rs
+++ b/src/eval/mod.rs
@@ -401,7 +401,8 @@ impl Eval for ExprClosure {
visitor.finish()
};
- Value::Func(ValueFunc::new(None, move |ctx, args| {
+ let name = self.name.as_ref().map(|id| id.to_string());
+ Value::Func(ValueFunc::new(name, move |ctx, args| {
// Don't leak the scopes from the call site. Instead, we use the
// scope of captured variables we collected earlier.
let prev = std::mem::take(&mut ctx.scopes);