Feature #20
New keyword: obsolete
Status: | Assigned | Start date: | ||
---|---|---|---|---|
Priority: | Low | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Compiler | |||
Target version: | 1.x | |||
Platform: | Triage Stage: | |||
Resolution: |
Description
As standard library and functions or types that compose it aren't yet perfectly well designed, and name changes can be frequent, adding a keyword 'obsolete' (or any thing like this) could be a great help.
This keyword does nothing else than producing a warning during compile time, just to remember to not use this function.
A variation of this could be the keyword : obsolete(new_function)
With this, the compiler can produce a very useful warning, telling which function to use instead of this one.
The keyword could be inserted into function or type definition like this :
public define obsolete(new_function_name) [[ReturnType]] old_function_name ( ... ) = <function body>.
Or maybe better (as we can suppose that 'obsolete' functions or type are always public ones):
obsolete(new_function_name) define [[ReturnType]] old_function_name ( ... ) = <function body>.
which made automatically this function public but obsolete.
Private function can always be easily renamed, so there is no need to mark them as obsolete.
History
#1
Updated by Alain Prouté over 17 years ago
- Status changed from New to Assigned
Good idea. I suggest this for the syntax:
obsolete "... compiler message ..."
public define ...
obsolete "... compiler message ..."
public type ...
The message will be sent (only once) if the paragraph is used.
We will also have to consider the case of some primitive obsolete features like Int32 which are not defined by paragraphs.