[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is string always same as number? (the consistency of lua)
- From: Dirk Laurie <dpl@...>
- Date: Thu, 10 Feb 2011 11:35:23 +0200
On Thu, Feb 10, 2011 at 07:54:56AM +0200, Miles Bader wrote:
>
> I don't think anybody actually thinks the automatic conversion is a
> good idea these days, but it's there for historical reasons.
>
I think it's a good idea. You've got the option to fill your program
with 'tonumber' and 'tostring' if you think automatic conversion is
bad, but you are not forced to do so. That's the Lua way.
Lua coerces only to 'number' and 'string'. There can be no ambiguity.
Let the context decide.
If you prefer instead overloading '+' and '*' to mean concatenation
and repetition, you can always revert to Python.
Dirk