From ad1b763fd1537a649c947176d4dee4f3d8b53405 Mon Sep 17 00:00:00 2001 From: trans_soup <> Date: Tue, 31 Oct 2023 17:44:06 +0100 Subject: [PATCH] add main demo program. --- program.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 program.txt diff --git a/program.txt b/program.txt new file mode 100644 index 0000000..3fc4cae --- /dev/null +++ b/program.txt @@ -0,0 +1,45 @@ +clear + +'quit 'q defun +'quit 'exit defun +'quit ':q defun + +'defun 'def defun +'defun '; def + +'quote '" ; + +'clear 'cl ; + +'~ 'swap ; +': 'dup ; + +1 '+ '++ ; +1 '- '-- ; + +'~ '_ 'backpop ; + +0 '_ 'noop ; + + + +'> '~ '< ; + +''~ '~ 'exec_if_0 '_ 'exec 'if_0_else ; +''noop '~ 'if_0_else 'exec_if_not_0 ; + + + +': 1 '- ': ''countdown '~ 'exec_if_not_0 'countdown ; + + + +'size 2 '- 'cons ; +'deref 'head ; +'++ 'deref 'tail ; + +': ''next '~ ''current '~ 'if_0_else 'nth ; +'_ 'head 'current ; +'-- '~ 'tail '~ 'nth 'next ; + +'world 0 cons 'hello swap cons 'uwu swap cons