Last active 6 days ago

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

Revision 990cc0e59fb4a978594527ba37edaa9e7be65837

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