[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Speed of #t
- From: Kristofer Karlsson <kristofer.karlsson@...>
- Date: Mon, 13 Dec 2010 17:26:28 +0100
The string does not have any hole, the \0 is treated as any other character by lua.
It is only the (implicit) print statement in the interpreter that stops printing a string at the first encounter of a \0.
This has nothing at all to do with the length operator.
I feel this is worth pointing out:
> s="ab\0cd"
> =#s
5
> =s
ab
# applied to a string gives the highest valid index, ignoring any
"holes". The consistent thing to do would be to make it do the same
for tables.
--
Sent from my toaster.
- References:
- Re: [ANN] Lua 5.2.0 (alpha) now available, Richard Hundt
- Re: [ANN] Lua 5.2.0 (alpha) now available, Dirk Laurie
- Re: [ANN] Lua 5.2.0 (alpha) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.2.0 (alpha) now available, Enrico Colombini
- Re: [ANN] Lua 5.2.0 (alpha) now available, steve donovan
- Re: [ANN] Lua 5.2.0 (alpha) now available, Geoff Leyland
- Re: [ANN] Lua 5.2.0 (alpha) now available, Enrico Colombini
- Re: [ANN] Lua 5.2.0 (alpha) now available, Peter Cawley
- Re: [ANN] Lua 5.2.0 (alpha) now available, Dirk Laurie
- Re: [ANN] Lua 5.2.0 (alpha) now available, Enrico Colombini
- Speed of #t (was: Re: [ANN] Lua 5.2.0 (alpha) now available, Dirk Laurie
- Re: Speed of #t, Enrico Colombini
- Re: Speed of #t, Axel Kittenberger
- Re: Speed of #t, Enrico Colombini
- Re: Speed of #t, David Kastrup
- Re: Speed of #t, Enrico Colombini
- Re: Speed of #t, David Kastrup
- Re: Speed of #t, Enrico Colombini
- Re: Speed of #t, starwing
- Re: Speed of #t, Axel Kittenberger
- Re: Speed of #t, starwing
- Re: Speed of #t, HyperHacker