diff options
-rw-r--r-- | src/lisp/primitives.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lisp/primitives.rs b/src/lisp/primitives.rs new file mode 100644 index 0000000..1c9fe8e --- /dev/null +++ b/src/lisp/primitives.rs | |||
@@ -0,0 +1,10 @@ | |||
1 | #[macro_export] | ||
2 | macro_rules! primitive { | ||
3 | ($env:expr, $arity:expr, $name:expr, $closure:expr) => { | ||
4 | let val = crate::lisp::expr::LispExpr::PrimitiveFunc(crate::lisp::expr::PrimitiveFunc { | ||
5 | arity: $arity, | ||
6 | closure: $closure, | ||
7 | }); | ||
8 | let _ = $env.insert($name.to_string(), val); | ||
9 | }; | ||
10 | } | ||