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

Re: Mutable vs immutable strings

Thread Previous | Thread Next
Dan Sugalski
July 10, 2002 08:21
Re: Mutable vs immutable strings
Message ID:
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.

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai                         have teddy bears and even
                                       teddy bears get drunk

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