lua-users home
lua-l archive

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


>   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