[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 5.3.0-work3 and lossless integer conversion
- From: Coroutines <coroutines@...>
- Date: Tue, 24 Jun 2014 12:59:09 -0700
On Tue, Jun 24, 2014 at 12:32 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
> string.sub("abc", 2.3) currently behaves in a non-specified way
> (although most certainly it is equivalent to string.sub("abc", 2)
> and we are afraid some programmers assume this behavior); current
> 5.3w specifies that 2.3 should be truncated to 2, while with this new
> proposal Lua would raise an error.
I'm trying to imagine a creative use for incrementing a float in a
linear way to index/substring something. An error sounds appropriate,
though..