From 0b7363016f580c4ee668e459a4499ffe83f6fd72 Mon Sep 17 00:00:00 2001 From: Koichi Nakamura Date: Sat, 9 Jan 2021 17:20:09 +0900 Subject: [PATCH] Add max and min --- bootstrap.fs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bootstrap.fs b/bootstrap.fs index b57863f..c5925b5 100644 --- a/bootstrap.fs +++ b/bootstrap.fs @@ -769,6 +769,11 @@ alias-builtin xor ^ repeat ; immediate +\ === Integer Arithmetic (that require control flow words) === +\ ( a b -- c ) +: max 2dup > if drop else nip then ; +: min 2dup < if drop else nip then ; + \ === Multiline Comment === : '(' [ key ( ] literal ;