comparison extendlib.rhope @ 1:b3f71490858c

Small fixes and enhancements from main windows box
author Mike Pavone <pavone@retrodev.com>
date Wed, 29 Apr 2009 02:13:24 -0400
parents 76568becd6d6
children 23dd9c766699
comparison
equal deleted inserted replaced
0:76568becd6d6 1:b3f71490858c
68 }{ 68 }{
69 out <- New Like[list] 69 out <- New Like[list]
70 } 70 }
71 } 71 }
72 72
73 To String@String[string:out]
74 {
75 out <- string
76 }
77
78 Empty@String[string:out]
79 {
80 out <- ""
81 }
82
73 In[needle,haystack:found?] 83 In[needle,haystack:found?]
74 { 84 {
75 [haystack]Get DString[needle] 85 [haystack]Get DString[To String[needle]]
76 { 86 {
77 found? <- Yes 87 found? <- Yes
78 } {} {} { 88 } {} {} {
79 found? <- No 89 found? <- No
80 } 90 }
196 [list]First 206 [list]First
197 { 207 {
198 out <- _Fold[list, ~, start, worker] 208 out <- _Fold[list, ~, start, worker]
199 }{ 209 }{
200 out <- start 210 out <- start
211 }
212 }
213
214 _Zip[left,lindex,right,rindex,outlist:out]
215 {
216 nlist <- [outlist]Append[
217 [[()]Append[ [left]Index[lindex] ]]Append[ [right]Index[rindex] ]
218 ]
219 nlindex <- [left]Next[lindex]
220 {
221 [right]Next[rindex]
222 {
223 out <- _Zip[left,nlindex,right,~,nlist]
224 }{
225 out <- Val[nlist]
226 }
227 }{
228 out <- Val[nlist]
229 }
230 }
231
232 Zip[left,right:out]
233 {
234 lindex <- [left]First
235 {
236 Print[~]
237 [right]First
238 {
239 Print[~]
240 out <- _Zip[left,lindex,right,~,()]
241 }{
242 out <- ()
243 }
244 }{
245 out <- ()
201 } 246 }
202 } 247 }
203 248
204 _Dict Split[dict,entry,index,keydelim:out] 249 _Dict Split[dict,entry,index,keydelim:out]
205 { 250 {
522 Keys[container:out] 567 Keys[container:out]
523 { 568 {
524 out <- Fold["_Keys", New@List[], container] 569 out <- Fold["_Keys", New@List[], container]
525 } 570 }
526 571
572 And[left,right:out]
573 {
574 ,out <- If[left]
575 {
576 out,out <- If[right]
577 }
578 }
579
580 Or[left,right:out]
581 {
582 out <- If[left] {}
583 {
584 out,out <- If[right]
585 }
586 }
587
588 After[text,prefix:after,not found]
589 {
590 If[[text]Starts With[prefix]]
591 {
592 ,after <- [text]Slice[[prefix]Length]
593 }{
594 not found <- text
595 }
596 }