git @ Cat's Eye Technologies Burro / 720d00f
Import latest HTML and LHS tweaks. Cat's Eye Technologies 10 years ago
2 changed file(s) with 15 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
33 <head>
44 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
55 <title>The Burro Programming Language, version 1.0</title>
6 <!-- begin html doc dynamic markup -->
7 <script type="text/javascript" src="/contrib/jquery-1.6.4.min.js"></script>
8 <script type="text/javascript" src="/scripts/documentation.js"></script>
9 <!-- end html doc dynamic markup -->
610 </head>
711 <body>
812
1115 <p>October 2007, Chris Pressey, Cat's Eye Technologies.</p>
1216
1317 <p><em>Note: This document describes version 1.0 of the Burro language. For documentation
14 on the latest version of the language, please see <a href="burro.html">burro.html</a>.</em></p>
18 on the latest version of the language, please see <a href="../src/_Burro.lhs.html">Burro.lhs</a>.</em></p>
1519
1620 <h2>1. Introduction</h2>
1721
0 > -- coding: UTF-8
0 -> encoding: UTF-8
11
22 The Burro Programming Language
33 ==============================
4040 the idea that Burro qualifies as universal.
4141
4242 For further background information on the Burro project, you may also wish
43 to read the [Burro 1.0 article](burro-1.0.html), with the understanding that
44 the language description given there is obsolete.
43 to read the [Burro 1.0 article](../doc/burro-1.0.html), with the understanding
44 that the language description given there is obsolete.
4545
4646
4747 Changes from Burro 1.0
110110 > show GoRight = ">"
111111 > show (Test a b) = "(" ++ (show a) ++ "/" ++ (show b) ++ ")"
112112 > show (Seq a b) = (show a) ++ (show b)
113 >
113 >
114114 > parse string =
115115 > let
116116 > (rest, acc) = parseProgram string Null
117117 > in
118118 > trim acc
119 >
119 >
120120 > parseProgram [] acc =
121121 > ([], acc)
122122 > parseProgram ('e':rest) acc =
144144 > (rest, acc)
145145 > parseProgram (_:rest) acc =
146146 > parseProgram rest acc
147 >
147 >
148148 > trim (Seq Null a) = trim a
149149 > trim (Seq a Null) = trim a
150150 > trim (Seq a b) = Seq (trim a) (trim b)
201201
202202 > data Tape = Tape [Integer] [Integer]
203203 > deriving (Read)
204 >
204 >
205205 > instance Show Tape where
206206 > show t@(Tape l r) =
207207 > let
226226 > ensurecell x = x
227227 >
228228 > strip (Tape l r) = Tape (ensurecell (stripzeroes l)) (stripzeroes r)
229 >
229 >
230230 > tapeeq :: Tape -> Tape -> Bool
231231 > tapeeq t1 t2 =
232232 > let
234234 > (Tape t2l t2r) = strip t2
235235 > in
236236 > (t1l == t2l) && (t1r == t2r)
237 >
237 >
238238 > instance Eq Tape where
239239 > t1 == t2 = tapeeq t1 t2
240240
274274
275275 > data State = State Tape Tape Bool
276276 > deriving (Show, Read, Eq)
277 >
277 >
278278 > newstate = State (tape [0]) (tape [0]) True
279279
280280