From 5f7f7e4aed37b405b66eeb5c3617e33e1f607627 Mon Sep 17 00:00:00 2001 From: Roman Godmaire Date: Sun, 12 May 2024 22:10:44 -0400 Subject: [PATCH] feat: swap macro --- mute-interpreter/src/env/standard.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mute-interpreter/src/env/standard.rs b/mute-interpreter/src/env/standard.rs index eb833cd..a6a9757 100644 --- a/mute-interpreter/src/env/standard.rs +++ b/mute-interpreter/src/env/standard.rs @@ -19,6 +19,13 @@ pub(super) fn standard() -> HashMap { (macro* (name args body) ~(define (,name (fn* ,args ,body))) ) }, ), + ( + "swap", + inline! { + (macro* (a b) ~(define (,a ,b) (,b ,a))) + }, + ), + // Quoting ( "quote", inline! {