I’m still working to improve the TinyScheme package. I figured out the configuration and patches I needed to build the TinyScheme libraries, represented in this commit:
This patch causes
libtinyscheme.a to be built in the build_dir directory in the libreCMC source code, but it does not actually get them included in the ipkg package. I was planning to add that in as a selectable package option.
The library is for embedding TinyScheme in another program.
My TinyScheme package was accepted into libreCMC, commit 4a64056e70. Until their next build (a few months away) I’ll keep a binary package available for mips_24kc. That installs on the TPE-R1100, GL-AR150, GL-AR300M16, and GL-AR300M targets, among others.
(define (fact n)
(do ((rem n (- rem 1))
(acc 1 (* rem acc)))
((= rem 1) acc)))
(map fact '(1 2 3 4 5 6 7 8 9 10 11 12 13))
ts> (1 2 6 24 120 720 5040 40320 362880 3628800 39916800 479001600 1932053504)
The 32 bit integer overflow is visible at
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:
(+ 2 3 4)
(write "Hello World!")
ts> "Hello World!"#t
(define (fact n) (if (= n 1) 1 (* n (fact (- n 1)))))
Scripts files can be used:
root@pathos:~# cat script.scm
"2 + 2 = "
(number->string (+ 2 2))
2 + 2 = 4