make list! or hash! or block! ?
[1/1] from: rebol-list2::seznam::cz at: 23-Nov-2002 17:05
Hello rebol-list,
maybe this may be usefull for someone:
In one of my scripts I use data analysis of this sort:
...
either none? i: find/tail data value [
insert data reduce [value 1]
][
change i 1 + first i
if maxvalue < first i [maxvalue: first i]
]
...
for data you may use three type of rebol datatypes:
block!, hash!, and list!
and which one is the best?
look at the time results for the data analysis:
with block! = 0:00:31.976
with hash! = 0:00:10.615
with list! = 0:00:01.021
BUT THERE IS ONE PROBLEM WITH THE LIST!
=======================================
data: make list! ["a" 1 "b" 2 "c" 3]
find data "b"
;== make list! ["b" 2 "c" 3]
find/tail data "b"
;== make list! [1 "b" 2 "c" 3]
;is this a bug?
to have my script working I had to add one 'next skip:
either none? i: find data value [
insert data reduce [value 1]
][
i: next i
change i 1 + first i
if maxvalue < first i [maxvalue: first i]
]
the result with list!: 0:00:01.041
=( Oliva David )=======================( [oliva--david--seznam--cz] )==
=( Earth/Europe/Czech_Republic/Brno )=============================
=( coords: [lat: 49.22 long: 16.67] )=============================