[REBOL] Re: Speed required
From: carl:cybercraft at: 30-Nov-2007 5:42
Hi Kai,
Here's a different approach, it duplicating cursor and then removing what's not wanted.
Be interested in knowing if it's faster or slower. (Only you will know if deep's required.)
...
------------------------
cursor: [
[100 "Kai" 49 #764-0929]
[101 "Zu" 52 #764-0915]
[102 "Dewi" 16 #312-1772]
]
cols: [1 2 4]
remove-columns: function [cursor [block!] columns [block!]][tmp result][
result: copy/deep cursor
tmp: copy []
repeat value length? result/1 [
if not find columns value [append tmp value - 1]
]
forall result [
foreach column tmp [
remove skip result/1 column
]
]
head result
]
probe remove-columns cursor cols
---------------------
Not much tested, mind!
-- Carl Read.
On Thursday, 29-Novenber-2007 at 11:24:41 Kai Peters wrote,