-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrol.easy
More file actions
68 lines (59 loc) · 1.24 KB
/
control.easy
File metadata and controls
68 lines (59 loc) · 1.24 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
# Copyright (C) 2021 Matway Burkow
#
# This repository and all its contents belong to Matway Burkow (referred here and below as "the owner").
# The content is for demonstration purposes only.
# It is forbidden to use the content or any part of it for any purpose without explicit permission from the owner.
# By contributing to the repository, contributors acknowledge that ownership of their work transfers to the owner.
func: {
CALL: [
{
CALL:;
}
];
};
pfunc: [
{
CALL:;
PRE:;
}
] func;
drop: [a:;] func;
nip: [b:; a:; @b] func;
swap: [b:; a:; @b @a] func;
dup: [a:; @a @a] func;
over: [b:; a:; @a @b @a] func;
when: [
[] if
] func;
bind: [
{
bindBody:;
bindValue:;
CALL: [bindValue bindBody call];
}
] func;
while: [
whileBody:; whileCond:;
@whileCond call [
[
@whileBody call @whileCond call
] loop
] when
] func;
times: [
timesBody:;
timesCount:;
i: 0;
[
i timesCount <
] [
@timesBody call
i 1 + !i
] while
] func;
||: [[TRUE] swap if] func;
&&: [[FALSE] if] func;
assert: [call ~ ["Assertion failed!" error] when] func;
isPureList: [drop FALSE] func;
isPureList: [fieldCount TRUE] [drop TRUE] pfunc;
isPureList: [2 fieldName "INDEX_OVERLOAD" =] [drop FALSE] pfunc;