Local Declaration Guidelines: Difference between revisions
New page: {{UnderConstruction}} Category:Coding Style Guidelines Local declaration style guidelines for contributing to the Eiffel Software code repository. == Feature Arguments == Feature arg... |
|||
| Line 5: | Line 5: | ||
== Feature Arguments == | == Feature Arguments == | ||
Feature arguments should begin with the prefix <e>a_</e> and nothing more. | Feature arguments should begin with the prefix <e>a_</e> and nothing more. The prefix <e>a_</e> represent a contraction of the word ''argument'' and does not represent the singular inflection - a ''noun'' - Therefore it is '''not''' valid to utilize ''an'' when the suffixed argument word begins with a vowel. The following is a correct usage: | ||
The prefix <e>a_</e> represent a contraction of the word ''argument'' and does not represent the singular inflection - a ''noun'' - Therefore it is '''not''' valid to utilize ''an'' when the suffixed argument word begins with a vowel. The following is a correct usage: | |||
<e> | <e> | ||
f (a_string: STRING; a_integer: STRING) | f (a_string: STRING; a_integer: STRING) | ||
... | |||
do | |||
end | |||
</e> | </e> | ||
Here, the second argument <e>a_integer</e>, is not considered ''A Integer'' but ''The Argument Integer''. | Here, the second argument <e>a_integer</e>, is not considered ''A Integer'' but ''The Argument Integer'', hence the use if <e>a_</e> instead of <e>_an_</e>. | ||
=== In-line Agent Feature Arguments === | === In-line Agent Feature Arguments === | ||
When working with an in-line agent, to prevent conflicts with the enclosing feature's arguments, the prefix <e>ia_</e> should be used. The same rules regarding English language rules apply here as they do to feature arguments. The IA prefix represents an ''In-line Argument''. | When working with an in-line agent, to prevent conflicts with the enclosing feature's arguments, the prefix <e>ia_</e> should be used. The same rules regarding English language rules apply here as they do to feature arguments. The IA prefix represents an ''In-line Argument''. | ||
<e> | |||
f (a_string: STRING; a_integer: STRING) | |||
... | |||
do | |||
process (agent (ia_string: STRING; ia_integer: INTEGER) | |||
do | |||
... | |||
end (a_string, a_integer)) | |||
end | |||
</e> | |||
== Local Declarations == | == Local Declarations == | ||
Revision as of 19:25, 9 January 2009
Local declaration style guidelines for contributing to the Eiffel Software code repository.
Feature Arguments
Feature arguments should begin with the prefix a_ and nothing more. The prefix a_ represent a contraction of the word argument and does not represent the singular inflection - a noun - Therefore it is not valid to utilize an when the suffixed argument word begins with a vowel. The following is a correct usage:
f (a_string: STRING; a_integer: STRING) ... do end
Here, the second argument a_integer, is not considered A Integer but The Argument Integer, hence the use if a_ instead of _an_.
In-line Agent Feature Arguments
When working with an in-line agent, to prevent conflicts with the enclosing feature's arguments, the prefix ia_ should be used. The same rules regarding English language rules apply here as they do to feature arguments. The IA prefix represents an In-line Argument.
f (a_string: STRING; a_integer: STRING) ... do process (agent (ia_string: STRING; ia_integer: INTEGER) do ... end (a_string, a_integer)) end
Local Declarations
l_
In Contracts
Due to the current scoping rules of object-tests
rl_ for require
el_ for ensure
cl_ for check
ll_ for loop
il_ for loop invariant
vl_ for loop variant
Indexing
When a conflict between local delcarations exist a form of indexing must be use
equals (a_object: ANY; a_other_object: ANY): BOOLEAN