PR# 15859 Please allow use of keywords as identifiers
Problem Report Summary
Submitter: peter_gummer
Category: Compiler
Priority: Medium
Date: 2009/05/21
Class: Feature Request
Severity: Serious
Number: 15859
Release: 6.4.7.8765
Confidential: No
Status: Open
Responsible:
Environment: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-au) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1
Synopsis: Please allow use of keywords as identifiers
Description
Thomas Beale and I consider it's terrible that we can't name features the way we want. The fact that 'attribute' is now an Eiffel keyword has forced me to rename two features to 'attribute_', so now we have deviated from the openEHR specification. Eiffel's value as a specification language is diminished by this. I'd like to propose that Eiffel allows the use of keywords as identifiers, by surrounding an identifier with quotes of the kind already advocated for identifiers in Eiffel comments. For example: feature `attribute' (name: STRING): ATTRIBUTE_NODE do create Result.make (name) end ... a := complex_node.`attribute' ("1234")
To Reproduce
Problem Report Interactions
I had feature names in mind when I proposed allowing identifiers in code to be quoted using Eiffel's commenting convention for features (e.g. `attribute'). For classes, it would be more sensible to use Eiffel's commenting convention for classes (e.g. {ATTRIBUTE}). Therefore, if I had an attribute named `attribute' of type 'ATTRIBUTE', its declaration would be written like this: feature `attribute': {ATTRIBUTE} For situations where Eiffel currently requires the class name to be surrounded by braces, there is of course no problem because the class name would still be written as it is currently. For example, if the above feature were to be selectively exported to 'ATTRIBUTE', then the declaration would be written like this: feature {ATTRIBUTE} `attribute': {ATTRIBUTE}