From 29230404a3d269dddc896856cc235e11139620aa Mon Sep 17 00:00:00 2001 From: Nathan Braswell Date: Tue, 12 May 2020 00:33:29 -0400 Subject: [PATCH] Remove just a tad more of bf --- bf.kp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bf.kp b/bf.kp index 876becc..34ce9ae 100644 --- a/bf.kp +++ b/bf.kp @@ -11,19 +11,16 @@ (add_grammer_rule 'bfs_atom ["."] (fn* (xs) '(set-nth! output 0 (cons (nth tape (nth cursor 0)) (nth output 0))))) ; Define strings of BF atoms -(add_grammer_rule 'bfs_list ['bfs_atom +] (fn* (xs) (nth xs 0))) +(add_grammer_rule 'bfs ['bfs_atom +] (fn* (xs) (nth xs 0))) ; Add loop as an atom -(add_grammer_rule 'bfs_atom ["\\[" 'bfs_list "]"] (fn* (xs) +(add_grammer_rule 'bfs_atom ["\\[" 'bfs "]"] (fn* (xs) `(let* (f (fn* (f) (if (= 0 (nth tape (nth cursor 0))) nil (do ,(nth xs 1) (f f))))) (f f)))) -; Top level BFS rule -(add_grammer_rule 'bfs ['bfs_list] (fn* (xs) (nth xs 0))) - ; For now, stick BFS rule inside an unambigious BFS block ; and add compilation/implementation ; Note that this compilation into the underlying Lisp