lua-users home
lua-l archive

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



> 
> Strictly speaking, maybe, functions do not have names.  But they are
> referred to with names.  It is that, the name which is used to refer to
> the function, that I would attach the deprecation to.  (This makes
> sense to me especially because you may want to simply rename some
> functionality, in which case you want to deprecate the old name, not
> the functionality itself.  Also, attaching the deprecation to the name
> instead of the thing allows you to deprecate things other than
> functions.)
> 
> /~\ The ASCII				  Mouse
> \ / Ribbon Campaign
> X  Against HTML		mouse@rodents-montreal.org
> / \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

But the point here is that you DONT know what you are deprecating. The arbitrary value in that variable at some arbitrary time in the program execution? YOU might know that it’s always a single specific function, but others may not .. and a label like “deprecation” is a way to communicate to others your intent. And if the intent is not clear (which your suggested model is not), then it fails.

What you are deprecating is functionality .. which is .. well .. a function. And in a dynamic language like Lua the only place for that is part of the function or (as others have noted) a wrapper mechanism.

If you just need to annotate that a function is deprecated for yourself, why not just use a comment?

—Tim