Skip to content

Commit b718d34

Browse files
committed
loops.l1h include update
1 parent ec9f615 commit b718d34

2 files changed

Lines changed: 33 additions & 32 deletions

File tree

include-lib/loops.l1h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
>> needs f and one to be defined by set
44
>> oOP -> new variable type operator: something like = != < > + - * / etc!
55
>> cOP -> variable compare operator: < > != == etc.
6+
>> mOP -> math operators like: + - * / % etc.
67
>> thread safe macros, which set the f variable as argument:
78
#func thr-for-each-in (PVAR, X, SIZE, F) :(33 PVAR SIZE 0 intr0)@#((SIZE zero +) SIZE =)@#(for-loop)@#(((X SIZE <) F =) F for)
89
#func thr-for (X, M, cOP, F) :(for-loop)@#(((X M cOP) F =) F for)

prog/hello-for-macro.l1com

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,46 @@
44
#include <vars.l1h>
55
#include <loops.l1h>
66
(main func)
7-
(set int64 1 zero 0)
8-
(set int64 1 one 1)
9-
(set int64 1 loop 0)
10-
(set int64 1 loop_foo 0)
11-
(set int64 1 maxloop 10)
12-
(set int64 1 f 0)
13-
(set int64 6 array 24, 12, 7, 9, 32, 7)
14-
(set const-int64 1 Parray 0)
15-
(set int64 1 ind 0)
16-
(set int64 1 realind 0)
17-
(set int64 1 a 0)
18-
(set int64 1 asize 0)
19-
// set string length automatic, by setting "s"
20-
(set string s hellostr "Hello world!")
21-
(set string s foostr "foobar!")
22-
(array Parray pointer)
23-
// print string
24-
// for
25-
(zero loop =)
26-
(loop maxloop < :dofor !)
7+
(set int64 1 zero 0)
8+
(set int64 1 one 1)
9+
(set int64 1 loop 0)
10+
(set int64 1 loop_foo 0)
11+
(set int64 1 maxloop 10)
12+
(set int64 1 f 0)
13+
(set int64 6 array 24, 12, 7, 9, 32, 7)
14+
(set const-int64 1 Parray 0)
15+
(set int64 1 ind 0)
16+
(set int64 1 realind 0)
17+
(set int64 1 a 0)
18+
(set int64 1 asize 0)
19+
// set string length automatic, by setting "s"
20+
(set string s hellostr "Hello world!")
21+
(set string s foostr "foobar!")
22+
(array Parray pointer)
23+
// print string
24+
// for
25+
(zero loop =)
26+
(loop maxloop < :dofor !)
2727
(hellostr :print_lns !)
28-
(zero loop_foo =)
28+
(zero loop_foo =)
2929
(loop_foo maxloop < :dofor !)
3030
(foostr :print_lns !)
31-
((loop_foo one +) loop_foo =)
32-
(next)
33-
((loop one +) loop =)
34-
(next)
31+
((loop_foo one +) loop_foo =)
32+
(next)
33+
((loop one +) loop =)
34+
(next)
3535

3636
// array print
37-
(Parray realind asize :for-each-in !)
38-
(Parray [ realind ] a =)
37+
(Parray realind asize :for-each-in !)
38+
(Parray [ realind ] a =)
3939
(a :print_lni !)
4040
(ind realind int64_size :next-in !)
4141

42-
(:print_n !)
43-
(zero ind =)
44-
(zero realind =)
45-
(Parray realind asize f :thr-for-each-in !)
46-
(Parray [ realind ] a =)
42+
(:print_n !)
43+
(zero ind =)
44+
(zero realind =)
45+
(Parray realind asize f :thr-for-each-in !)
46+
(Parray [ realind ] a =)
4747
(a :print_lni !)
4848
(ind realind int64_size :next-in !)
4949

0 commit comments

Comments
 (0)