[REBOL] Re: newlines
From: joel:neely:fedex at: 8-Nov-2001 1:46
Ladislav Mecir wrote:
> I offer another one:
>
> method3: [any [thru ".." t: any #"." u: (remove/part t u) :t] to end]
> parse/all s method3
>
There's still a bug (which I don't have attention span to hunt down
at this point -- need more coffee...) Please check to make sure
that I didn't mess it up in transcription!
PRS3:
remprs3: func [s [string!] /local t u] [
parse/all s [
any [ thru ".." t: any #"." u: (remove/part t u) :t ] to end
]
]
This still intermittently leaves runs of dots near the end of the
string, as shown by the following test output by my benchmarking
harness. The second line of each failure message gives the length
of the result, the length of the correct result, then the position
and first few characters of a segment containing an uncompressed
run of dots.
FAILURE: prs3
2683 2680 @ 2679 .....
FAILURE: prs3
2708 2706 @ 2705 ....
FAILURE: prs3
2664 2661 @ 2660 .....
FAILURE: prs3
5403 5397 @ 5396 ........
FAILURE: prs3
5341 5336 @ 5335 .......
FAILURE: prs3
5367 5353 @ 5346 ........x.......x...
FAILURE: prs3
5409 5406 @ 5398 .....xxx.x.x
FAILURE: prs3
5521 5518 @ 5512 ...x.x....
FAILURE: prs3
5290 5284 @ 5279 .....xx.....
FAILURE: prs3
7923 7922 @ 7921 ...
FAILURE: prs3
8306 8292 @ 8284 ...x.x..............
FAILURE: prs3
8208 8202 @ 8201 ........
I'll be glad to look at it again later, but am running short on
time now. I'll post the results of what I have working and can
rerun the benchmarks as needed.
-jn-
--
I finally understood that the derogatory term "Indian giver"
referred, not to the Indians themselves -- but rather, to our
treatment of the Indians.
-- Stephen Samuel
joel"FIX"PUNCTUATION"dot"neely"at"fedex"dot"com