guerin@IRO.UMontreal.CA:> Is there some reasons to use string0 over length attributed string ??

Steve Simmons <ssimmons@convex.com> wrote:>Another minor benefit is the restriction on size. String0 has no>restriction at all other than the user's memory. [...]>A language purist may find this offensive since implementation of string>should be independent of the language definition.

There's also one great advantage of giving strings explicit lengths:
0 is no longer a special value. One easy example of this
is if you're printing bitmapped graphics to a dot-matrix printer --
a zero byte means don't fire any pins in this column, not end of string!

More importantly (and this actually bit me) is that some languages,
like Standard ML allow 0 in a string which causes interoperability
problems with a certain OS's RPC system, which assumes strings are
C-style. ML strings are of type string -- there is no length in the
type. They are very useful for dealing with binary data, however, this
usefulness does decrease when C code truncates the string at the first 0
byte.