[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string[], doesn't exist?
- From: Sam Roberts <sroberts@...>
- Date: Wed, 21 Jun 2006 11:05:36 -0700
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
- References:
- Re: Bitwsie operators in Lua, Gavin Wraith
- Re: Bitwsie operators in Lua, Sam Roberts
- Re: Bitwsie operators in Lua, Andy Stark
- Re: Bitwsie operators in Lua, Doug Rogers
- Re: Bitwsie operators in Lua, Andy Stark
- Re: Bitwsie operators in Lua, Roberto Ierusalimschy
- string[], doesn't exist?, Sam Roberts
- Re: string[], doesn't exist?, Luiz Henrique de Figueiredo
- Re: string[], doesn't exist?, Sam Roberts
- Re: string[], doesn't exist?, Luiz Henrique de Figueiredo