aboutsummaryrefslogtreecommitdiff
path: root/src/macros
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros')
-rw-r--r--src/macros/macros.sc9
1 files changed, 9 insertions, 0 deletions
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 <https://www.gnu.org/licenses/>.
+(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)