source: project/wiki/eggref/5/shen @ 37118

Last change on this file since 37118 was 37118, checked in by svnwiki, 4 months ago

Anonymous wiki edit for IP [220.233.44.123]:

File size: 1.5 KB
Line 
1== shen
2
3A port of the Shen programming language for Chicken Scheme.
4
5[[toc:]]
6
7=== Shen
8
9Shen is a hosted language that comes with a macro system, prolog, optional type system based on sequent calculus and a YACC. 
10
11=== Egg Author
12
13David Ireland (djireland79 at gmail dot com)
14
15=== Shen Web site
16[[http://www.shenlanguage.org/]]
17
18=== Egg Source Code
19[[http://github.com]]
20
21
22=== Starting the REPL
23<enscript highlight="bash">
24$ chicken-shen
25</enscript>
26
27<enscript highlight="bash">
28Shen, copyright (C) 2010-2015 Mark Tarver
29www.shenlanguage.org, Shen 21.1
30running under Scheme, implementation: Chicken
31port 0.1 ported by David Ireland
32
33
34(0-)
35</enscript>
36=== Embedding in Chicken
37
38
39=== Example Shen Code
40
41==== Basic List processing
42
43<enscript highlight="lisp">
44(define factorial
45        0 -> 1
46        X -> (* X (factorial (- X 1))))
47</enscript>
48
49<enscript highlight="lisp">
50(define total
51        [] -> 0
52        [X | Y] -> (+ X (total Y)))
53</enscript>
54
55
56<enscript highlight="lisp">
57(define triples
58        [] -> []
59        [W X Y | Z] -> [[W X Y] | (triples Z)])
60</enscript>
61
62==== YACC
63<enscript highlight="lisp">
64(defcc <binary?>
65X <binary?> := true where (element? X [0 1]);
66X := true where (element? X [0 1]);
67<e> := false;)
68</enscript>
69
70==== Prolog
71
72<enscript highlight="lisp">
73(defprolog member
74xxX [X | _] <--;
75xxX [_ | Y] <-- (member X Y);)
76</enscript>
77
78
79=== About this egg
80
81==== License
82BSD Clause 3
83
84==== Dependencies
85srfi-1
86srfi-13
87
88==== Versions
89; [[https://gitlab.com/maxwell79/chicken-link-grammar/releases/tag/1.6|0.1]] :
90
Note: See TracBrowser for help on using the repository browser.