A small Lisp (Scheme) interpreter in Tcl inspired by Peter Norvig's Lispy. I've also drawn some inspiration from 'Lisp in Small Pieces' by Christian Queinnec.
The name Thtcl comes from Lisp + Tcl. Pronunciation "thtickel". Or whatever.
To use, place the compound source files (thtcl-level-1.tcl and thtcl-level-2.tcl) in a directory. Start tkcon and navigate to the directory. Source either thtcl-level-1.tcl or thtcl-level-2.tcl. Use the repl command to run a dialog loop with the interpreter.
For A. %F0%9F%90%88
On my cheap computer, the following code takes 0.013 seconds to run. Lispy does it in 0.003 seconds on Norvig's probably significantly faster machine. If anyone would care to compare this code to the Python one I'm all ears (plewerin x gmail com).
evaluate [parse "(define fact (lambda (n) (if (<= n 1) 1 (* n (fact (- n 1))))))"] time {evaluate [parse "(fact 100)"]} 10
Thtcl does not aim for compactness of code. I have tried to make the code readable, and I have added features beyond Lispy (like macros) which take up a lot of horizontal space, at last count 621 lines of code. At the end of the day, however, it is a pointless effort since Tcl can't distinguish between a list of one item and an atom, making it impossible to compute a large number of programs, both simple and sophisticated. It's fun to work with anyway, and I've learned a lot about Lisp interpreters.