[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work2) now available
- From: Duncan Cross <duncan.cross@...>
- Date: Thu, 14 Jan 2010 22:03:10 +0000
2010/1/14 Ignacio Burgueño <ignaciob@inconcertcc.com>:
> But I can't think of a case where the length of something is not a numeric
> value.
>
> For me, __len has clear semantics. The length of something is measurable in
> 'n' units, with 'n' being a number.
>
> Using __len for other uses seems like a case of operator overloading abuse
> (C++).
I can think of a pretty high-profile example of this - Roberto's LPEG
library overloads the # operator for LPEG pattern objects for
something entirely unrelated to length (it "returns" a new pattern).
-Duncan