-
Notifications
You must be signed in to change notification settings - Fork 1
/
builtin.crm
53 lines (44 loc) · 832 Bytes
/
builtin.crm
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
# Built-in, global scoped blocks
float y = delay (float x) {
mem[1] float s
y = s[0]
s[0] = x
s.init = x
}
int y = delay (int x) {
mem[1] int s
y = s[0]
s[0] = x
s.init = x
}
bool y = delay (bool x) {
mem[1] bool s
y = s[0]
s[0] = x
s.init = x
}
int i = circular_iterator (int n) {
i = delay(i) >= n ? 0 : delay(i) + 1
i.init = -1
}
float y = delay(float x, int n) {
mem[n] float line
int i = circular_iterator(n)
y = line[i]
line[i] = x
line.init = x # implicitly x.init
}
int y = delay(int x, int n) {
mem[n] int line
int i = circular_iterator(n)
y = line[i]
line[i] = x
line.init = x
}
bool y = delay(bool x, int n) {
mem[n] bool line
int i = circular_iterator(n)
y = line[i]
line[i] = x
line.init = x
}