Skip to content

Instantly share code, notes, and snippets.

@tani
Last active October 19, 2018 15:02
Show Gist options
  • Save tani/66b055fd107a41bff5dd86344738318a to your computer and use it in GitHub Desktop.
Save tani/66b055fd107a41bff5dd86344738318a to your computer and use it in GitHub Desktop.
#|
$ cat test.f
#!forth
: <= over over < rot swap = or ;
: fib dup 0 swap <= if drop 0 else dup 1 = if drop 1 else
dup 1 swap - fib swap 2 swap - fib + then then ;
10 fib
$ ros run -l uf-reader.lisp -l test.f -q
|#
(require 'uf)
(in-package :cl-user)
(defun uf-reader (s a b)
(declare (ignorable a b))
(read-line s) ;; Drop first line
(uf:execute (uf:init-vm (uf:parse s))))
(set-dispatch-macro-character #\# #\! #'uf-reader)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment