Last active
October 19, 2018 15:02
-
-
Save tani/66b055fd107a41bff5dd86344738318a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#| | |
$ 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