Wolfgang Meyer wrote:
Virtual strings are more efficient than plain old string concatenation because 
a virtual string like S1#S2#S3#S4 can be converted to a real string in {Length 
S1}+{Length S2}+{Length S3} steps while concatenation takes {Length 
S1}+({Length S1}+{Length S2})+({Length S1}+{Length S2}+{Length S3}) steps.

See also http://www.mozart-oz.org/home/doc/op/node4.html .

Cheers,
  Wolfgang
I don't understand the second formula. Wouldn't it be the same as the first? (I am assuming strings represented as lists.) For the virtual string, the advantage is that no string conversion is done at all, just a traversal (which would have to be done anyway). This saves time (no concatenation is needed) and memory (no memory needs to be allocated for the nonexisting concatenation).

Peter

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to