[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: PiL 1
- From: Alexander Gladysh <agladysh@...>
- Date: Thu, 13 Oct 2011 03:58:52 +0400
On Wed, Oct 12, 2011 at 18:25, Petite Abeille <petite.abeille@gmail.com> wrote:
>
> On Oct 12, 2011, at 2:58 PM, Alexander Gladysh wrote:
>
>>> http://www.lua.org/manual/5.1/manual.html#pdf-string.len
>>
>> This does not means that one should use it.
>
> Why not? What's wrong with string.len?
>
>>> The length operator is new (in 5.1):
>>>
>>> http://www.lua.org/manual/5.1/manual.html#2.5.5
>>
>> Why do you mention it?
>
> It applies to string as well:
>
> ( 'hello world' ):len() == #( 'hello world' )
And should be used instead of len(), yes.
But, OK, that counts as house rules, probably. (Can't imagine why
anyone would use len() nowadays, but that's just me.)
Still, have table.getn, table.foreach to show. :)
Alexander.