-''end''
-next_line_of_code
+
+if then
+
+end
+next_line_of_code
+
-as you press Space just after typing ''if''. You should define the "Customized auto complete (Space after keyword was typed)" string for ''if'' as :
+as you press Space just after typing if.
-" $cursor$ then%N$indent$%T%N$indent$end"
+To make this happen, you should define the "Customized auto complete (Space after keyword was typed)" string for if as :
-First, EiffelStudio editor has to insert a blank space after ''if''. The string begins therefore by a blank space.
+
+$cursor$ then%N$indent$%T%N$indent$end
+
+
+First, EiffelStudio editor has to insert a blank space after if. The string begins therefore by a blank space.
Then, ''$cursor$'' tells EiffelStudio to move the cursor to this position after the completion.
-''then'' is inserted after the cursor position.
-''%N'' indicates that you want to insert a new line after ''then''.
-''$indent$%T'' means that this line is filled with as many blank spaces as there are before ''if'' plus a tabulation.
+then is inserted after the cursor position.
+''%N'' indicates that you want to insert a new line after then.
+''$indent$%T'' means that this line is filled with as many blank spaces as there are before if plus a tabulation.
Another line is inserted with ''%N''.
-Then ''$indent$end'' means that ''end'' will be inserted in this new line with the same indentation as ''if''.
+Then ''$indent$end'' means that end will be inserted in this new line with the same indentation as if.
-#
-You want the lines of code :
-''end''
+2) You want the lines of code :
+
+
+end
next_line_of_code
+
to become:
-''end''
-
+
+end
+
next_line_of_code
+
-as you press Return just after typing ''end''. You should define the "Customized auto complete (Return after keyword was typed)" string for ''end'' as :
+as you press Return just after typing end.
-"%B%B%B%Bend%N$indent$%B$cursor$"
+To make this happen, you should define the "Customized auto complete (Return after keyword was typed)" string for end as :
-The four ''%B'' will remove ''end'' plus one character before ''end'' (the tabulation character).
-''end'' will be inserted at this new position.
+
+%B%B%B%Bend%N$indent$%B$cursor$
+
+
+The four ''%B'' will remove end plus one character before end (the tabulation character).
+end will be inserted at this new position.
''%N'' indicates that you want to insert a new line.
-''$indent$%B$cursor$'' means that the cursor will be moved to the end of the line where one less blank space than before the original ''end'' will have been inserted.
+''$indent$%B$cursor$'' means that the cursor will be moved to the end of the line where one less blank space than before the original end will have been inserted.
-{{note|EiffelStudio editor can insert spaces instead of tabulation when you use special character ''%T''. This is set in [[General Editor Preferences|another section of the preferences]] .
-}}
+{{note|EiffelStudio editor can insert spaces instead of tabulation when you use special character ''%T''. This is set in [[General Editor Preferences|another section of the preferences]] .}}
{{seealso|
[[Keywords automatic completion preferences|Keywords automatic completion preferences]]
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/editor-preferences/general-editor-preferences.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/editor-preferences/general-editor-preferences.wiki
index e78be549..f1ee9a50 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/editor-preferences/general-editor-preferences.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/editor-preferences/general-editor-preferences.wiki
@@ -50,6 +50,7 @@ General Preferences
| Should tab character be used for auto-indentation?
|}
+
Display Colors
{| border="1"
|-
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/eiffelstudio-tools-preferences/context-tools.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/eiffelstudio-tools-preferences/context-tools.wiki
index 7647ba89..33626f45 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/eiffelstudio-tools-preferences/context-tools.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/eiffelstudio-tools-preferences/context-tools.wiki
@@ -23,6 +23,7 @@ This category gathers the preferences related to context tools.
| Show all callers (as opposed to local callers) in `callers' form.
|}
+
Class views indices:
{| border="1"
|-
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/eiffelstudio-tools-preferences/eiffelstudio-diagram-tool-preferences.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/eiffelstudio-tools-preferences/eiffelstudio-diagram-tool-preferences.wiki
index 0326ee7d..93638261 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/eiffelstudio-tools-preferences/eiffelstudio-diagram-tool-preferences.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/eiffelstudio-preferences/preferences-reference/eiffelstudio-tools-preferences/eiffelstudio-diagram-tool-preferences.wiki
@@ -37,6 +37,7 @@ This category gathers the preferences related to the EiffelStudio BON Diagram to
| Show suppliers of a class up to a level of preference value.
|}
+
==BON Preferences==
{| border="1"
@@ -93,6 +94,7 @@ This category gathers the preferences related to the EiffelStudio BON Diagram to
| Line width for BON inheritance links.
|}
+
==UML Preferences==
{| border="1"
@@ -167,6 +169,7 @@ This category gathers the preferences related to the EiffelStudio BON Diagram to
| Color for UML inheritance links.
|}
+
{{seealso|
[[EiffelStudio Tools Preferences|Preferences for other tools]] }}
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/formatted-information-about-compiled-classes-and-features/class-views/once-routines-and-constants.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/formatted-information-about-compiled-classes-and-features/class-views/once-routines-and-constants.wiki
index 869f71f0..8ab0c94f 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/formatted-information-about-compiled-classes-and-features/class-views/once-routines-and-constants.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/formatted-information-about-compiled-classes-and-features/class-views/once-routines-and-constants.wiki
@@ -1,8 +1,8 @@
[[Property:title|Once routines and constants]]
[[Property:weight|0]]
[[Property:uuid|05007945-20fd-99d6-95cb-ec96845c131f]]
-The once view [[Image:class-features-once-icon]] displays all the [[Routines|routines]] declared as '''once''' and the constant [[Attributes|attributes]] in the current class (or in its [[Ancestors|ancestors.]] ).
-It is available through the '''Class''' tab of the [[EiffelStudio window overview|context tool]] .
+The once view [[Image:class-features-once-icon]] displays all the [[Routines|routines]] declared as '''once''' and the constant [[Attributes|attributes]] in the current class (or in its [[Ancestors|ancestors]]).
+It is available through the '''Class''' tab of the [[EiffelStudio window overview|context tool]].
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-feature-dialog-feature-properties-modification/feature-clauses.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-feature-dialog-feature-properties-modification/feature-clauses.wiki
index e72b83fa..1f936bab 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-feature-dialog-feature-properties-modification/feature-clauses.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-feature-dialog-feature-properties-modification/feature-clauses.wiki
@@ -14,12 +14,16 @@ For feature clause names it is recommended that you pick one from the standard o
==Generated code==
The code that is inserted in your class as a result of the selections made for the feature clause, is of the form:
-feature {EXPORT} -- Clause name
-except if you specified ANY as export status, which is similar to having no export status.
-feature --Clause name
+
+ feature {EXPORT} -- Clause name
+except if you specified ANY as export status, which has the same meaning as not specifying class names in the export status:
+
+ feature --Clause name
+
For example, if you specified a the "Initialization" feature clause name, and specified NONE as export status, you get:
-feature {NONE} -- Initialization
+
+ feature {NONE} -- Initialization
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-feature-dialog-overview.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-feature-dialog-overview.wiki
index 5134a45f..b2fa5ce3 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-feature-dialog-overview.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-feature-dialog-overview.wiki
@@ -2,7 +2,11 @@
[[Property:weight|1]]
[[Property:uuid|c0708842-e5e0-5d5c-5746-0507d1709a3e]]
There are two parts in the window. The upper part allows you to choose what type of feature you want to create, a procedure, a function or an attribute.
- [[Image:feature-wizard]]
+
+
+[[Image:feature-wizard]]
+
+
The rest of the window is used to set the characteristics of the new feature. Information you will be asked depends on the type you chose. For more information, click on one of the links below:
* [[New procedure layout|New procedure layout]]
* [[New function layout|New function layout]]
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-procedure-layout.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-procedure-layout.wiki
index a1faddea..1335451a 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-procedure-layout.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/dialogs/new-feature-dialog/new-procedure-layout.wiki
@@ -16,19 +16,21 @@ When clicking '''Procedure''', the window changes to the procedure layout. It ha
This dialog box:
[[Image:feature-wizard-procedure-example]]
+
Produces this feature:
-class
+
+class
PRODUCT
feature {PERSON} -- Element change
place_order (person: PERSON; quantity: INTEGER) is
-- Mail `quantity' to `person'.
- require
+ require
person /= Void and quantity > 0
- do
+ do
person.mail_order (Current, quantity)
- ensure
+ ensure
person.has_ordered (Current)
end
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/index.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/index.wiki
index 6e27192b..c1c46f22 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/index.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/index.wiki
@@ -1,14 +1,17 @@
[[Property:title|Profiler wizard guided tour]]
[[Property:weight|1]]
[[Property:uuid|e6166282-aa91-e4a9-9951-819f32d50b88]]
-# [[Select the Compilation mode|'''First step:''' Select which version of your system you ran using the profiler: Workbench or Finalized]] .
-# [[Reuse or Generate an Execution Profile| '''Second step (only appears when an ''' ''Execution Profile'' '''has already been generated for this system)''': Select an existing ''Execution Profile'' or choose to generate a new ''Execution Profile'' from a ''Run-time information record''. ]]
-# [[Select a Run-time information record to generate the Execution Profile| '''Third step (only appears when generating a new ''' ''Execution Profile''''')''': Generate a new ''Execution Profile'' from a ''Run-time information record''. ]]
-# [[Select the information you need and formulate your query|'''Final step''': Select the information you need and formulate your query.]]
-# [[Profile query window|Profile query window]]
+Using the Profiler Wizard consists of activities in four "states", each of which is represented by a wizard dialog box:
+
+# [[Select the Compilation mode|Select which version of your system you ran using the profiler: ''Workbench'' or ''Finalized'']] .
+# [[Reuse or Generate an Execution Profile|Select an existing ''Execution Profile'' or choose to generate a new ''Execution Profile'' from a ''Run-time information record'' (This step only applies when an ''Execution Profile'' has already been generated for this system)]]
+# [[Select a Run-time information record to generate the Execution Profile|Generate a new ''Execution Profile'' from a ''Run-time information record'' (This step only applies when generating a new ''Execution Profile'')]]
+# [[Select the information you need and formulate your query|Select the information you need and formulate your query.]]
+
+Results of your query are visible in the [[Profile query window|Profile query window]].
+
{{seealso|
-[[Profiler wizard]]
[[Profiling|How to profile a system]] }}
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/profile-query-window.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/profile-query-window.wiki
index 180f7e09..e8ec7522 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/profile-query-window.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/profile-query-window.wiki
@@ -15,10 +15,9 @@ Click on the '''Save''' button to save the currently displayed results in a text
{{tip|To visualize the result in Microsoft Excel or any other spreadsheet, select the entire text (except the first three lines where the Execution Profile file is specified), copy it and then paste it into Excel. }}
- [[Image:profiler-query-window]]
+[[Image:profiler-query-window]]
{{seealso|
-[[Profiler wizard]]
[[Profiling|How to profile a system]] }}
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/reuse-or-generate-execution-profile.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/reuse-or-generate-execution-profile.wiki
index 82b8cac8..2a3b658a 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/reuse-or-generate-execution-profile.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/reuse-or-generate-execution-profile.wiki
@@ -12,14 +12,13 @@ However, if you have not executed your system since the generation of the last '
{{tip|If you want to archive different ''Execution Profiles'' (to compare them for example), rename the ''profinfo.pfi'' file into a new name but keep the .pfi extension. The profiler wizard detects existing Execution Profiles by checking the file extensions. }}
- [[Image:profiler-wizard-second-state]]
+[[Image:profiler-wizard-second-state]]
Clicking '''Next''' will lead you to the [[Select a Run-time information record to generate the Execution Profile|Third state]] if you have selected '''Generate a profile from Run-time information record'''. On the other hand if you have selected '''Use existing profile''' you will go to the [[Select the information you need and formulate your query|Final state]] .
{{seealso|
-[[Profiler wizard]]
[[Profiling|How to profile a system]] }}
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-compilation-mode.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-compilation-mode.wiki
index 7833c9f7..93c3d452 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-compilation-mode.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-compilation-mode.wiki
@@ -5,14 +5,14 @@ The first screen of the wizard lets you specify the mode in which the profiled s
If you have run a finalized system under the control of the profiler then select '''Finalized mode''' and click '''Next'''. On the contrary if you have executed the system in Workbench mode then select '''Workbench mode''' and click '''Next'''.
- [[Image:profiler-wizard-first-state]]
+[[Image:profiler-wizard-first-state]]
Clicking '''Next''' will lead you to the [[Reuse or Generate an Execution Profile|Second state]] or to the [[Select a Run-time information record to generate the Execution Profile|Third state]] depending on whether an ''Execution Profile'' has already been generated for this compilation mode or not. If no ''Execution Profile'' has been generated so far (which happens the first time you execute this wizard for a specified project in a given compilation mode) you will go to the [[Select a Run-time information record to generate the Execution Profile|Third state]] , otherwise you will go to the [[Reuse or Generate an Execution Profile|Second state]] .
{{seealso|
-[[Profiler wizard]]
[[Profiling|How to profile a system]] }}
+[[Profiling|How to profile a system]] }}
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-information-you-need-and-formulate-your-query.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-information-you-need-and-formulate-your-query.wiki
index a05eb6d3..8bd58d09 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-information-you-need-and-formulate-your-query.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-information-you-need-and-formulate-your-query.wiki
@@ -43,7 +43,7 @@ Each sub-query must have the following syntax 'attribute operator value' where:
- [[Image:profiler-wizard-fourth-state]]
+[[Image:profiler-wizard-fourth-state]]
@@ -51,7 +51,6 @@ Clicking '''Next''' will open the [[Profile query window|Profile query window]]
{{seealso|
-[[Profiler wizard]]
[[Profiling|How to profile a system]] }}
diff --git a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-run-time-information-record-generate-execution-profile.wiki b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-run-time-information-record-generate-execution-profile.wiki
index 8074d489..82a393fa 100644
--- a/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-run-time-information-record-generate-execution-profile.wiki
+++ b/documentation/current/eiffelstudio/eiffelstudio-reference/wizards-and-dialogs/profiler-wizard/profiler-wizard-guided-tour/select-run-time-information-record-generate-execution-profile.wiki
@@ -5,20 +5,19 @@ The third screen of the wizard lets you generate an ''Execution Profile'' from a
Then, in the combo box labeled '''Profiler used to produce the above record''', select the profiler that has been used to produce the ''Run-time information record'' you have entered. If the profiler used to execute the system does not appear in the combo box, you have to add it. See [[How to set up a Profiler Configuration File|How to set up a Profiler Configuration File]] for more details on how to do so.
-{{note|The Run-time information record'' has to be located in the ''EIFGENs/target_name/W_code'' directory of your project. }}
+{{note|The Run-time information record must be located in the ''EIFGENs/target_name/W_code'' directory of your project. }}
- [[Image:profiler-wizard-third-state]]
+[[Image:profiler-wizard-third-state]]
Clicking '''Next''' will lead you to the [[Select the information you need and formulate your query|Final state]] if the provided ''Run-time information record'' is valid. If the ''Run-time information record'' is not valid or is not located in the ''EIFGENs/target_name/W_code'' directory of the project, you will go to the '''Run-time Information Record Error state''' as shown below.
- [[Image:profiler-wizard-rtir-error-state]]
+[[Image:profiler-wizard-rtir-error-state]]
{{seealso|
-[[Profiler wizard]]
[[Profiling|How to profile a system]]
[[How to set up a Profiler Configuration File|How to set up a Profiler Configuration File]] }}
diff --git a/documentation/current/method/invitation-eiffel-i2e/i2e-classes.wiki b/documentation/current/method/invitation-eiffel-i2e/i2e-classes.wiki
index 15827bf2..0dff8f3e 100644
--- a/documentation/current/method/invitation-eiffel-i2e/i2e-classes.wiki
+++ b/documentation/current/method/invitation-eiffel-i2e/i2e-classes.wiki
@@ -19,20 +19,22 @@ The term "entity" generalizes the more common notion of "variable". An entity de
An entity is said to be void if it is not attached to any object. By default, entities are void at initialization. To obtain objects at run-time, a routine r appearing in the client class X may use a '''creation instruction''' of the form
-create acc
+
+ create acc
which creates a new direct instance of ACCOUNT , attaches acc to that instance, and initializes all its fields to default values. A variant of this notation, studied below, makes it possible to override the default initializations.
Once the client has attached acc to an object, it may call on this object the features defined in class ACCOUNT . Here is an extract with some feature calls using acc as their target:
-acc.open ("Jill")
-acc.deposit (5000)
-if acc.may_withdraw (3000) then
- acc.withdraw (3000)
- print (acc.balance)
-end
+
+ acc.open ("Jill")
+ acc.deposit (5000)
+ if acc.may_withdraw (3000) then
+ acc.withdraw (3000)
+ print (acc.balance)
+ end
-These feature calls use dot notation, of the form target . feature_name , possibly followed by a list of arguments in parentheses. Features are of two kinds:
+These feature calls use dot notation, of the form target_name.feature_name , possibly followed by a list of arguments in parentheses. Features are of two kinds:
* '''Routines''', such as open , deposit , may_withdraw , withdraw , represent computations applicable to instances of the class.
* '''Attributes''' represent data items associated with these instances.
@@ -42,34 +44,35 @@ Routines are further divided into '''procedures''' (commands, which do not retur
In class ACCOUNT , is feature balance an attribute, or is it a function with no argument? The above extract of the client class X doesn't say, and this ambiguity is intentional. A client of ACCOUNT must not need to know how class ACCOUNT delivers an account's balance when requested: by looking up a field present in each account object, or by calling a function that computes the balance from other fields. Choosing between these techniques is the business of class ACCOUNT , not anybody else's. Because such implementation choices are often changed over the lifetime of a project, it is essential to protect clients against their effects. This is known as the '''Uniform Access Principle''', stating that the choice between representing a property through memory (an attribute) or through an algorithm (function) shall not affect how clients use it.
-So much for how client classes will typically use ACCOUNT. Below is a first sketch of how class ACCOUNT itself might look. Line segments beginning with -- are comments. The class includes two feature clauses, introducing its features. The first begins with just the keyword feature , without further qualification; this means that the features declared in this clause are available (or "exported") to all clients of the class. The second clause is introduced by feature { NONE } to indicate that the feature that follows, called add , is available to no client. What appears between the braces is a list of client classes to which the corresponding features are available; NONE is a special class of the Kernel Library, which has no instances, so that add is in effect a secret feature, available only locally to the other routines of class ACCOUNT . So in a client class such as X , the call acc . add ( -3000 ) would be invalid.
-class ACCOUNT
+So much for how client classes will typically use ACCOUNT. Below is a first sketch of how class ACCOUNT itself might look. Line segments beginning with -- are comments. The class includes two feature clauses, introducing its features. The first begins with just the keyword feature , without further qualification; this means that the features declared in this clause are available (or "exported") to all clients of the class. The second clause is introduced by feature { NONE } to indicate that the feature that follows, called add , is available to no client. What appears between the braces is a list of client classes to which the corresponding features are available; NONE is a special class of the Kernel Library, which has no instances, so that add is in effect a secret feature, available only locally to the other routines of class ACCOUNT . So in a client class such as X , the call acc.add ( -3000 ) would be invalid.
+
+class ACCOUNT
feature
balance: INTEGER
owner: PERSON
- minimum_balance: INTEGER is 1000
+ minimum_balance: INTEGER = 1000
- open (who: PERSON) is
+ open (who: PERSON)
-- Assign the account to owner who.
do
owner := who
end
- deposit (sum: INTEGER) is
+ deposit (sum: INTEGER)
-- Deposit sum into the account.
do
add (sum)
end
- withdraw (sum: INTEGER) is
+ withdraw (sum: INTEGER)
-- Withdraw sum from the account.
do
add (-sum)
end
- may_withdraw (sum: INTEGER): BOOLEAN is
+ may_withdraw (sum: INTEGER): BOOLEAN
-- Is there enough money to withdraw sum?
do
Result := (balance >= sum + minimum_balance)
@@ -77,7 +80,7 @@ feature
feature {NONE}
- add (sum: INTEGER) is
+ add (sum: INTEGER)
-- Add sum to the balance
do
balance := balance + sum
@@ -86,19 +89,19 @@ feature {NONE}
end -- ACCOUNT
-Let us examine the features in sequence. The is ... do ... end distinguishes routines from attributes. So here the class has implemented balance as an attribute, although, as noted, a function would also have been acceptable. Feature owner is also an attribute.
+Let us examine the features in sequence. The do ... end distinguishes routines from attributes. So here the class has implemented balance as an attribute, although, as noted, a function would also have been acceptable. Feature owner is also an attribute.
The language definition guarantees automatic initialization, so that the initial balance of an account object will be zero after a creation instruction. Each type has a default initial value: zero for INTEGER and REAL , false for BOOLEAN , null character for CHARACTER , and a void reference for reference types. The class designer may also provide clients with different initialization options, as will be seen below in a revised version of this example.
The other public features, withdraw deposit, open, and may_withdraw are straight-forward routines. The special entity Result , used in may_withdraw , denotes the function result; it is initialized on function entry to the default value of the function's result type. You may only use Result in functions.
-The secret procedure add serves for the implementation of the public procedures deposit and withdraw ; the designer of ACCOUNT judged it too general to be exported by itself. The clause is 1000 introduces minimum_balance as a constant attribute, which will not occupy any space in instances of the class; in contrast, every instance has a field for every non-constant attribute such as balance .
+The secret procedure add serves for the implementation of the public procedures deposit and withdraw ; the designer of ACCOUNT judged it too general to be exported by itself. The clause = 1000 introduces minimum_balance as a constant attribute, which will not occupy any space in instances of the class; in contrast, every instance has a field for every non-constant attribute such as balance .
-In Eiffel's object-oriented programming style any operation is relative to a certain object. A client invoking the operation specifies this object by writing the corresponding entity on the left of the dot, as acc in acc . open ( "Jill" ). Within the class, however, the "current" instance to which operations apply usually remains implicit, so that unqualified feature names, such as owner in procedure open or add in deposit , mean "the owner attribute or add routine relative to the current instance".
+In Eiffel's object-oriented programming style any operation is relative to a certain object. A client invoking the operation specifies this object by writing the corresponding entity on the left of the dot, as acc in acc.open ("Jill") . Within the class, however, the "current" instance to which operations apply usually remains implicit, so that unqualified feature names, such as owner in procedure open or add in deposit , mean "the owner attribute or add routine relative to the current instance".
If you need to denote the current object explicitly, you may use the special entity Current . For example the unqualified occurrences of add appearing in the class text above are equivalent to Current . add .
-In some cases, infix or prefix notation will be more convenient than dot notation. For example, if a class VECTOR offers an addition routine, most people will feel more comfortable with calls of the form v + w than with the dot-notation call v . plus ( w ). To make this possible it suffices to give the routine a name of the form infix "+" rather than plus ; internally, however, the operation is still a normal routine call. Prefix operators are similarly available.
+In some cases, infix or prefix notation will be more convenient than dot notation. For example, if a class VECTOR offers an addition routine, most people will feel more comfortable with calls of the form v + w than with the dot-notation call v.plus (w). To make this possible it suffices to give the routine a name of the form infix "+" rather than plus ; internally, however, the operation is still a normal routine call. Prefix operators are similarly available.
The above simple example has shown the basic structuring mechanism of the language: the class. A class describes objects accessible to clients through an official interface comprising some of the class features. Features are implemented as attributes or routines; the implementation of exported features may rely on other, secret ones.
diff --git a/documentation/current/method/invitation-eiffel-i2e/i2e-design-contract-and-assertions.wiki b/documentation/current/method/invitation-eiffel-i2e/i2e-design-contract-and-assertions.wiki
index a5dbb3dd..09e5f877 100644
--- a/documentation/current/method/invitation-eiffel-i2e/i2e-design-contract-and-assertions.wiki
+++ b/documentation/current/method/invitation-eiffel-i2e/i2e-design-contract-and-assertions.wiki
@@ -13,7 +13,8 @@ Eiffel encourages software developers to express formal properties of classes by
With appropriate assertions, the class ACCOUNT becomes:
-class ACCOUNT
+
+class ACCOUNT
create
make
@@ -21,7 +22,7 @@ feature
... Attributes as before:
balance , minimum_balance , owner , open ...
- deposit (sum: INTEGER) is
+ deposit (sum: INTEGER)
-- Deposit sum into the account.
require
sum >= 0
@@ -31,7 +32,7 @@ feature
balance = old balance + sum
end
- withdraw (sum: INTEGER) is
+ withdraw (sum: INTEGER)
-- Withdraw sum from the account.
require
sum >= 0
@@ -48,7 +49,7 @@ feature {NONE}
add ...
- make (initial: INTEGER) is
+ make (initial: INTEGER)
-- Initialize account with balance initial.
require
initial >= minimum_balance
@@ -67,16 +68,23 @@ The notation old expression is only valid in a rou
==Creation procedures==
In its last version above, the class now includes a creation procedure, make . With the first version, clients used creation instructions such as create acc1 to create accounts; but then the default initialization, setting balance to zero, violated the invariant. By having one or more creation procedures, listed in the create clause at the beginning of the class text, a class offers a way to override the default initializations. The effect of
-create acc1.make (5_500)
+
+ create acc1.make (5_500)
is to allocate the object (as with the default creation) and to call procedure make on this object, with the argument given. This call is correct since it satisfies the precondition; it will ensure the invariant.
-{{info|The underscore _ in the integer constant 5_500 has no semantic effect. The general rule is that you can group digits by sets of three from the right to improve the readability of integer constants. }}
+{{info|The underscore _ in the integer constant ''5_500'' has no semantic effect. The general rule is that you can group digits by sets of three from the right to improve the readability of integer constants. }}
+
Note that the same keyword, create , serves both to introduce creation instructions and the creation clause listing creation procedures at the beginning of the class.
-A procedure listed in the creation clause, such as make , otherwise enjoys the same properties as other routines, especially for calls. Here the procedure make is secret since it appears in a clause starting with feature { NONE } ; so it would be invalid for a client to include a call such as
-acc.make (8_000)
+A procedure listed in the creation clause, such as make , otherwise enjoys the same properties as other routines, especially for calls. Here the procedure make is secret since it appears in a clause starting with
+
+ feature {NONE}
+
+so it would be invalid for a client to include a call such as
+
+ acc.make (8_000)
To make such a call valid, it would suffice to move the declaration of make to the first feature clause of class ACCOUNT , which carries no export restriction. Such a call does not create any new object, but simply resets the balance of a previously created account.
@@ -104,14 +112,14 @@ feature
balance: INTEGER
...
- deposit (sum: INTEGER) is
+ deposit (sum: INTEGER)
-- Deposit sum into the account.
require
sum >= 0
ensure
balance = old balance + sum
- withdraw (sum: INTEGER) is
+ withdraw (sum: INTEGER)
-- Withdraw sum from the account.
require
sum >= 0
diff --git a/documentation/current/method/invitation-eiffel-i2e/i2e-exceptions.wiki b/documentation/current/method/invitation-eiffel-i2e/i2e-exceptions.wiki
index 777b4304..57d2eb14 100644
--- a/documentation/current/method/invitation-eiffel-i2e/i2e-exceptions.wiki
+++ b/documentation/current/method/invitation-eiffel-i2e/i2e-exceptions.wiki
@@ -19,7 +19,7 @@ Usually, only a few routines of a system will explicitly include a rescue
An example using the exception mechanism is a routine attempt_transmission that tries to transmit a message over a phone line. The actual transmission is performed by an external, low-level routine transmit ; once started, however, transmit may abruptly fail, triggering an exception, if the line is disconnected. Routine attempt_transmission tries the transmission at most 50 times; before returning to its caller, it sets a boolean attribute successful to True or False depending on the outcome. Here is the text of the routine:
-attempt_transmission (message: STRING) is
+attempt_transmission (message: STRING)
-- Try to transmit message, at most 50 times.
-- Set successful accordingly.
local
diff --git a/documentation/current/method/invitation-eiffel-i2e/i2e-object-oriented-design.wiki b/documentation/current/method/invitation-eiffel-i2e/i2e-object-oriented-design.wiki
index 1a9edfa2..259ef648 100644
--- a/documentation/current/method/invitation-eiffel-i2e/i2e-object-oriented-design.wiki
+++ b/documentation/current/method/invitation-eiffel-i2e/i2e-object-oriented-design.wiki
@@ -8,6 +8,7 @@ An in-depth discussion of these principles fall beyond the scope of this introdu
{{info|Object-oriented design is the construction of software systems as structured collections of abstract data type implementations, or "classes". }}
+
The following points are worth noting in this definition:
* The emphasis is on structuring a system around the types of objects it manipulates (not the functions it performs on them) and on reusing whole data structures together with the associated operations (not isolated routines).
* Objects are described as instances of abstract data types -- that is to say, data structures known from an official interface rather than through their representation.
diff --git a/documentation/current/method/invitation-eiffel-i2e/i2e-types.wiki b/documentation/current/method/invitation-eiffel-i2e/i2e-types.wiki
index 6b3b9481..6edab91a 100644
--- a/documentation/current/method/invitation-eiffel-i2e/i2e-types.wiki
+++ b/documentation/current/method/invitation-eiffel-i2e/i2e-types.wiki
@@ -8,9 +8,13 @@ Any type T is based on a class, which defines the operations that
A non-expanded class such as ACCOUNT yields a reference type. As a result, an entity of type ACCOUNT , such as acc in the earlier client example (see the declaration of acc and the accompanying picture as given on page [[Invitation to Eiffel|6]] ), denotes possible run-time references to objects of type ACCOUNT .
-In contrast, the value of an entity acc declared of type expanded ACCOUNT is an object such as the one shown on the figure below, with no reference. The only difference with the earlier figure is that the value of acc is now an ACCOUNT object, not a reference to such an object. No creation instruction is needed in this case. (The figure does not show the PERSON object to which the owner field of the ACCOUNT object -- itself a reference -- is attached.)
- [[Image:invitation-3]]
-An important group of expanded types, based on library classes, includes the basic types CHARACTER, DOUBLE, REAL, INTEGER and BOOLEAN . Clearly, the value of an entity declared of type INTEGER should be an integer, not a reference to an object containing an integer value. Operations on these types are defined by prefix and infix operators such as "+" and "<".
+In contrast, the value of an entity acc declared of type expanded ACCOUNT is an object such as the one shown on the figure below, with no reference. The only difference with the earlier figure is that the value of acc is now an ACCOUNT object, not a reference to such an object. No creation instruction is needed in this case. (The figure does not show the PERSON object to which the owner field of the ACCOUNT object -- itself a reference -- is attached.)
+
+
+[[Image:invitation-3]]
+
+
+An important group of expanded types, based on library classes, includes the basic types CHARACTER, DOUBLE, REAL, INTEGER and BOOLEAN. Clearly, the value of an entity declared of type INTEGER should be an integer, not a reference to an object containing an integer value. Operations on these types are defined by prefix and infix operators such as "+" and "<".
As a result of these conventions, the type system is uniform and consistent: all types, including the basic types, are defined from classes, either as reference types or as expanded types.