-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_file.dak
More file actions
72 lines (44 loc) · 1.09 KB
/
example_file.dak
File metadata and controls
72 lines (44 loc) · 1.09 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
func multiply(a: i64, b: i64) i64 {
result := a * b
return result
}
func main() i64 {
c := 2
return c
}
//val2 := 10 + 5 + 23 / 10
//val3 := 10 + (5) + (23- 6) * ((14/10+2) - 5) + (3+(5*8))
/*
@Buildable
type Test struct {
hi: bool
test: float = 0b0101,
other: string = "hello\n"
}
//Test member function 'test_function' with parameter 'val' of type float that returns two floats
func test_function (val: f32) f32 {
val : i32
val2 := f32(val) - 1.0
return val2
}
func construct() {
return Test{hi = false, test = 1, other = "bye"}
}
type Vector struct {
list: nullptr
}
func something(val: f32) f32 {
list : Vector
}
obj . func ( )
obj.func()
a : Test //variable a of type Test default initialized
b : Test = Test{} //default initialized with explicit type
c := Test{} // default initialized with deduced type
e : Test = uninitialized //uninitialized with explicit type
f := Test{uninitialized} //uninitialized with deduced type
d := uninitialized //uninitialized with deduced type from later usage
ptr := null //
ptr2 : *Test = null
array : []Test
ptr = &e //get location