lua-users home
lua-l archive

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


A deprecation is not a thing used on the usage edge to have such marker. This is a thing used inside the deprecated thing as a warning.

So the reasonable way to accomplish that is to add a deprecation warning inside the deprecated function using the already existing Lua mechanism.

Deprecation is an event about the script not the language, so makes no sense to be a language feature, that yes, should provide a warn mechanism that already exists.


_________________
Thadeu de Paula



-------- Mensagem Original --------
Em 11 de set. de 2023 22:23, Frityet < ambhogal01@gmail.com> escreveu:

My friend had an idea, much like const, a `depreciated` attribute that warns when used

local add<depreciated> = function(a, b)
return a + b
end

add(1, 2) --warning

Thoughts?