You are looking at historical revision 37157 of this page. It may differ significantly from its current revision.
shen
A port of the Shen programming language for Chicken Scheme.
Shen
Shen is a hosted language that comes with a macro system, prolog, optional type system based on sequent calculus and a YACC.
Egg Author
David Ireland (djireland79 at gmail dot com)
Shen Documentation
The best source of information for Shen programming is the The Book of Shen and the Shen web site .
Egg Source Code
Starting the REPL
$ chicken-shen
Shen, copyright (C) 2010-2015 Mark Tarver www.shenlanguage.org, Shen 21.1 running under Scheme, implementation: Chicken port 0.1 ported by David Ireland (0-)
Example Shen Code
Starting the REPL from a terminal
$ chicken-shen
Shen, copyright (C) 2010-2015 Mark Tarver www.shenlanguage.org, Shen 21.1 running under Scheme, implementation: Chicken port 0.1 ported by David Ireland (0-)
Basic List processing
(define factorial
0 -> 1
X -> (* X (factorial (- X 1))))
(define total
[] -> 0
[X | Y] -> (+ X (total Y)))
(define triples
[] -> []
[W X Y | Z] -> [[W X Y] | (triples Z)])
YACC
(defcc <binary?>
X <binary?> := true where (element? X [0 1]);
X := true where (element? X [0 1]);
<e> := false;)
Prolog
(defprolog member
xxX [X | _] <--;
xxX [_ | Y] <-- (member X Y);)
Type System
The type system is optional and can be turned on with
(tc +)
and off with:
(tc -)
Calling native Scheme code
Calling native Chicken procedures is done by prefixing 'lisp' to the procedure name. An example of calling Chicken's print is given below.
Shen, copyright (C) 2010-2015 Mark Tarver www.shenlanguage.org, Shen 21.1 running under Scheme, implementation: Chicken port 0.1 ported by David Ireland (0-) (lisp.print "Hello World") Hello World #<unspecified> (1-)
About this egg
License
BSD Clause 3
Dependencies
srfi-1 srfi-13