[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: string immutability
- From: Thijs Schreijer <thijs@...>
- Date: Thu, 2 Jan 2014 12:48:18 +0000
> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Scott Morgan
> Sent: donderdag 2 januari 2014 11:30
> To: lua-l@lists.lua.org
> Subject: Re: string immutability
>
> On 02/01/14 08:57, Thijs Schreijer wrote:
> > I'm writing some code that might potentially handle very large
> > strings. To write this properly/efficient I have a question on string
> > immutability.
>
> You might want to look at the 'rope' patten.
>
> http://en.wikipedia.org/wiki/Rope_%28computer_science%29
> http://lua-users.org/wiki/LuaRopes
>
> Scott
Thanks for the interesting read. But in this case I only need to traverse the string sequentially, no modifications. I just wanted to know whether I could easily pass it around without using and extravagant amount of memory.
Thijs