From 0045795a808d2017bd8e7db9b43a57192ba5eed7 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Fri, 12 Jan 2024 11:02:57 -0800 Subject: add loop --- examples/stdlib.stem | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'examples/stdlib.stem') diff --git a/examples/stdlib.stem b/examples/stdlib.stem index eca48c8..00a4f67 100644 --- a/examples/stdlib.stem +++ b/examples/stdlib.stem @@ -1,2 +1,11 @@ evalstr [ strquote eval ] func include [ fread evalstr ] func + +# Author of loop function: Andrei S +loop [ + swap dup 0 > [ + swap + dup eval + swap 1 - swap loop + ] [ dsc dsc ] if +] func -- cgit