From 9573dffae70e9d674dec84082ddc162f7f7eb418 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Fri, 12 Jan 2024 19:05:03 -0800 Subject: add functions --- examples/stdlib.stem | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/stdlib.stem b/examples/stdlib.stem index 00a4f67..a063c9b 100644 --- a/examples/stdlib.stem +++ b/examples/stdlib.stem @@ -9,3 +9,12 @@ loop [ swap 1 - swap loop ] [ dsc dsc ] if ] func + +# Author: Matthew H +dupd [ [ dup ] keep ] func +over [ dupd swap ] func +dup2 [ over over ] func +dip2 [ swap [ dip ] dip ] func + +loop-times [ dup2 [ swap [ ] if ] dip2 +dup [ 1 - loop-times ] [ dsc dsc ] if ] func -- cgit