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

Re: Mutable vs immutable strings

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
July 10, 2002 08:21
Subject:
Re: Mutable vs immutable strings
Message ID:
a05111b03b951fc00d939@[63.120.19.221]
At 7:34 AM -0700 7/10/02, John Porter wrote:
>Florian Haeglsperger wrote:
>>  But isn't this partly addressed with COW?
>>  . . .
>>  Thus I don't see a very big performance win in introducing mutable
>>  strings.
>
>Good point.
>
>But some people maintain that there could be a need for truly
>"constant" strings, that should never be modified, and any
>attempt to do so, even under COW, should fail.

Right. COW is a performance hack--there's a difference between "I 
defer getting a private copy" and "This isn't changeable". It's 
reasonably important to have both.

I'm not sure that the place to enforce read-onlyness is at the 
string/buffer level. Doing it at the PMC level is more likely the 
right place to do it.
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk

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