Hi there,
One thing I find very puzzling on this subject:
>> c: copy b: a: head insert/dup "" "a" 100000 print "done"
done
>> time-it [loop 5000 [a = b]] ; 1) should be done very fast
0:00:15
>> time-it [loop 5000 [a = c]] ; 2) takes time, of course
0:00:19
>> time-it [loop 5000 [a =? b]] ; 3) should be done very fast
0:00:15
>> time-it [loop 5000 [a =? c]] ; 4) should be done very fast
0:00:18
=? is the operator for SAME?
2) takes time because 100,000 characters have to be compared. But it should
take almost no time at all to determine if two string values are the "same",
as in 3) and 4), since all you have to do is compare two pointers to memory
and two indexes. Likewise, if two values are the "same", they must be equal,
so ideally 1) should be fast as well. So why doesn't REBOL do this a little
more efficiently?
See you,
Eric