[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re[2]: string:sub
- From: Bulat Ziganshin <bulat.ziganshin@...>
- Date: Sun, 7 Mar 2010 13:44:44 +0300
Hello Philippe,
Sunday, March 7, 2010, 1:16:02 PM, you wrote:
>> I suppose it would be better all around if string.sub only accepted
>> non-null integers as indices
> Yes, but unlike some languages like Java, which prefer to hold the hand
> of users (might be useful in large projects, I reckon), Lua's
> philosophy, not unlike C's one, is: "garbage in, garbage out".
> Ie. most functions just don't check validity of input, relying on
> intelligence of programmers to provide valid data. At the risk of
> crashing or having undefined behavior (security breaches...).
afaik, Lua philosophy is to guarantee that no crash or security
violation can occur. such philosophy doesn't prohibit g.in->g.out, though
--
Best regards,
Bulat mailto:Bulat.Ziganshin@gmail.com
- References:
- string:sub, David Burgess
- Re: string:sub, Philippe Lhoste
- Re: string:sub, David Burgess
- Re: string:sub, Erik Lindroos
- Re: string:sub, David Burgess
- Re: string:sub, Enrico Colombini
- Re: string:sub, spir
- Re: string:sub, Scott Vokes
- Re: string:sub, joao lobato
- Re: string:sub, Philippe Lhoste