diff options
author | Preston Pan <preston@nullring.xyz> | 2024-01-12 19:05:03 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2024-01-12 19:05:03 -0800 |
commit | 9573dffae70e9d674dec84082ddc162f7f7eb418 (patch) | |
tree | 1664f55e8ab8eb10ec796713fc0cb72be8aa7c25 | |
parent | 50c4723dee869078ebb00f1ced484686f38430dc (diff) |
add functions
-rw-r--r-- | examples/stdlib.stem | 9 |
1 files changed, 9 insertions, 0 deletions
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 |