Utoljára aktív 5 days ago

An example of dynamic lists.

june's Avatar june gist felülvizsgálása 5 days ago. Revízióhoz ugrás

1 file changed, 1 insertion, 2 deletions

lists.nv

@@ -5,9 +5,8 @@
5 5 |:: set $list $index $new :lists: $list $index $old|
6 6 :lists: $list $index $new
7 7 :: reset lists
8 - |:: set $list $index $value :lists: $x $y $z|
8 + |:: set $list $index $value? :lists: $x $y $z|
9 9 :checked items: $x $y $z
10 - :: reset lists
11 10 |:: set $list $index $value|
12 11 :lists: $list $index $value
13 12 :: reset lists

june's Avatar june gist felülvizsgálása 5 days ago. Revízióhoz ugrás

1 file changed, 5 insertions, 5 deletions

lists.nv

@@ -1,6 +1,6 @@
1 1 |:: $list @ $index = $value| :: set $list $index $value
2 - |:: $list @ $index | :: get $list $index $value
3 - |:: del $list @ $index | :: delete $list $index $value
2 + |:: $list @ $index | :: get $list $index
3 + |:: del $list @ $index | :: delete $list $index
4 4
5 5 |:: set $list $index $new :lists: $list $index $old|
6 6 :lists: $list $index $new
@@ -26,19 +26,19 @@
26 26
27 27 |:: delete $list $index :lists: $list $index $value|
28 28 :: reset lists
29 - |:: delete $list $index :lists: $x $y $z?|
29 + |:: delete $list $index? :lists: $x $y $z|
30 30 :checked items: $x $y $z
31 31 |:: delete $list $index|
32 32 :not found: $list $index
33 33 :: reset lists
34 34
35 35 |:: reset lists? :checked items: $list $index $value|
36 - :list: $list $index $value
36 + :lists: $list $index $value
37 37 |:: reset lists|
38 38
39 39 ||:: foo @ 0 = bar
40 40 :: foo @ 1 = baz
41 41 :: foo @ 2 = quux
42 42
43 - :: foo @ 1
43 + :: foo @ 1 :default value: undefined
44 44 :: del foo @ 2

june's Avatar june gist felülvizsgálása 5 days ago. Revízióhoz ugrás

1 file changed, 44 insertions

lists.nv(fájl létrehozva)

@@ -0,0 +1,44 @@
1 + |:: $list @ $index = $value| :: set $list $index $value
2 + |:: $list @ $index | :: get $list $index $value
3 + |:: del $list @ $index | :: delete $list $index $value
4 +
5 + |:: set $list $index $new :lists: $list $index $old|
6 + :lists: $list $index $new
7 + :: reset lists
8 + |:: set $list $index $value :lists: $x $y $z|
9 + :checked items: $x $y $z
10 + :: reset lists
11 + |:: set $list $index $value|
12 + :lists: $list $index $value
13 + :: reset lists
14 +
15 + |:: get $list $index :lists: $list $index $value?|
16 + :value: $value
17 + :: reset lists
18 + |:: get $list $index? :lists: $x $y $z|
19 + :checked items: $x $y $z
20 + |:: get $list $index :default value: $value?|
21 + :value: $value
22 + :: reset lists
23 + |:: get $list $index|
24 + :not found: $list $index
25 + :: reset lists
26 +
27 + |:: delete $list $index :lists: $list $index $value|
28 + :: reset lists
29 + |:: delete $list $index :lists: $x $y $z?|
30 + :checked items: $x $y $z
31 + |:: delete $list $index|
32 + :not found: $list $index
33 + :: reset lists
34 +
35 + |:: reset lists? :checked items: $list $index $value|
36 + :list: $list $index $value
37 + |:: reset lists|
38 +
39 + ||:: foo @ 0 = bar
40 + :: foo @ 1 = baz
41 + :: foo @ 2 = quux
42 +
43 + :: foo @ 1
44 + :: del foo @ 2
Újabb Régebbi