lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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