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

Last change on this file since 37117 was 37117, checked in by svnwiki, 6 months ago

Anonymous wiki edit for IP [220.233.44.123]:

File size: 1.3 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=== 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
28=== Embedding in Chicken
29
30
31=== Example Shen Code
32
33==== Basic List processing
34
35<enscript highlight="lisp">
36(define factorial
37        0 -> 1
38        X -> (* X (factorial (- X 1))))
39</enscript>
40
41<enscript highlight="lisp">
42(define total
43        [] -> 0
44        [X | Y] -> (+ X (total Y)))
45</enscript>
46
47
48<enscript highlight="lisp">
49(define triples
50        [] -> []
51        [W X Y | Z] -> [[W X Y] | (triples Z)])
52</enscript>
53
54==== YACC
55<enscript highlight="lisp">
56(defcc <binary?>
57X <binary?> := true where (element? X [0 1]);
58X := true where (element? X [0 1]);
59<e> := false;)
60</enscript>
61
62==== Prolog
63
64<enscript highlight="lisp">
65(defprolog member
66xxX [X | _] <--;
67xxX [_ | Y] <-- (member X Y);)
68</enscript>
69
70
71=== About this egg
72
73==== License
74BSD Clause 3
75
76==== Dependencies
77srfi-1
78srfi-13
79
80==== Versions
81; [[https://gitlab.com/maxwell79/chicken-link-grammar/releases/tag/1.6|0.1]] :
82
Note: See TracBrowser for help on using the repository browser.