[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: AW: [FUN] A bit of code golfing
- From: Richter, Jörg <Joerg.Richter@...>
- Date: Sat, 1 Oct 2016 17:19:09 +0000
> For what is worth, I don't remember _ever_ having had trouble with the
> 0 index in string functions, or do I remember people posting about it
> on the list, so I've never seen these "tons of off-by-ones" in
> practice.
Please see http://lua-users.org/lists/lua-l/2013-02/threads.html#00212 and follow-ups.
Not tons of problems, but happened in practice.
Please note that this case still contradicts the reference manual:
"...and string.sub(s, -i) returns a suffix of s with length i."
Is not true for i == 0.
- Jörg