lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Jun 21, 2006 at 02:57:41PM -0300, Luiz Henrique de Figueiredo wrote:
> > I guess strings have metatables, but numbers don't?
> 
> Yes. Number *can* have metatables, but none is set by default.
> I'm not sure you'd want to write 42:sin or 42:abs, but you could by setting
> the metatables of numbers to be math. (You'd have to do it in C.)

Well, I sure would! But then, I mostly code in ruby when not working in
C, so the "everything is an object" is pretty ingrained. Its hard to
shift language modes sometimes.

Sam