Project

General

Profile

Actions

Feature #20

open

New keyword: obsolete

Feature #20: New keyword: obsolete

Added by Anonymous almost 19 years ago. Updated almost 19 years ago.

Status:
Assigned
Priority:
Low
Assignee:
Category:
Compiler
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Platform:
Resolution:
Triage Stage:

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.

Updated by Alain Prouté almost 19 years ago Actions #1

  • 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.

Actions

Also available in: PDF Atom