To add to Adrian's explanation, when a string is in memory, the first
few bytes at that string's address is not actual data, but metadata
about the string, including its length, so UV immediately knows where
the string ends (& where the next string begins).
Therefore <-1> can make an immediate jump, rather than searching through
the string counting attributes.

This also implies that something like
    IF LEN( X ) THEN
is faster than something like
    IF (X # '') THEN
.

You can also see why <n,-1> & <n,m,-1> aren't particularly fast, since
they aren't at the end of the srting.

UV keeps similar metadata up front about the last attribute accessed, &
the remove pointer.  That is what makes both REMOVE/REVREMOVE and
EXTRACTs of sequential <n>s so fast.

cds
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to