summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-03-03 17:53:40 +0100
committerLaurenz <laurmaedje@gmail.com>2021-03-03 17:53:40 +0100
commitc94a18833f23d2b57de1b87971458fd54b56d088 (patch)
tree9e1ed55cfca15aef6d39ced50a3a5b14d2800aae /src/library
parent4d90a066f197264341eff6bf67e8c06cae434eb4 (diff)
Closures and function definitions 🚀
Supports: - Closure syntax: `(x, y) => z` - Shorthand for a single argument: `x => y` - Function syntax: `let f(x) = y` - Capturing of variables from the environment - Error messages for too few / many passed arguments Does not support: - Named arguments - Variadic arguments with `..`
Diffstat (limited to 'src/library')
-rw-r--r--src/library/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/mod.rs b/src/library/mod.rs
index 59198846..d34b338c 100644
--- a/src/library/mod.rs
+++ b/src/library/mod.rs
@@ -23,7 +23,7 @@ pub fn new() -> Scope {
let mut std = Scope::new();
macro_rules! set {
(func: $name:expr, $func:expr) => {
- std.def_const($name, ValueFunc::new($name, $func))
+ std.def_const($name, ValueFunc::new(Some($name.into()), $func))
};
(any: $var:expr, $any:expr) => {
std.def_const($var, ValueAny::new($any))