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

Re: Mutable vs immutable strings

Thread Previous | Thread Next
From:
Andrew J Bromage
Date:
April 23, 2002 17:16
Subject:
Re: Mutable vs immutable strings
Message ID:
20020424101545.A10624@smtp.alicorna.com
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
collection.

> 3. Which is more important?

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

Cheers,
Andrew Bromage

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About