KLambda and the Shen Evaluator
The Shen evaluator compiles Shen into Kλ and Kλ into native code. The Shen evaluator
accepts S-exprs as legal input and since Kλ expressions are such, any Kλ expression is a legal
input to Shen. Note that if a Kλ expression is typed into Shen, that special constructions such as the
list/string/vectors constructors in Shen which are outside the Kλ spec (see the sections below) will
actually work within such expressions because they are compiled into legal Kλ. Thus the function;
A. (defun list-all (x y z) [x y z])
is not legal Kλ and would have to be written as follows to be legal Kλ
B. (defun list-all (x y z) (cons x (cons y (cons z ()))))
However expression A. will be accepted and compiled by Shen into expression B.
Hence hybrid programming
will work in Shen. We don't actually recommend this style, because Kλ is not designed for the purposes of
programming, but for easy porting and implementation. However you can write Kλ code in Shen which is as compact
as Common Lisp.