root/trunk/orca/tests/working/series.r

Revision 1, 1.7 kB (checked in by krobillard, 3 years ago)

Import orca & thune.

Line 
1REBOL[]
2
3j: "abc"
4print [type? j series? j]
5
6j: 'a
7print [type? j series? j]
8
9;j: struct!
10;print [type? j series? j]
11
12j: [a/b/c: 0]
13print [type? j series? j]
14
15j: func [] []
16print [type? j series? j]
17
18j: make object! [a: 1]
19print [type? j series? j]
20
21
22; Change strings
23
24b: "12345"
25a: "abcde"
26probe change next a b
27probe a
28
29a: "abcde"
30probe change/part next a b 2
31probe a
32
33a: "abcde"
34probe change/part a b -33
35probe a
36
37a: "abcde"
38probe change next a "^/^/gg^/"
39probe a
40
41a: change "abc" #"z"
42probe a
43probe head a
44
45a: change tail "abc" #"z"
46probe a
47probe head a
48
49
50; Change blocks
51
52b: [1 2 3 4 5]
53a: [a b c d e]
54probe change next a b
55probe a
56
57probe change/only a [x y]
58probe a
59
60a: [a b c d e]
61probe change/part next a b 2
62probe a
63
64a: [a b c d e]
65probe change/part a b -33
66probe a
67
68a: [a b c d e]
69probe change next a "new"
70probe a
71probe change tail a "new"
72probe a
73
74
75b: ["static char " "_natives" "[] =^/"]
76probe a: copy first b
77probe append a next b
78
79probe append "abc" #"z"
80
81
82probe skip [1 2] 4
83probe skip [1 2] -4
84probe skip [1 2 3] 2
85probe skip next [1 2 3] false
86probe skip next [1 2 3] true
87
88
89probe select [a b c] 'a
90probe select "abc" #"b"
91probe select [a b c] 2
92probe select "abc" #"c"
93
94
95j: next next [1 2 3 4]
96probe at j 1
97probe at j 9
98probe at j -1
99probe at j -4
100probe at j true
101probe at j false
102
103
104probe find [a b c] 'd
105probe find [a b c] 'b
106;probe find/match [a b c] [a c]
107;probe find/match [a b c] [a b]
108probe find/match [a b c] 'b
109probe find/match [a b c] 'a
110
111probe find {abc} {bd}
112probe find {abc} {bc}
113probe find/match {abc} {a}
114probe find/match {abc} {abc}
115probe find/match {abc} {ac}
116
117
118b: [%abc.vid]
119file: "abc.aud"
120ext: find file ".aud"
121base: copy/part file ext
122forall b [ if find first b base [ print first b] ]
123
124
125;eof
Note: See TracBrowser for help on using the browser.