develooper Front page | perl.perl6.internals | Postings from April 2002

Re: Mutable vs immutable strings

Thread Previous | Thread Next
Andrew J Bromage
April 23, 2002 17:16
Re: Mutable vs immutable strings
Message ID:
G'day all.

On Tue, Apr 23, 2002 at 01:18:23PM -0700, Brent Dax wrote:

> Three questions:
> 1. Which'll be faster?

It depends on the application, but my money is on mutable strings
built on top of an immutable buffer.  That's based on looking at my
own string-based Perl code, a lot of which is substring extraction
(usually by regular expression).  It may pay off if a string and its
substrings can share implementation.

> 2. Which'll be simpler?

Immutable strings are definitely simpler, when you have garbage

> 3. Which is more important?

At the risk of stating the obvious, it is more important for the
interface to be complete.

Andrew Bromage

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About