Última actividad 6 days ago

A definition of a quad store, and an example defining arrays.

Revisión bf12d817b937d7844c84155ae3e64df54e3a14e2

quads.nv Sin formato Playground
1||:: foo @ 0 = 10
2 :: foo @ 1 = 20
3 :: foo @ 2 = 30
4 :: foo @ 0
5 :: foo @ *
6
7|:: $name @ *? :found: array $name $index $value|
8 :values: $value
9|:: $name @ * :empty:|
10|:: $name @ *?|
11 :: filter for array $name * *
12
13|:: $name @ $index? :found: array $name $index $value|
14 :values: $value
15|:: $name @ $index :empty:|
16|:: $name @ $index?|
17 :: filter for array $name $index *
18
19|:: $name @ $index = $value|
20 :: insert array $name $index $value
21
22
23
24
25|:#############################################:|
26|: TONY STARK WAS ABLE TO BUILD THIS IN A CAVE :|
27|: WITH A BOX OF QUADS :|
28|:#############################################:|
29
30||:@quad.wildcard: *
31
32|:@quad.operation: insert :@quad.pattern: $1 $2 $3 $4|
33 :@quad.data: $1 $2 $3 $4
34
35|:@quad.operation: remove :@quad.found: :@quad.data: $1 $2 $3 $4|
36 :@quad.operation: reset
37|:@quad.operation: remove?|
38 :@quad.operation: seek
39
40|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $ $ $ $ :@quad.data: $1 $2 $3 $4?| :@quad.found:
41|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $ $ $ $4 :@quad.data: $1 $2 $3 $4?| :@quad.found:
42|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $ $ $3 $ :@quad.data: $1 $2 $3 $4?| :@quad.found:
43|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $ $ $3 $4 :@quad.data: $1 $2 $3 $4?| :@quad.found:
44|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $ $2 $ $ :@quad.data: $1 $2 $3 $4?| :@quad.found:
45|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $ $2 $ $4 :@quad.data: $1 $2 $3 $4?| :@quad.found:
46|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $ $2 $3 $ :@quad.data: $1 $2 $3 $4?| :@quad.found:
47|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $ $2 $3 $4 :@quad.data: $1 $2 $3 $4?| :@quad.found:
48|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $1 $ $ $ :@quad.data: $1 $2 $3 $4?| :@quad.found:
49|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $1 $ $ $4 :@quad.data: $1 $2 $3 $4?| :@quad.found:
50|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $1 $ $3 $ :@quad.data: $1 $2 $3 $4?| :@quad.found:
51|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $1 $ $3 $4 :@quad.data: $1 $2 $3 $4?| :@quad.found:
52|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $1 $2 $ $ :@quad.data: $1 $2 $3 $4?| :@quad.found:
53|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $1 $2 $ $4 :@quad.data: $1 $2 $3 $4?| :@quad.found:
54|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $1 $2 $3 $ :@quad.data: $1 $2 $3 $4?| :@quad.found:
55|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $1 $2 $3 $4 :@quad.data: $1 $2 $3 $4?| :@quad.found:
56|:@quad.operation: seek :@quad.wildcard: $? :@quad.pattern: $1 $2 $3 $4 :@quad.empty:?|
57|:@quad.operation: seek? :@quad.wildcard: $?|
58 :@quad.operation: next
59
60|:@quad.operation: reset :@quad.start:|
61|:@quad.operation: reset?|
62 :@quad.operation: previous
63
64|:@quad.operation: next :@quad.data: $1 $2 $3 $4|
65 :@quad.seen: $1 $2 $3 $4
66|:@quad.operation: next|
67 :@quad.empty:
68
69|:@quad.operation: previous :@quad.seen: $1 $2 $3 $4|
70 :@quad.data: $1 $2 $3 $4
71|:@quad.operation: previous|
72 :@quad.start:
73
74
75
76
77|:##################:|
78|: But doctor. :|
79|: I AM TONY STARK. :|
80|:##################:|
81
82|:: insert $1 $2 $3 $4|
83 :@quad.operation: insert
84 :@quad.pattern: $1 $2 $3 $4
85
86|:: remove $1 $2 $3 $4|
87 :@quad.operation: remove
88 :@quad.pattern: $1 $2 $3 $4
89
90|:: search for $1 $2 $3 $4 :@quad.empty:|
91 :not found:
92|:: search for $1 $2 $3 $4 :@quad.found: :@quad.data: $A $B $C $D?|
93 :found: $A $B $C $D
94 :@quad.operation: reset
95|:: search for $1 $2 $3 $4?|
96 :@quad.operation: seek
97 :@quad.pattern: $1 $2 $3 $4
98
99|:: filter for $1 $2 $3 $4 :@quad.empty:|
100 :@quad.operation: reset
101 :empty:
102|:: filter for $1 $2 $3 $4? :@quad.found: :@quad.data: $A $B $C $D?|
103 :@quad.operation: (next seek)
104 :@quad.pattern: $1 $2 $3 $4
105 :found: $A $B $C $D
106|:: filter for $1 $2 $3 $4?|
107 :@quad.operation: seek
108 :@quad.pattern: $1 $2 $3 $4
109