[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Speed of #t
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 13 Dec 2010 14:27:06 -0200
> I feel this is worth pointing out:
> > s="ab\0cd"
> > =#s
> 5
> > =s
> ab
>
This is a misleading example. If you io.write(s) to a file then you'll
get 5 bytes, as expected. (If you io.write(s) to stdout then you'll
get "abcdtrue", which is a bit misterious until you think about who is
printing what. The NUL byte is silently ignored by the terminal, it seems.)
> # 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.
A NUL byte in a string is definitely not a "hole".
- References:
- 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