Peter Van Roy wrote:
> 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.)  ...

You are right. For some reason I was thinking of a left-associative 
concatenation operator which translates S1++S2++S3++S4 to {Append {Append 
{Append S1 S2} S3} S4}.
But one would of course define such an operator as right-associative:
S1++S2++S3++S4 = {Append S1 {Append S2 {Append S3 S4}}}

Cheers,
  Wolfgang

-- 
Nur bis 31.05.: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und
Telefonanschluss nur 17,95 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to