TinyScheme Package

Since discovering libreCMC, I was discouraged by the lack of a lisp package. I was able today to hack together a TinyScheme Makefile for OpenWRT / libreCMC, and was able to build a mips_24kc package, which installs at least on my GL-AR300M units. It should install just as well on the GL-AR150 and the TPE-R1100.

EDIT: Package moved. See the more recent post.

This package, however, only installs TinyScheme itself, plus the init.scm file. There is also a shared library for embedding TinyScheme in another application, but I had trouble getting that to build. But at least we have our interpreter:

root@pathos:~# tinyscheme 
TinyScheme 1.41
(+ 2 3 4)
ts> 9
(write "Hello World!")
ts> "Hello World!"#t
(define (fact n) (if (= n 1) 1 (* n (fact (- n 1)))))
ts> fact
(fact 4)
ts> 24

Scripts files can be used:

root@pathos:~# cat script.scm
#!/usr/bin/tinyscheme -1

(display
 (string-append
   "2 + 2 = "
   (number->string (+ 2 2))
   "\n"))

root@pathos:~# ./script.scm
2 + 2 = 4

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s