From c9168f1e15b0eb183b3f5796194b505076e80abf Mon Sep 17 00:00:00 2001 From: trans_soup <> Date: Wed, 1 Nov 2023 14:20:36 +0100 Subject: [PATCH] refactor `doall` method. --- main.io | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.io b/main.io index c7c7e2f..eebc4c3 100644 --- a/main.io +++ b/main.io @@ -38,9 +38,14 @@ read := method( print_stack ) +action_queue := List clone + doall := method(line, - actions := line splitNoEmpties - actions foreach(v, doword(v)) + action_queue = line splitNoEmpties + while(action_queue size > 0, + action := action_queue removeAt(0) + doword(action) + ) ) doword := method(word,