[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Are automatic coercions ever going away?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 1 Aug 2014 12:06:21 -0300
> Could you possibly have three levels?
>
> 1. Status quo
> 2. Warn about coercions as they happen
> 3. Disable coercions.
>
> #2 would be very helpful when trying to update the code to avoid
> coercions.
Lua does not have any protocol for warnings...
> Or, if that can't be done, a call to determine which "optional"
> features are enabled/disabled.
This is easy to implement with 'pcall':
if pcall(function () return "0" + 1 end) then
print("string -> number enabled")
end
-- Roberto