Feature #20

New keyword: obsolete

Added by Cédric RICARD over 10 years ago. Updated over 10 years ago.

Status:AssignedStart date:
Priority:LowDue date:
Assignee:Alain Prouté% Done:


Target version:1.x
Platform: Triage Stage:


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]]
  ) =
  <function body>.

Or maybe better (as we can suppose that 'obsolete' functions or type are always public ones):

obsolete(new_function_name) define [[ReturnType]]
  ) =
  <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.


#1 Updated by Alain Prouté over 10 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.

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux