[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade)
- From: Javier Guerra Giraldez <javier@...>
- Date: Thu, 27 Mar 2014 14:42:08 -0500
On Thu, Mar 27, 2014 at 2:10 PM, Coroutines <coroutines@gmail.com> wrote:
> A linked list of Lua strings has the potential to
> contain many smaller, intermediate strings and avoid moving strings in
> memory.
these are called 'ropes'
http://en.wikipedia.org/wiki/Rope_(data_structure) and have
well-known advantages over simple strings, but most of them are easy
to get just by using a Lua array of strings. insertion/deletion is
O(n), but here 'n' is the number of elements, which shouldn't be too
big.
usually, functions that build complex strings do it by populating an
array and string.concat()'ing it at the end. sometimes you can get by
simply by skipping that last operation.
i don't quite get your paragraph about GC'ing rope elements, if the
rope isn't collectable, an element isn't either. if elements are
shared, then they're collectable once they cease to belong to any
rope, just like common strings.
--
Javier
- References:
- Re: [ANN] Lua 5.3.0 (work2) now available, Andrew Starks
- Re: [ANN] Lua 5.3.0 (work2) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), katlogic
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Roberto Ierusalimschy
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Hisham
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Rena
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), William Ahern
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Andrew Starks
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Dirk Laurie
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Oliver Kroth
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Oliver Kroth
- Re: [ANN] Lua 5.3.0 (work2) now available (number coercion holy crusade), Coroutines