From 7020d63f699f26ffd76d8cf7878571caabcb7ab5 Mon Sep 17 00:00:00 2001 From: halw Date: Thu, 23 Oct 2008 14:51:56 +0000 Subject: [PATCH] Author:halw Date:2008-10-23T14:51:56.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@95 abb3cda0-5349-4a8f-a601-0c33ac3a8c38 --- .../eiffel-tutorial-et/et-genericity-and-arrays.wiki | 2 +- .../et-lexical-conventions-and-style-rules.wiki | 3 +++ .../method/eiffel-tutorial-et/et-other-mechanisms.wiki | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/documentation/current/method/eiffel-tutorial-et/et-genericity-and-arrays.wiki b/documentation/current/method/eiffel-tutorial-et/et-genericity-and-arrays.wiki index 7ee6b327..a53492bc 100644 --- a/documentation/current/method/eiffel-tutorial-et/et-genericity-and-arrays.wiki +++ b/documentation/current/method/eiffel-tutorial-et/et-genericity-and-arrays.wiki @@ -27,7 +27,7 @@ Within the class text, feature declarations can freely use G even t ... -The operations available on an entity such as first and val, whose type is a formal generic parameter, are the operations available on all types: use as source y of an assignment x := y, use as target x of such an assignment (although not for val, which as a formal routine argument is not writable), use in equality comparisons x = y or x /= y, and application of universal features from ANY such as clone, equal and copy. +The operations available on an entity such as first and val, whose type is a formal generic parameter, are the operations available on all types: use as source y of an assignment x := y, use as target x of such an assignment (although not for val, which as a formal routine argument is not writable), use in equality comparisons x = y or x /= y, and application of universal features from ANY such as twin, is_equal and copy. To use a generic class such as list, a client will provide a type name as '''actual generic parameter'''. So instead of relying on a special purpose class DEPOSIT_LIST, the class ACCOUNT could include the declaration all_deposits: LIST [DEPOSIT] diff --git a/documentation/current/method/eiffel-tutorial-et/et-lexical-conventions-and-style-rules.wiki b/documentation/current/method/eiffel-tutorial-et/et-lexical-conventions-and-style-rules.wiki index 976d827b..dd1f52e9 100644 --- a/documentation/current/method/eiffel-tutorial-et/et-lexical-conventions-and-style-rules.wiki +++ b/documentation/current/method/eiffel-tutorial-et/et-lexical-conventions-and-style-rules.wiki @@ -7,6 +7,8 @@ Eiffel software texts are free-format: distribution into lines is not semantical Successive declarations or instructions may be separated by semicolons. Eiffel's syntax has been so designed, however, that (except in rare cases) '''the semicolon is optional'''. Omitting semicolons for elements appearing on separate lines lightens text and is the recommended practice since semicolons, as used by most programming languages, just obscure the text by distracting attention from the actual contents. Do use semicolons if you occasionally include successive elements on a single line. 56 names -- all unabbreviated single English words, except for elseif which is made of two words -- are reserved, meaning that you cannot use them to declare new entities. Here is the list: + + {| border="1" |- | agent @@ -74,6 +76,7 @@ Successive declarations or instructions may be separated by semicolons. Eiffel's | undefine |} + Since this tutorial has covered all the essential mechanisms, you may ignore the keywords not encountered; they are reserved for future use. Most of the reserved words are keywords, serving only as syntactic markers, and written in boldface in typeset texts such as the present one: class, feature, inherit. The others, such as Current, directly carry a semantic denotation; they start with an upper-case letter and are typeset in boldface. diff --git a/documentation/current/method/eiffel-tutorial-et/et-other-mechanisms.wiki b/documentation/current/method/eiffel-tutorial-et/et-other-mechanisms.wiki index 9bddd156..7ad82e4f 100644 --- a/documentation/current/method/eiffel-tutorial-et/et-other-mechanisms.wiki +++ b/documentation/current/method/eiffel-tutorial-et/et-other-mechanisms.wiki @@ -38,7 +38,7 @@ The attributes studied earlier were variable: each represents a field present in It is also possible to declare constant attributes, as in - Solar_system_planet_count: INTEGER = 9 + Solar_system_planet_count: INTEGER = 9 These will have the same value for every instance and hence do not need to occupy any space in objects at execution time. (In other approaches similar needs would be addressed by symbolic constants, as in Pascal or Ada, or macros, as in C.) @@ -47,12 +47,12 @@ What comes after the = is a manifest constant: a self-denoting valu Manifest constants are also available for strings, using double quotes as in - User_friendly_error_message: STRING is "Go get a life !" + User_friendly_error_message: STRING = "Go get a life !" with special characters again using the % codes. It is also possible to declare manifest arrays using double angle brackets: - <<1, 2, 3, 5, 7, 11, 13, 17, 19>> + <<1, 2, 3, 5, 7, 11, 13, 17, 19>> which is an expression of type ARRAY [INTEGER]. Manifest arrays and strings are not atomic, but denote instances of the Kernel Library classes STRING and ARRAY, as can be produced by once functions. @@ -87,7 +87,7 @@ A multi-branch instruction has the form end -where the else ''inst0'' part is optional, exp is a character or integer expression, ''v1'', ''v1'', ... are constant values of the same type as exp, all different, and ''inst0'', ''inst1'', ''inst2'', ... are sequences of zero or more instructions. In the integer case, it is often convenient to use unique values ( [[10 Other Mechanisms|"Constant and unique attributes", page 83]] ) for the ''vi''. +where the else ''inst0'' part is optional, exp is a character or integer expression, ''v1'', ''v1'', ... are constant values of the same type as exp, all different, and ''inst0'', ''inst1'', ''inst2'', ... are sequences of zero or more instructions. The effect of such a multi-branch instruction, if the value of exp is one of the ''vi'', is to execute the corresponding ''insti''. If none of the ''vi'' matches, the instruction executes ''inst0'', unless there is no else part, in which case it triggers an exception. @@ -188,7 +188,7 @@ The design flexibility afforded by the obsolete keyword is critical ==Creation variants== -The basic forms of creation instruction, and the one most commonly used, are the two illustrated earlier ( [[6 The Dynamic Structure: Execution Model|"Creating and initializing objects", page 20]] ): +The basic forms of creation instruction, and the one most commonly used, are the two illustrated earlier ( [[6 The Dynamic Structure: Execution Model#Creating_and_initializing_objects|"Creating and initializing objects"]] ): create x.make (2000) create x