PROPOSAL: 'forget' keyword (beta) (original) (raw)

Marek Kozieł develop4lasu at gmail.com
Fri Mar 27 07:02:34 PDT 2009


I do not know if there is point to describe this proposal in details, because it require to introduce new keyword which may be impossible for project Coin scope.?

AUTHOR: Lasu aka Marek Kozieł

OVERVIEW

FEATURE SUMMARY: 'forget' keyword allows to erase variable from current context, or it means that field should not be used.

MAJOR ADVANTAGE: This change makes language be more WYSIWYG.

MAJOR BENEFIT(s):

MAJOR DISADVANTAGE: New keyword == Someone can have declared method/field/variable named 'forget'.

ALTERNATIVES: It's already listed.

EXAMPLES

SIMPLE / ADVANCED EXAMPLE(s): public static void main(final String[] args) { System.out.println(Arrays.toString(args)); forget args; // 'args' cannot be used anymore String[] args; // ignore/warning/error : unclear code ... }

public class Forget {

private ArrayList criticKeys;

public void addKey(String newKey){ forget this.criticKeys; // use synchronized method ONLY ... // validate ... // add }

}

DETAILS

SPECIFICATION: ...

COMPILATION: ...

TESTING: It's the same as testing effects of exiting from the block for variables. For fields, it's just an access control.

LIBRARY SUPPORT: None.

REFLECTIVE APIS: None.

OTHER CHANGES: None.

MIGRATION:

COMPATIBILITY New keyword can be problem. There is not other impact.

REFERENCES http://lasu2string.blogspot.com/2009/03/forget-keyword-proposal_27.html

-- Pozdrowionka. / Regards. Lasu aka Marek Kozieł

http://lasu2string.blogspot.com/



More information about the coin-dev mailing list