-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsample.lim
72 lines (56 loc) · 1.87 KB
/
sample.lim
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
>>>
This is a multiline comment!
Uninitialized variables are disallowed.
static typing
and, or, not, is operators
<<<
>> Single line comment!
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>> This is what the syntax should look like! <<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
use std.io.print
use magical_buterflies as magic
when,
magic.fly()
throws TypeError or KeyboardInterrupt as k,
print("Darnit couldnt import {1}!", k)
else,
print("Hurrah!")
class DescendantObject from Object
fn name(a: i64, b: str, c = False: bool, ...) -> i64
>>>
docstring becasue its on the line directly
after the function delcaration.
<<<
var a = 34
var a = 3 >> This is an error because it redeclares `a`
var b = 34u32
var c >> This is an error because uninitialised variables are dumb
def d = "This is a constant value and cannot change"
if a < 3 and a > 4 or 3 <= a,
whatever()
else,
meow()
. >> Optional period for sake of sentence
for i in 1..6,
dosomething()
>> This essentially reduces the list/iterator based on position
>> IE ['a', 'b', 'c'] by 2 -> ['a', 'c']
for i in 1..5 by 2,
do_something_else()
def obj = Object(3)
assert obj is obj >> True
def obj2 = Object(3)
assert obj is obj2 >> False
assert obj equals obj2 >> True
while a not equals 4,
dosomething()
return 343
>>> Possible stuff
Bound checking
if 5 < a < 6,
Anonymous functions
a = lambda -> 6 if b || c else 3
Classes and inheritance
class Descendant from Ancestor
<<<