From 319dea49745c0f1b7c95fe8e3078794407c4c7c6 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 7 May 2021 16:42:25 +0530 Subject: Define when and unless sc macros. * src/macros/macros.sc (when, unless): New macros. --- src/macros/macros.sc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/macros/macros.sc b/src/macros/macros.sc index ac9e6d7..5ba9e1f 100644 --- a/src/macros/macros.sc +++ b/src/macros/macros.sc @@ -17,6 +17,15 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with nsmc. If not, see . +(sc-define-syntax (when condition body ...) + (cond + (condition + body ...))) + +(sc-define-syntax (unless condition body ...) + (when (not condition) + body ...)) + (sc-define-syntax (for-i index limit body ...) (for ((define index int 0) (< index limit) -- cgit v1.2.3