-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.html
More file actions
619 lines (451 loc) · 15.1 KB
/
docs.html
File metadata and controls
619 lines (451 loc) · 15.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>ilang Documentaiton</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="title" content="ilang Documentaiton"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2012-09-07 22:48:22 PDT"/>
<meta name="author" content="Matthew Francis-Landau"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
html { font-family: Times, serif; font-size: 12pt; }
.title { text-align: center; }
.todo { color: red; }
.done { color: green; }
.tag { background-color: #add8e6; font-weight:normal }
.target { }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right {margin-left:auto; margin-right:0px; text-align:right;}
.left {margin-left:0px; margin-right:auto; text-align:left;}
.center {margin-left:auto; margin-right:auto; text-align:center;}
p.verse { margin-left: 3% }
pre {
border: 1pt solid #AEBDCC;
background-color: #F3F5F7;
padding: 5pt;
font-family: courier, monospace;
font-size: 90%;
overflow:auto;
}
table { border-collapse: collapse; }
td, th { vertical-align: top; }
th.right { text-align:center; }
th.left { text-align:center; }
th.center { text-align:center; }
td.right { text-align:right; }
td.left { text-align:left; }
td.center { text-align:center; }
dt { font-weight: bold; }
div.figure { padding: 0.5em; }
div.figure p { text-align: center; }
div.inlinetask {
padding:10px;
border:2px solid gray;
margin:10px;
background: #ffffcc;
}
textarea { overflow-x: auto; }
.linenr { font-size:smaller }
.code-highlighted {background-color:#ffff00;}
.org-info-js_info-navigation { border-style:none; }
#org-info-js_console-label { font-size:10px; font-weight:bold;
white-space:nowrap; }
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
font-weight:bold; }
/*]]>*/-->
</style>
<script type="text/javascript">
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="preamble">
</div>
<div id="content">
<h1 class="title">ilang Documentaiton</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Overview</a>
<ul>
<li><a href="#sec-1-1">1.1 What is ilang</a></li>
<li><a href="#sec-1-2">1.2 Arguments to process</a></li>
<li><a href="#sec-1-3">1.3 Major ideas</a></li>
</ul>
</li>
<li><a href="#sec-2">2 Lanuage specifications</a>
<ul>
<li><a href="#sec-2-1">2.1 Functions</a>
<ul>
<li><a href="#sec-2-1-1">2.1.1 Basic syntax</a></li>
<li><a href="#sec-2-1-2">2.1.2 Arguments</a></li>
<li><a href="#sec-2-1-3">2.1.3 Type checking</a></li>
</ul>
</li>
<li><a href="#sec-2-2">2.2 Type system</a>
<ul>
<li><a href="#sec-2-2-1">2.2.1 Type Less</a></li>
<li><a href="#sec-2-2-2">2.2.2 Type Checking</a></li>
<li><a href="#sec-2-2-3">2.2.3 Special types</a></li>
</ul>
</li>
<li><a href="#sec-2-3">2.3 Classes</a>
<ul>
<li><a href="#sec-2-3-1">2.3.1 Basic members</a></li>
</ul>
</li>
<li><a href="#sec-2-4">2.4 Objects</a></li>
<li><a href="#sec-2-5">2.5 Array</a></li>
</ul>
</li>
<li><a href="#sec-3">3 Base Libraries</a>
<ul>
<li><a href="#sec-3-1">3.1 Database</a></li>
<li><a href="#sec-3-2">3.2 Modification</a></li>
<li><a href="#sec-3-3">3.3 Import</a></li>
</ul>
</li>
<li><a href="#sec-4">4 Included Libraries</a>
<ul>
<li><a href="#sec-4-1">4.1 Curl</a></li>
</ul>
</li>
<li><a href="#sec-5">5 C++ interface</a>
<ul>
<li><a href="#sec-5-1">5.1 <code>ILANG_LIBRARY_NAME</code></a></li>
<li><a href="#sec-5-2">5.2 <code>ILANG_FUNCTION</code></a></li>
<li><a href="#sec-5-3">5.3 <code>ILANG_CLASS</code></a></li>
<li><a href="#sec-5-4">5.4 Advance Raw accessing Object</a></li>
</ul>
</li>
<li><a href="#sec-6">6 Example Code</a>
<ul>
<li><a href="#sec-6-1">6.1 Hello World</a></li>
<li><a href="#sec-6-2">6.2 Loops</a></li>
<li><a href="#sec-6-3">6.3 Inherit Class</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Overview</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-1-1" class="outline-3">
<h3 id="sec-1-1"><span class="section-number-3">1.1</span> What is ilang</h3>
<div class="outline-text-3" id="text-1-1">
<p> ilang is designed to be a new type of programming lanuage that supports different types of programming paradimes with a focus towards artificial inteligence
</p></div>
</div>
<div id="outline-container-1-2" class="outline-3">
<h3 id="sec-1-2"><span class="section-number-3">1.2</span> Arguments to process</h3>
<div class="outline-text-3" id="text-1-2">
<p> -h this help document
-f [file] the start file
-v # debug level
–version dispay version
-d set location of database files
</p></div>
</div>
<div id="outline-container-1-3" class="outline-3">
<h3 id="sec-1-3"><span class="section-number-3">1.3</span> Major ideas</h3>
<div class="outline-text-3" id="text-1-3">
<p> In a typical programming lanuage, nearly everything created has a name given to it, for example consider the following C++ code:
</p>
<pre class="example">class Name {
};
</pre>
<p>
In this code, the class is created under the name <i>Name</i>.
</p>
<p>
In ilang, the consepts are vastly different, class, objects, function, anything is created without a name. The name/scope system is mearly provided to give a programmer a means of accessing something that was created else where.
In this since everything can be considered to be
</p></div>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Lanuage specifications</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Functions</h3>
<div class="outline-text-3" id="text-2-1">
</div>
<div id="outline-container-2-1-1" class="outline-4">
<h4 id="sec-2-1-1"><span class="section-number-4">2.1.1</span> Basic syntax</h4>
<div class="outline-text-4" id="text-2-1-1">
<pre class="example">Function_name = {
// function body
};
</pre>
</div>
</div>
<div id="outline-container-2-1-2" class="outline-4">
<h4 id="sec-2-1-2"><span class="section-number-4">2.1.2</span> Arguments</h4>
<div class="outline-text-4" id="text-2-1-2">
<pre class="example">Function_name = {|argument1, argument2|
// funciton body
};
</pre>
</div>
</div>
<div id="outline-container-2-1-3" class="outline-4">
<h4 id="sec-2-1-3"><span class="section-number-4">2.1.3</span> Type checking</h4>
<div class="outline-text-4" id="text-2-1-3">
<p> /See <a href="#sec-2-2">Type system</a> for more information/
</p>
<pre class="example">Function_name = {|Int int_type, String string_type|
// int_type will throw an error if the argument is not of type int, same with String
// Return types are not checked/defined inside the function
return string_type + "something more";
};
main = {
String some_var = Function_name(0, "aaa");
// the system will check that the value of some_var is set to a String, so if the function returns anything else it will be an error
};
</pre>
</div>
</div>
</div>
<div id="outline-container-2-2" class="outline-3">
<h3 id="sec-2-2"><span class="section-number-3">2.2</span> Type system</h3>
<div class="outline-text-3" id="text-2-2">
<p> The type system is by default typeless allowing for any type like more standard scripting lanuages.
The system uses type 'qualifiers' to performe special actions on the variables. Type qualifiers range from anything to Checking the type of variable to saving data into a persistent database.
</p>
</div>
<div id="outline-container-2-2-1" class="outline-4">
<h4 id="sec-2-2-1"><span class="section-number-4">2.2.1</span> Type Less</h4>
<div class="outline-text-4" id="text-2-2-1">
<pre class="example">Variable_name = 1;
</pre>
<p>
By defualt types are not enfored in the system
</p></div>
</div>
<div id="outline-container-2-2-2" class="outline-4">
<h4 id="sec-2-2-2"><span class="section-number-4">2.2.2</span> Type Checking</h4>
<div class="outline-text-4" id="text-2-2-2">
<pre class="example">Int int_name = 1;
String String_name = "Something";
Float fLoAt_NaMe = .43;
Class Class_type = class {};
Object Object_type = object {};
Array Array_type = [];
Function Function_type = {};
</pre>
<p>
A type can be specified before then name of the variable.
</p></div>
</div>
<div id="outline-container-2-2-3" class="outline-4">
<h4 id="sec-2-2-3"><span class="section-number-4">2.2.3</span> Special types</h4>
<div class="outline-text-4" id="text-2-2-3">
<ul>
<li id="sec-2-2-3-1">Const<br/>
<pre class="example">Const Int int_name = 1;
</pre>
<p>
The Const type means that a variable can only be set <span style="text-decoration:underline;">once</span>.
<b>Note:</b> The syntax of the lanuage does not allow for variables to be created without having a value set as a default
</p>
<pre class="example">Function_name = {|Const variable|
};
</pre>
<p>
The <span style="text-decoration:underline;">variable</span> argument can not be modified inside the body of the function.
<b>Note:</b> Classes and objects are passed as pointers and thus their internals can be modified even if it is Const
</p></li>
</ul>
<ul>
<li id="sec-2-2-3-2">Database/Db<br/>
<pre class="example">Db Int counter = 0;
</pre>
<p>
/More information is inside the <a href="#Database-root">Database</a>/
Database variables are saved into a seperate database file in the current directory, these variables are recalled when the program is relaunched
</p></li>
</ul>
</div>
</div>
</div>
<div id="outline-container-2-3" class="outline-3">
<h3 id="sec-2-3"><span class="section-number-3">2.3</span> Classes</h3>
<div class="outline-text-3" id="text-2-3">
<pre class="example">Class_name = class {
};
</pre>
</div>
<div id="outline-container-2-3-1" class="outline-4">
<h4 id="sec-2-3-1"><span class="section-number-4">2.3.1</span> Basic members</h4>
<div class="outline-text-4" id="text-2-3-1">
<pre class="example">Class_name = class {
member_name: default_value,
second_member_name: another_value
};
</pre>
</div>
</div>
</div>
<div id="outline-container-2-4" class="outline-3">
<h3 id="sec-2-4"><span class="section-number-3">2.4</span> Objects</h3>
<div class="outline-text-3" id="text-2-4">
<pre class="example">Object_name = object {
};
</pre>
</div>
</div>
<div id="outline-container-2-5" class="outline-3">
<h3 id="sec-2-5"><span class="section-number-3">2.5</span> Array</h3>
<div class="outline-text-3" id="text-2-5">
</div>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> Base Libraries</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-3-1" class="outline-3">
<h3 id="sec-3-1"><span class="section-number-3">3.1</span> Database</h3>
<div class="outline-text-3" id="text-3-1">
<p> <a name="Database-root" class="target">Database root</a>
</p></div>
</div>
<div id="outline-container-3-2" class="outline-3">
<h3 id="sec-3-2"><span class="section-number-3">3.2</span> Modification</h3>
<div class="outline-text-3" id="text-3-2">
</div>
</div>
<div id="outline-container-3-3" class="outline-3">
<h3 id="sec-3-3"><span class="section-number-3">3.3</span> Import</h3>
<div class="outline-text-3" id="text-3-3">
</div>
</div>
</div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Included Libraries</h2>
<div class="outline-text-2" id="text-4">
</div>
<div id="outline-container-4-1" class="outline-3">
<h3 id="sec-4-1"><span class="section-number-3">4.1</span> Curl</h3>
<div class="outline-text-3" id="text-4-1">
</div>
</div>
</div>
<div id="outline-container-5" class="outline-2">
<h2 id="sec-5"><span class="section-number-2">5</span> C++ interface</h2>
<div class="outline-text-2" id="text-5">
</div>
<div id="outline-container-5-1" class="outline-3">
<h3 id="sec-5-1"><span class="section-number-3">5.1</span> <code>ILANG_LIBRARY_NAME</code></h3>
<div class="outline-text-3" id="text-5-1">
</div>
</div>
<div id="outline-container-5-2" class="outline-3">
<h3 id="sec-5-2"><span class="section-number-3">5.2</span> <code>ILANG_FUNCTION</code></h3>
<div class="outline-text-3" id="text-5-2">
</div>
</div>
<div id="outline-container-5-3" class="outline-3">
<h3 id="sec-5-3"><span class="section-number-3">5.3</span> <code>ILANG_CLASS</code></h3>
<div class="outline-text-3" id="text-5-3">
</div>
</div>
<div id="outline-container-5-4" class="outline-3">
<h3 id="sec-5-4"><span class="section-number-3">5.4</span> Advance Raw accessing Object</h3>
<div class="outline-text-3" id="text-5-4">
</div>
</div>
</div>
<div id="outline-container-6" class="outline-2">
<h2 id="sec-6"><span class="section-number-2">6</span> Example Code</h2>
<div class="outline-text-2" id="text-6">
</div>
<div id="outline-container-6-1" class="outline-3">
<h3 id="sec-6-1"><span class="section-number-3">6.1</span> Hello World</h3>
<div class="outline-text-3" id="text-6-1">
<pre class="example">main = {
Print("Hello world");
};
</pre>
</div>
</div>
<div id="outline-container-6-2" class="outline-3">
<h3 id="sec-6-2"><span class="section-number-3">6.2</span> Loops</h3>
<div class="outline-text-3" id="text-6-2">
<pre class="example">main = {
for(a = 0; a < 10; a = a + 1) {
Print("the loop\n");
}
};
</pre>
</div>
</div>
<div id="outline-container-6-3" class="outline-3">
<h3 id="sec-6-3"><span class="section-number-3">6.3</span> Inherit Class</h3>
<div class="outline-text-3" id="text-6-3">
<pre class="example">Class animal = class {
say_what: {
return "default say thing";
},
say: {
Print("The animal says: ", say_what(), "\n");
}
};
Class cow = class (animal) {
say_what: {
return "Mooo";
}
};
Class cat = class (animal) {
say_what: {
return "Mow";
}
};
main = {
Cat = new(cat);
Cow = new(cow);
Cat.say();
Cow.say();
};
</pre>
</div>
</div>
</div>
</div>
<div id="postamble">
<p class="date">Date: 2012-09-07 22:48:22 PDT</p>
<p class="author">Author: Matthew Francis-Landau</p>
<p class="creator">Org version 7.8.11 with Emacs version 24</p>
<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
</div>
</body>
</html>