From 721dc203be4f729453115ac56d02975abdd6dbc5 Mon Sep 17 00:00:00 2001 From: Nathan Braswell Date: Fri, 10 Apr 2020 23:05:05 -0400 Subject: [PATCH] Loop function can be simpler --- bf.kp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bf.kp b/bf.kp index 1afa3e2..e6e4892 100644 --- a/bf.kp +++ b/bf.kp @@ -10,11 +10,11 @@ (add_grammer_rule :bfs_list [] (fn* [xs] xs)) (add_grammer_rule :bfs_list [:non_empty_bfs_list] (fn* [xs] (nth xs 0))) (add_grammer_rule :bfs_atom ["\\[" :bfs_list "]"] (fn* [xs] - `(let* (f (fn* [f] + `(let* (f (fn* [] (if (= 0 (nth (deref arr) (deref ptr))) nil - (do ,(nth xs 1) (f f))))) - (f f)))) + (do ,(nth xs 1) (f))))) + (f)))) (add_grammer_rule :bfs [:bfs_list] (fn* [xs] (nth xs 0))) (def! with_update (fn* [arr idx val] (if