• No results found

ECMA nd Edition / June Eiffel: Analysis, Design and Programming Language

N/A
N/A
Protected

Academic year: 2021

Share "ECMA nd Edition / June Eiffel: Analysis, Design and Programming Language"

Copied!
194
0
0

Loading.... (view fulltext now)

Full text

(1)

2nd Edition / June 2006

Eiffel:

Analysis, Design

and Programming Language

ECMA-367

(2)
(3)

Standard

ECMA-367

2nd Edition - June 2006

Eiffel:

Analysis, Design

(4)
(5)

Brief history

Eiffel was originally designed, as a method of software construction and a notation to support that method, in 1985. The first implementation, from Eiffel Software (then Interactive Software Engineering Inc.), was commercially released in 1986. The principal designer of the first versions of the language was Bertrand Meyer. Other people closely involved with the original definition included Jean-Marc Nerson. The language was originally described in Eiffel Software technical documents that were expanded to yield Meyer’s book Eiffel: The Language in 1990-1991. The two editions of Object-Oriented Software Construction (1988 and 1997) also served to describe the concepts. (For bibliographical references on the documents cited see 3.6.) As usage of Eiffel grew, other Eiffel implementations appeared, including Eiffel/S and Visual Eiffel from Object Tools, Germany, EiffelStudio and Eiffel Envision from Eiffel Software, and SmartEiffel from LORIA, France.

Eiffel today is used throughout the world for industrial applications in banking and finance, defense and aerospace, health care, networking and telecommunications, computer-aided design, game programming, and many other application areas. Eiffel is particularly suited for mission-critical developments in which programmer productivity and product quality are essential. In addition, Eiffel is a popular medium for teaching programming and software engineering in universities.

In 2002 Ecma International formed Technical Group 4 (Eiffel) of Technical Committee 39 (Programming and Scripting Languages), known as TC39-TG4. The Eiffel: Analysis, Design and Programming Language Standard provides a precise definition of the language and ensures interoperability between implementations. The first of these benefits is of particular interest to implementors of Eiffel compilers and environments, who can rely on it as the reference on which to base their work; the second, to Eiffel users, for whom the Standard delivers a guarantee of compatibility between the products of different providers and of trust in the future of Eiffel. The starting point for this Standard is material from the original and revised versions of the book Standard Eiffel (latest revision of Eiffel: The Language). The process of preparing the standard relied on automated tools to keep the corresponding elements identical in the Standard and the forthcoming revision of the book.

The First Edition was completed in April of 2005 and approved by the General Assembly of ECMA in June of 2005. As a result, authors of major Eiffel compilers and tools have committed to supporting the language as described in the Standard; compilers are quickly progressing towards full compliance.

The present Second Edition introduces no major change of substance but clarifies and corrects a number of points arising from the experience of using the First Edition and from the feedback of compiler writers and the user community. It was completed in April, 2006 and submitted both to ECMA and to the International Standards Organization (ISO), which has approved it as the ISO standard 25436. The text of this Second Edition is identical to the text of the ISO standard.

To produce this Standard, TC39-TG4 conducted: 18 face-to- face meetings (15 up to the First Edition), most of them over three full days; numerous phone meetings; and extensive technical correspondence (about 1500 email messages by June 2006).

The members of the committee have been: Karine Arnout (Axa Rosenberg, Orinda, previously ETH, Zurich); Éric Bezault (Axa Rosenberg, Orinda); Paul Cohen (Generic, Stockholm), Dominique Colnet (LORIA, Nancy); Mark Howard (Axa Rosenberg, Orinda); Alexander Kogtenkov (Eiffel Software, Moscow); Bertrand Meyer (Eiffel Software, Santa Barbara, and ETH, Zurich); Christine Mingins (Monash University, Melbourne); Roger Osmond (EMC, Boston); Emmanuel Stapf (Eiffel Software, Santa Barbara); Kim Waldén (Generic, Stockholm).

Observers having attended one or more of the meetings include Cyril Adrian (LORIA), Volkan Arslan (ETH), Paul Crismer (Groupe S, Brussels), Jocelyn Fiat (Eiffel Software, France), Randy John (Axa Rosenberg), Ian King (Eiffel Software), Andreas Leitner (ETH), Philippe Ribet (LORIA), Julian Rogers (Eiffel Software), Bernd Schoeller (ETH), David Schwartz (Axa Rosenberg), Zoran Simic (Axa Rosenberg), Raphael Simon (Eiffel Software), Olivier Zendra (LORIA). The committee acknowledges the contributions of many people including David Hollenberg, Marcel Satchell, Richard O’Keefe and numerous others listed in the acknowledgments of the book Standard Eiffel.

The editor of the standard is Bertrand Meyer. Emmanuel Stapf is the convener of TG4 (succeeding Christine Mingins, 2002-2003) and was its secretary in 2005. Karine Arnout has been its secretary at all other times. The final version of the First Edition was prepared by Éric Bezault, Mark Howard, Alexander Kogtenkov, Bertrand Meyer and Emmanuel Stapf, the final version of the Second Edition by Bertrand Meyer and Emmanuel Stapf. This Ecma Standard has been adopted by the General Assembly of June 2006.

(6)
(7)

Table of contents

Table of contents 1 S c o p e 1 1 . 1 O v e r v i e w 1 1 . 2 “ T h e Sta n d a r d ” 1 1 . 3 A s p e c ts c o v e r e d 1 1 . 4 A s p e c ts n o t c o v e r e d 1 2 C o n f o r m a n c e 2 2 . 1 D e f i n i t i o n 2 2 . 2 C o m pa t i b i l i t y a n d n o n - d e f a u l t o p t i o n s 2 2 . 3 D e pa r t u r e f r o m t h e Sta n d a r d 2 3 N o r m a t i v e r e f e r e n c e s 2 3 . 1 E a r l i e r E i ff e l l a n g u a g e s p e c i f i c a t i o n s 2 3 . 2 E i ff e l K e r n e l L i b r a r y 2 3 . 3 F l o a t i n g p o i n t n u m b e r r e p r e s e n ta t i o n 3 3 . 4 C h a r a c t e r s e t : U n i c o d e 3 3 . 5 C h a r a c t e r s e t : A S C I I 3 3 . 6 P h o n e t i c a l p h a b e t 3 4 D e f i n i t i o n s 3 5 N o ta t i o n a l c o n v e n t i o n s 3 5 . 1 Sta n d a r d e l e m e n ts 3 5 . 2 N o r m a t i v e e l e m e n ts 3 5 . 3 R u l e s o n d e f i n i t i o n s 4 5 . 4 U s e o f d e f i n e d t e r m s 4 5 . 5 U n f o l d e d f o r m s 5 5 . 6 L a n g u a g e d e s c r i p t i o n 5 5 . 7 Va l i d i t y : “ i f a n d o n l y i f ” r u l e s 5 6 A c r o n y m s a n d a b b r e v i a t i o n s 5 6 . 1 N a m e o f t h e l a n g u a g e 5 6 . 2 P r o n u n c i a t i o n 5 7 G e n e r a l d e s c r i p t i o n 5 7 . 1 D e s i g n p r i n c i p l e s 5 7 . 2 O b j e c t - o r i e n t e d d e s i g n 6 7 . 3 C l a s s e s 7 7 . 4 Ty p e s 10

(8)

7 . 5 A s s e r t i o n s 11 7 . 6 E x c e p t i o n s 14 7 . 7 G e n e r i c i t y 15 7 . 8 I n h e r i ta n c e 16 7 . 9 P o l y m o r p h i s m a n d d y n a m i c b i n d i n g 18 7 . 1 0 C o m b i n i n g g e n e r i c i t y a n d i n h e r i ta n c e 20 7 . 11 D e f e r r e d c l a s s e s 21 7 . 1 2 Tu p l e s a n d a g e n ts 22 7 . 1 3 Ty p e - a n d v o i d - s a f e t y 23 7 . 1 4 P u t t i n g a s y s t e m t o g e t h e r 24 8 L a n g u a g e s p e c i f i c a t i o n 24 8 . 1 G e n e r a l o r g a n i z a t i o n 24 8 . 2 S y n ta x , v a l i d i t y a n d s e m a n t i c s 25 8 . 2 . 1 D e f i n i t i o n : S y n t a x , B N F - E 25 8 . 2 . 2 D e f i n i t i o n : C o m p o n e n t , c o n s t r u c t , s p e c i m e n 25 8 . 2 . 3 C o n s t r u c t S p e c i m e n c o n v e n t i o n 25 8 . 2 . 4 C o n s t r u c t N a m e c o n v e n t i o n 25 8 . 2 . 5 D e f i n i t i o n : T e r m i n a l , n o n - t e r m i n a l , t o k e n 25 8 . 2 . 6 D e f i n i t i o n : P r o d u c t i o n 26 8 . 2 . 7 K i n d s o f p r o d u c t i o n 26 8 . 2 . 8 D e f i n i t i o n : A g g r e g a t e p r o d u c t i o n 26 8 . 2 . 9 D e f i n i t i o n : C h o i c e p r o d u c t i o n 26 8 . 2 . 1 0 D e f i n i t i o n : R e p e t i t i o n p r o d u c t i o n , s e p a r a t o r 26 8 . 2 . 1 1 B a s i c s y n t a x d e s c r i p t i o n r u l e 27 8 . 2 . 1 2 D e f i n i t i o n : N o n - p r o d u c t i o n s y n t a x r u l e 27 8 . 2 . 1 3 T e x t u a l c o n v e n t i o n s 27 8 . 2 . 1 4 D e f i n i t i o n : V a l i d i t y c o n s t r a i n t 28 8 . 2 . 1 5 D e f i n i t i o n : V a l i d 28 8 . 2 . 1 6 V a l i d i t y : G e n e r a l V a l i d i t y r u l e 28 8 . 2 . 1 7 D e f i n i t i o n : S e m a n t i c s 28 8 . 2 . 1 8 D e f i n i t i o n : E x e c u t i o n t e r m i n o l o g y 28 8 . 2 . 1 9 S e m a n t i c s : C a s e I n s e n s i t i v i t y p r i n c i p l e 29 8 . 2 . 2 0 D e f i n i t i o n : U p p e r n a m e , l o w e r n a m e 29 8 . 2 . 2 1 S y n t a x ( n o n - p r o d u c t i o n ) : S e m i c o l o n O p t i o n a l i t y r u l e 29 8 . 3 T h e a r c h i t e c t u r e o f E i ff e l s o ft w a r e 30 8 . 3 . 1 D e f i n i t i o n : C l u s t e r , s u b c l u s t e r , c o n t a i n s d i r e c t l y , c o n t a i n s 30 8 . 3 . 2 D e f i n i t i o n : T e r m i n a l c l u s t e r , i n t e r n a l c l u s t e r 30 8 . 3 . 3 D e f i n i t i o n : U n i v e r s e 31 8 . 3 . 4 S y n t a x : C l a s s n a m e s 31 8 . 3 . 5 V a l i d i t y : C l a s s N a m e r u l e 31 8 . 3 . 6 S e m a n t i c s : C l a s s n a m e s e m a n t i c s 31 8 . 3 . 7 D e f i n i t i o n : S y s t e m , r o o t t y p e n a m e , r o o t p r o c e d u r e n a m e 31 8 . 3 . 8 D e f i n i t i o n : T y p e d e p e n d e n c y 31 8 . 3 . 9 V a l i d i t y : R o o t T y p e r u l e 32

(9)

8 . 3 . 1 0 V a l i d i t y : R o o t P r o c e d u r e r u l e 32 8 . 3 . 1 1 D e f i n i t i o n : R o o t t y p e , r o o t p r o c e d u r e , r o o t c l a s s 33 8 . 3 . 1 2 S e m a n t i c s : S y s t e m e x e c u t i o n 33 8 . 4 C l a s s e s 33 8 . 4 . 1 D e f i n i t i o n : C u r r e n t c l a s s 33 8 . 4 . 2 S y n t a x : C l a s s d e c l a r a t i o n s 33 8 . 4 . 3 S y n t a x : N o t e s 33 8 . 4 . 4 S e m a n t i c s : N o t e s s e m a n t i c s 34 8 . 4 . 5 S y n t a x : C l a s s h e a d e r s 34 8 . 4 . 6 V a l i d i t y : C l a s s H e a d e r r u l e 34 8 . 4 . 7 D e f i n i t i o n : E x p a n d e d , f r o z e n , d e f e r r e d , e f f e c t i v e c l a s s 34 8 . 4 . 8 S y n t a x : O b s o l e t e m a r k s 35 8 . 4 . 9 S e m a n t i c s : O b s o l e t e s e m a n t i c s 35 8 . 5 F e a t u r e s 35 8 . 5 . 1 D e f i n i t i o n : I n h e r i t e d , i m m e d i a t e ; o r i g i n ; r e d e c l a r a t i o n ; i n t r o d u c e 35 8 . 5 . 2 S y n t a x : F e a t u r e p a r t s 36 8 . 5 . 3 F e a t u r e c a t e g o r i e s : o v e r v i e w 36 8 . 5 . 4 S y n t a x : F e a t u r e d e c l a r a t i o n s 36 8 . 5 . 5 S y n t a x : N e w f e a t u r e l i s t s 37 8 . 5 . 6 S y n t a x : F e a t u r e b o d i e s 37 8 . 5 . 7 V a l i d i t y : F e a t u r e B o d y r u l e 37 8 . 5 . 8 D e f i n i t i o n : V a r i a b l e a t t r i b u t e 38 8 . 5 . 9 D e f i n i t i o n : C o n s t a n t a t t r i b u t e 38 8 . 5 . 1 0 D e f i n i t i o n : R o u t i n e , f u n c t i o n , p r o c e d u r e 38 8 . 5 . 1 1 D e f i n i t i o n : C o m m a n d , q u e r y 38 8 . 5 . 1 2 D e f i n i t i o n : S i g n a t u r e , a r g u m e n t s i g n a t u r e o f a f e a t u r e 38 8 . 5 . 1 3 F e a t u r e p r i n c i p l e 39 8 . 5 . 1 4 S y n t a x : F e a t u r e n a m e s 39 8 . 5 . 1 5 S y n t a x ( n o n - p r o d u c t i o n ) : A l i a s S y n t a x r u l e 39 8 . 5 . 1 6 D e f i n i t i o n : O p e r a t o r f e a t u r e , b r a c k e t f e a t u r e , i d e n t i f i e r - o n l y 40 8 . 5 . 1 7 D e f i n i t i o n : I d e n t i f i e r o f a f e a t u r e n a m e 40 8 . 5 . 1 8 V a l i d i t y : F e a t u r e I d e n t i f i e r p r i n c i p l e 40 8 . 5 . 1 9 D e f i n i t i o n : S a m e f e a t u r e n a m e , s a m e o p e r a t o r , s a m e a l i a s 40 8 . 5 . 2 0 S y n t a x : O p e r a t o r s 41 8 . 5 . 2 1 S y n t a x : A s s i g n e r m a r k s 41 8 . 5 . 2 2 V a l i d i t y : A s s i g n e r C o m m a n d r u l e 41 8 . 5 . 2 3 D e f i n i t i o n : S y n o n y m 42 8 . 5 . 2 4 D e f i n i t i o n : U n f o l d e d f o r m o f a p o s s i b l y m u l t i p l e d e c l a r a t i o n 42 8 . 5 . 2 5 V a l i d i t y : F e a t u r e D e c l a r a t i o n r u l e 43 8 . 5 . 2 6 V a l i d i t y : A l i a s V a l i d i t y r u l e 43 8 . 6 T h e i n h e r i ta n c e r e l a t i o n 44 8 . 6 . 1 S y n t a x : I n h e r i t a n c e p a r t s 44 8 . 6 . 2 S y n t a x ( n o n - p r o d u c t i o n ) : F e a t u r e a d a p t a t i o n r u l e 45 8 . 6 . 3 D e f i n i t i o n : P a r e n t p a r t f o r a t y p e , f o r a c l a s s 45 8 . 6 . 4 V a l i d i t y : C l a s s ANY r u l e 45

(10)

8 . 6 . 5 V a l i d i t y : U n i v e r s a l C o n f o r m a n c e p r i n c i p l e 45 8 . 6 . 6 D e f i n i t i o n : U n f o l d e d i n h e r i t a n c e p a r t o f a c l a s s 45 8 . 6 . 7 D e f i n i t i o n : M u l t i p l e , s i n g l e i n h e r i t a n c e 46 8 . 6 . 8 D e f i n i t i o n : I n h e r i t , h e i r , p a r e n t 46 8 . 6 . 9 D e f i n i t i o n : C o n f o r m i n g , n o n - c o n f o r m i n g p a r e n t 46 8 . 6 . 1 0 D e f i n i t i o n : A n c e s t o r t y p e s o f a t y p e , o f a c l a s s 46 8 . 6 . 1 1 D e f i n i t i o n : A n c e s t o r , d e s c e n d a n t 46 8 . 6 . 1 2 D e f i n i t i o n : P r o p e r a n c e s t o r , p r o p e r d e s c e n d a n t 47 8 . 6 . 1 3 V a l i d i t y : P a r e n t r u l e 47 8 . 6 . 1 4 S y n t a x : R e n a m e c l a u s e s 47 8 . 6 . 1 5 V a l i d i t y : R e n a m e C l a u s e r u l e 48 8 . 6 . 1 6 S e m a n t i c s : R e n a m i n g p r i n c i p l e 48 8 . 6 . 1 7 D e f i n i t i o n : F i n a l n a m e , e x t e n d e d f i n a l n a m e , f i n a l n a m e s e t 48 8 . 6 . 1 8 D e f i n i t i o n : I n h e r i t e d n a m e 49 8 . 6 . 1 9 D e f i n i t i o n : D e c l a r a t i o n f o r a f e a t u r e 49 8 . 7 C l i e n ts a n d e x p o r ts 49 8 . 7 . 1 D e f i n i t i o n : C l i e n t r e l a t i o n b e t w e e n c l a s s e s a n d t y p e s 49 8 . 7 . 2 D e f i n i t i o n : C l i e n t r e l a t i o n b e t w e e n c l a s s e s 49 8 . 7 . 3 D e f i n i t i o n : S u p p l i e r 50 8 . 7 . 4 D e f i n i t i o n : S i m p l e c l i e n t 50 8 . 7 . 5 D e f i n i t i o n : E x p a n d e d c l i e n t 50 8 . 7 . 6 D e f i n i t i o n : G e n e r i c c l i e n t , g e n e r i c s u p p l i e r 50 8 . 7 . 7 D e f i n i t i o n : I n d i r e c t c l i e n t 50 8 . 7 . 8 D e f i n i t i o n : C l i e n t s e t o f a Clients p a r t 50 8 . 7 . 9 S y n t a x : C l i e n t s 51 8 . 7 . 1 0 S y n t a x : E x p o r t a d a p t a t i o n 51 8 . 7 . 1 1 V a l i d i t y : E x p o r t L i s t r u l e 51 8 . 7 . 1 2 D e f i n i t i o n : C l i e n t s e t o f a f e a t u r e 52 8 . 7 . 1 3 D e f i n i t i o n : A v a i l a b l e f o r c a l l , a v a i l a b l e 52 8 . 7 . 1 4 D e f i n i t i o n : E x p o r t e d , s e l e c t i v e l y a v a i l a b l e , s e c r e t 52 8 . 7 . 1 5 D e f i n i t i o n : S e c r e t , p u b l i c p r o p e r t y 53 8 . 7 . 1 6 D e f i n i t i o n : I n c r e m e n t a l c o n t r a c t v i e w , s h o r t f o r m 53 8 . 7 . 1 7 D e f i n i t i o n : C o n t r a c t v i e w , f l a t - s h o r t f o r m 54 8 . 8 R o u t i n e s 54 8 . 8 . 1 D e f i n i t i o n : F o r m a l a r g u m e n t , a c t u a l a r g u m e n t 54 8 . 8 . 2 S y n t a x : F o r m a l a r g u m e n t a n d e n t i t y d e c l a r a t i o n s 55 8 . 8 . 3 V a l i d i t y : F o r m a l A r g u m e n t r u l e 55 8 . 8 . 4 V a l i d i t y : E n t i t y D e c l a r a t i o n r u l e 55 8 . 8 . 5 S y n t a x : R o u t i n e b o d i e s 55 8 . 8 . 6 D e f i n i t i o n : O n c e r o u t i n e , o n c e p r o c e d u r e , o n c e f u n c t i o n 55 8 . 8 . 7 S y n t a x : L o c a l v a r i a b l e d e c l a r a t i o n s 55 8 . 8 . 8 V a l i d i t y : L o c a l V a r i a b l e r u l e 56 8 . 8 . 9 D e f i n i t i o n : L o c a l v a r i a b l e 56 8 . 8 . 1 0 S y n t a x : I n s t r u c t i o n s 56 8 . 9 C o r r e c t n e s s a n d c o n t r a c ts 57 8 . 9 . 1 S y n t a x : A s s e r t i o n s 57

(11)

8 . 9 . 2 S y n t a x ( n o n - p r o d u c t i o n ) : A s s e r t i o n S y n t a x r u l e 57 8 . 9 . 3 D e f i n i t i o n : P r e c o n d i t i o n , p o s t c o n d i t i o n , i n v a r i a n t 57 8 . 9 . 4 D e f i n i t i o n : C o n t r a c t , s u b c o n t r a c t 58 8 . 9 . 5 V a l i d i t y : P r e c o n d i t i o n E x p o r t r u l e 58 8 . 9 . 6 D e f i n i t i o n : A v a i l a b i l i t y o f a n a s s e r t i o n c l a u s e 58 8 . 9 . 7 S y n t a x : “ O l d ” p o s t c o n d i t i o n e x p r e s s i o n s 58 8 . 9 . 8 V a l i d i t y : O l d E x p r e s s i o n r u l e 59 8 . 9 . 9 S e m a n t i c s : O l d E x p r e s s i o n S e m a n t i c s , a s s o c i a t e d v a r i a b l e , a s s o c i a t e d e x c e p t i o n m a r k e r 59 8 . 9 . 1 0 S e m a n t i c s : A s s o c i a t e d V a r i a b l e S e m a n t i c s 60 8 . 9 . 1 1 S y n t a x : “ O n l y ” p o s t c o n d i t i o n c l a u s e s 60 8 . 9 . 1 2 V a l i d i t y : O n l y C l a u s e r u l e 60 8 . 9 . 1 3 D e f i n i t i o n : U n f o l d e d f e a t u r e l i s t o f a n Only c l a u s e 60 8 . 9 . 1 4 D e f i n i t i o n : U n f o l d e d Only c l a u s e 61 8 . 9 . 1 5 D e f i n i t i o n : H o a r e t r i p l e n o t a t i o n ( t o t a l c o r r e c t n e s s ) 61 8 . 9 . 1 6 S e m a n t i c s : C l a s s c o n s i s t e n c y 61 8 . 9 . 1 7 S y n t a x : C h e c k i n s t r u c t i o n s 62 8 . 9 . 1 8 D e f i n i t i o n : C h e c k - c o r r e c t 62 8 . 9 . 1 9 S y n t a x : V a r i a n t s 62 8 . 9 . 2 0 V a l i d i t y : V a r i a n t E x p r e s s i o n r u l e 62 8 . 9 . 2 1 D e f i n i t i o n : L o o p i n v a r i a n t a n d v a r i a n t 62 8 . 9 . 2 2 D e f i n i t i o n : L o o p - c o r r e c t 62 8 . 9 . 2 3 D e f i n i t i o n : C o r r e c t n e s s ( c l a s s ) 62 8 . 9 . 2 4 D e f i n i t i o n : L o c a l u n f o l d e d f o r m o f a n a s s e r t i o n 62 8 . 9 . 2 5 S e m a n t i c s : E v a l u a t i o n o f a n a s s e r t i o n 63 8 . 9 . 2 6 S e m a n t i c s : A s s e r t i o n m o n i t o r i n g 63 8 . 9 . 2 7 S e m a n t i c s : A s s e r t i o n v i o l a t i o n 63 8 . 9 . 2 8 S e m a n t i c s : A s s e r t i o n s e m a n t i c s 64 8 . 9 . 2 9 S e m a n t i c s : A s s e r t i o n m o n i t o r i n g l e v e l s 64 8 . 1 0 F e a t u r e a d a p ta t i o n 64 8 . 1 0 . 1 D e f i n i t i o n : R e d e c l a r e , r e d e c l a r a t i o n 64 8 . 1 0 . 2 D e f i n i t i o n : U n f o l d e d f o r m o f a n a s s e r t i o n 65 8 . 1 0 . 3 D e f i n i t i o n : A s s e r t i o n e x t e n s i o n s 65 8 . 1 0 . 4 D e f i n i t i o n : C o v a r i a n c e - a w a r e f o r m o f a n i n h e r i t e d a s s e r t i o n 65 8 . 1 0 . 5 D e f i n i t i o n : C o m b i n e d p r e c o n d i t i o n , p o s t c o n d i t i o n 66 8 . 1 0 . 6 D e f i n i t i o n : I n h e r i t e d a s e f f e c t i v e , i n h e r i t e d a s d e f e r r e d 66 8 . 1 0 . 7 D e f i n i t i o n : E f f e c t , e f f e c t i n g 66 8 . 1 0 . 8 D e f i n i t i o n : R e d e f i n e , r e d e f i n i t i o n 66 8 . 1 0 . 9 D e f i n i t i o n : N a m e c l a s h 67 8 . 1 0 . 1 0 S y n t a x : P r e c u r s o r 67 8 . 1 0 . 1 1 D e f i n i t i o n : R e l a t i v e u n f o l d e d f o r m o f a Precursor 67 8 . 1 0 . 1 2 V a l i d i t y : P r e c u r s o r r u l e 67 8 . 1 0 . 1 3 D e f i n i t i o n : U n f o l d e d f o r m o f a Precursor 68 8 . 1 0 . 1 4 S e m a n t i c s : P r e c u r s o r s e m a n t i c s 68 8 . 1 0 . 1 5 S y n t a x : R e d e f i n i t i o n 68 8 . 1 0 . 1 6 V a l i d i t y : R e d e f i n e S u b c l a u s e r u l e 68

(12)

8 . 1 0 . 1 7 S e m a n t i c s : R e d e f i n i t i o n s e m a n t i c s 68 8 . 1 0 . 1 8 S y n t a x : U n d e f i n e c l a u s e s 68 8 . 1 0 . 1 9 V a l i d i t y : U n d e f i n e S u b c l a u s e r u l e 68 8 . 1 0 . 2 0 S e m a n t i c s : U n d e f i n i t i o n s e m a n t i c s 69 8 . 1 0 . 2 1 D e f i n i t i o n : E f f e c t i v e , d e f e r r e d f e a t u r e 69 8 . 1 0 . 2 2 D e f i n i t i o n : E f f e c t i n g 69 8 . 1 0 . 2 3 D e f e r r e d C l a s s p r o p e r t y 69 8 . 1 0 . 2 4 E f f e c t i v e C l a s s p r o p e r t y 69 8 . 1 0 . 2 5 D e f i n i t i o n : O r i g i n , s e e d 69 8 . 1 0 . 2 6 V a l i d i t y : R e d e c l a r a t i o n r u l e 70 8 . 1 0 . 2 7 D e f i n i t i o n : P r e c u r s o r ( j o i n e d f e a t u r e s ) 71 8 . 1 0 . 2 8 V a l i d i t y : J o i n r u l e 71 8 . 1 0 . 2 9 S e m a n t i c s : J o i n S e m a n t i c s r u l e 72 8 . 11 Ty p e s 72 8 . 1 1 . 1 S y n t a x : T y p e s 72 8 . 1 1 . 2 S e m a n t i c s : D i r e c t i n s t a n c e s a n d v a l u e s o f a t y p e 73 8 . 1 1 . 3 S e m a n t i c s : I n s t a n c e s o f a t y p e 73 8 . 1 1 . 4 S e m a n t i c s : I n s t a n c e p r i n c i p l e 73 8 . 1 1 . 5 D e f i n i t i o n : I n s t a n c e s , d i r e c t i n s t a n c e s o f a c l a s s 73 8 . 1 1 . 6 B a s e p r i n c i p l e ; b a s e c l a s s , b a s e t y p e , b a s e d 73 8 . 1 1 . 7 B a s e r u l e 74 8 . 1 1 . 8 V a l i d i t y : C l a s s T y p e r u l e 74 8 . 1 1 . 9 S e m a n t i c s : T y p e S e m a n t i c s r u l e 74 8 . 1 1 . 1 0 D e f i n i t i o n : B a s e c l a s s a n d b a s e t y p e o f a n e x p r e s s i o n 74 8 . 1 1 . 1 1 S e m a n t i c s : N o n - g e n e r i c c l a s s t y p e s e m a n t i c s 74 8 . 1 1 . 1 2 D e f i n i t i o n : E x p a n d e d t y p e , r e f e r e n c e t y p e 74 8 . 1 1 . 1 3 D e f i n i t i o n : B a s i c t y p e 75 8 . 1 1 . 1 4 D e f i n i t i o n : A n c h o r , a n c h o r e d t y p e , a n c h o r e d e n t i t y 75 8 . 1 1 . 1 5 D e f i n i t i o n : A n c h o r s e t ; c y c l i c a n c h o r 75 8 . 1 1 . 1 6 D e f i n i t i o n : T y p e s a n d c l a s s e s i n v o l v e d i n a t y p e 76 8 . 1 1 . 1 7 D e f i n i t i o n : D e a n c h o r e d f o r m o f a t y p e 76 8 . 1 1 . 1 8 V a l i d i t y : A n c h o r e d T y p e r u l e 76 8 . 1 1 . 1 9 D e f i n i t i o n : A t t a c h e d , d e t a c h a b l e 77 8 . 1 1 . 2 0 S e m a n t i c s : A t t a c h e d t y p e s e m a n t i c s 77 8 . 1 1 . 2 1 D e f i n i t i o n : S t a n d - a l o n e t y p e 77 8 . 1 2 G e n e r i c i t y 78 8 . 1 2 . 1 S y n t a x : A c t u a l g e n e r i c p a r a m e t e r s 78 8 . 1 2 . 2 S y n t a x : F o r m a l g e n e r i c p a r a m e t e r s 78 8 . 1 2 . 3 V a l i d i t y : F o r m a l G e n e r i c r u l e 78 8 . 1 2 . 4 D e f i n i t i o n : G e n e r i c c l a s s ; c o n s t r a i n e d , u n c o n s t r a i n e d 79 8 . 1 2 . 5 D e f i n i t i o n : G e n e r i c d e r i v a t i o n , g e n e r i c t y p e , n o n - g e n e r i c t y p e 79 8 . 1 2 . 6 D e f i n i t i o n : S e l f - i n i t i a l i z i n g f o r m a l p a r a m e t e r 79 8 . 1 2 . 7 D e f i n i t i o n : C o n s t r a i n t , c o n s t r a i n i n g t y p e s o f a Formal_generic 79 8 . 1 2 . 8 S y n t a x : G e n e r i c c o n s t r a i n t s 79 8 . 1 2 . 9 V a l i d i t y : G e n e r i c C o n s t r a i n t r u l e 80

(13)

8 . 1 2 . 1 0 D e f i n i t i o n : C o n s t r a i n i n g c r e a t i o n f e a t u r e s 80 8 . 1 2 . 1 1 V a l i d i t y : G e n e r i c D e r i v a t i o n r u l e 80 8 . 1 2 . 1 2 D e f i n i t i o n : G e n e r i c - c r e a t i o n - r e a d y t y p e 81 8 . 1 2 . 1 3 S e m a n t i c s : G e n e r i c a l l y d e r i v e d c l a s s t y p e s e m a n t i c s 81 8 . 1 2 . 1 4 D e f i n i t i o n : B a s e t y p e o f a s i n g l e - c o n s t r a i n e d f o r m a l g e n e r i c 82 8 . 1 2 . 1 5 D e f i n i t i o n : B a s e t y p e o f a n u n c o n s t r a i n e d f o r m a l g e n e r i c 82 8 . 1 2 . 1 6 D e f i n i t i o n : R e f e r e n c e o r e x p a n d e d s t a t u s o f a f o r m a l g e n e r i c 82 8 . 1 2 . 1 7 D e f i n i t i o n : C u r r e n t t y p e 82 8 . 1 2 . 1 8 D e f i n i t i o n : F e a t u r e s o f a t y p e 82 8 . 1 2 . 1 9 D e f i n i t i o n : G e n e r i c s u b s t i t u t i o n 82 8 . 1 2 . 2 0 G e n e r i c T y p e A d a p t a t i o n r u l e 82 8 . 1 2 . 2 1 D e f i n i t i o n : G e n e r i c a l l y c o n s t r a i n e d f e a t u r e n a m e 83 8 . 1 2 . 2 2 V a l i d i t y : M u l t i p l e C o n s t r a i n t s r u l e 83 8 . 1 2 . 2 3 D e f i n i t i o n : B a s e t y p e o f a m u l t i - c o n s t r a i n t f o r m a l g e n e r i c t y p e 83 8 . 1 3 Tu p l e s 83 8 . 1 3 . 1 S y n t a x : T u p l e t y p e s 83 8 . 1 3 . 2 S y n t a x : M a n i f e s t t u p l e s 84 8 . 1 3 . 3 D e f i n i t i o n : T y p e s e q u e n c e o f a t u p l e t y p e 84 8 . 1 3 . 4 D e f i n i t i o n : V a l u e s e q u e n c e s a s s o c i a t e d w i t h a t u p l e t y p e 84 8 . 1 4 C o n f o r m a n c e 84 8 . 1 4 . 1 D e f i n i t i o n : C o m p a t i b i l i t y b e t w e e n t y p e s 85 8 . 1 4 . 2 D e f i n i t i o n : C o m p a t i b i l i t y b e t w e e n e x p r e s s i o n s 85 8 . 1 4 . 3 D e f i n i t i o n : E x p r e s s i o n c o n f o r m a n c e 85 8 . 1 4 . 4 V a l i d i t y : S i g n a t u r e c o n f o r m a n c e 85 8 . 1 4 . 5 D e f i n i t i o n : C o v a r i a n t a r g u m e n t 85 8 . 1 4 . 6 V a l i d i t y : G e n e r a l c o n f o r m a n c e 86 8 . 1 4 . 7 D e f i n i t i o n : C o n f o r m a n c e p a t h 87 8 . 1 4 . 8 V a l i d i t y : D i r e c t c o n f o r m a n c e : r e f e r e n c e t y p e s 87 8 . 1 4 . 9 V a l i d i t y : D i r e c t c o n f o r m a n c e : f o r m a l g e n e r i c 87 8 . 1 4 . 1 0 V a l i d i t y : D i r e c t c o n f o r m a n c e : e x p a n d e d t y p e s 87 8 . 1 4 . 1 1 V a l i d i t y : D i r e c t c o n f o r m a n c e : t u p l e t y p e s 87 8 . 1 5 C o n v e r t i b i l i t y 88 8 . 1 5 . 1 D e f i n i t i o n : C o n v e r s i o n p r o c e d u r e , c o n v e r s i o n t y p e 88 8 . 1 5 . 2 D e f i n i t i o n : C o n v e r s i o n q u e r y , c o n v e r s i o n f e a t u r e 88 8 . 1 5 . 3 V a l i d i t y : C o n v e r s i o n p r i n c i p l e 88 8 . 1 5 . 4 V a l i d i t y : C o n v e r s i o n A s y m m e t r y p r i n c i p l e 88 8 . 1 5 . 5 V a l i d i t y : C o n v e r s i o n N o n - T r a n s i t i v i t y p r i n c i p l e 88 8 . 1 5 . 6 S y n t a x : C o n v e r t e r c l a u s e s 88 8 . 1 5 . 7 V a l i d i t y : C o n v e r s i o n P r o c e d u r e r u l e 88 8 . 1 5 . 8 V a l i d i t y : C o n v e r s i o n Q u e r y r u l e 89 8 . 1 5 . 9 D e f i n i t i o n : C o n v e r t i n g t o a c l a s s 89 8 . 1 5 . 1 0 D e f i n i t i o n : C o n v e r t i n g t o a n d f r o m a t y p e 89 8 . 1 5 . 1 1 D e f i n i t i o n : C o n v e r t i n g “ t h r o u g h ” 90 8 . 1 5 . 1 2 S e m a n t i c s : C o n v e r s i o n s e m a n t i c s 90

(14)

8 . 1 5 . 1 3 D e f i n i t i o n : E x p l i c i t c o n v e r s i o n 90 8 . 1 5 . 1 4 V a l i d i t y : E x p r e s s i o n c o n v e r t i b i l i t y 91 8 . 1 5 . 1 5 D e f i n i t i o n : S t a t i c a l l y s a t i s f i e d p r e c o n d i t i o n 91 8 . 1 5 . 1 6 V a l i d i t y : P r e c o n d i t i o n - f r e e r o u t i n e 91 8 . 1 6 R e p e a t e d i n h e r i ta n c e 92 8 . 1 6 . 1 D e f i n i t i o n : R e p e a t e d i n h e r i t a n c e , a n c e s t o r , d e s c e n d a n t 92 8 . 1 6 . 2 S e m a n t i c s : R e p e a t e d I n h e r i t a n c e r u l e 93 8 . 1 6 . 3 D e f i n i t i o n : S h a r i n g , r e p l i c a t i o n 93 8 . 1 6 . 4 V a l i d i t y : C a l l S h a r i n g r u l e 93 8 . 1 6 . 5 S e m a n t i c s : R e p l i c a t i o n S e m a n t i c s r u l e 93 8 . 1 6 . 6 S y n t a x : S e l e c t c l a u s e s 93 8 . 1 6 . 7 V a l i d i t y : S e l e c t S u b c l a u s e r u l e 94 8 . 1 6 . 8 D e f i n i t i o n : V e r s i o n 94 8 . 1 6 . 9 D e f i n i t i o n : M u l t i p l e v e r s i o n s 94 8 . 1 6 . 1 0 V a l i d i t y : R e p e a t e d I n h e r i t a n c e C o n s i s t e n c y c o n s t r a i n t 94 8 . 1 6 . 1 1 D e f i n i t i o n : D y n a m i c b i n d i n g v e r s i o n 94 8 . 1 6 . 1 2 D e f i n i t i o n : I n h e r i t e d f e a t u r e s 94 8 . 1 6 . 1 3 S e m a n t i c s : J o i n - S h a r i n g R e c o n c i l i a t i o n r u l e 95 8 . 1 6 . 1 4 D e f i n i t i o n : P r e c u r s o r 95 8 . 1 6 . 1 5 V a l i d i t y : F e a t u r e N a m e r u l e 95 8 . 1 6 . 1 6 V a l i d i t y : N a m e C l a s h r u l e 95 8 . 1 7 C o n t r o l s t r u c t u r e s 96 8 . 1 7 . 1 S e m a n t i c s : C o m p o u n d ( n o n - e x c e p t i o n ) s e m a n t i c s 96 8 . 1 7 . 2 S y n t a x : C o n d i t i o n a l s 96 8 . 1 7 . 3 D e f i n i t i o n : S e c o n d a r y p a r t 97 8 . 1 7 . 4 D e f i n i t i o n : P r e v a i l i n g i m m e d i a t e l y 97 8 . 1 7 . 5 S e m a n t i c s : C o n d i t i o n a l s e m a n t i c s 97 8 . 1 7 . 6 D e f i n i t i o n : I n s p e c t e x p r e s s i o n 97 8 . 1 7 . 7 S y n t a x : M u l t i - b r a n c h i n s t r u c t i o n s 97 8 . 1 7 . 8 D e f i n i t i o n : I n t e r v a l 97 8 . 1 7 . 9 D e f i n i t i o n : U n f o l d e d f o r m o f a m u l t i - b r a n c h 97 8 . 1 7 . 1 0 D e f i n i t i o n : U n f o l d e d f o r m o f a n i n t e r v a l 98 8 . 1 7 . 1 1 V a l i d i t y : I n t e r v a l r u l e 98 8 . 1 7 . 1 2 D e f i n i t i o n : I n s p e c t v a l u e s o f a m u l t i - b r a n c h 98 8 . 1 7 . 1 3 V a l i d i t y : M u l t i - b r a n c h r u l e 98 8 . 1 7 . 1 4 S e m a n t i c s : M a t c h i n g b r a n c h 99 8 . 1 7 . 1 5 S e m a n t i c s : M u l t i - B r a n c h s e m a n t i c s 99 8 . 1 7 . 1 6 S y n t a x : L o o p s 99 8 . 1 7 . 1 7 S e m a n t i c s : L o o p s e m a n t i c s 99 8 . 1 7 . 1 8 S y n t a x : D e b u g i n s t r u c t i o n s 100 8 . 1 7 . 1 9 S e m a n t i c s : D e b u g s e m a n t i c s 100 8 . 1 8 A t t r i b u t e s 100 8 . 1 8 . 1 S y n t a x : A t t r i b u t e b o d i e s 100 8 . 1 8 . 2 V a l i d i t y : M a n i f e s t C o n s t a n t r u l e 100 8 . 1 9 O b j e c ts , v a l u e s a n d e n t i t i e s 101 8 . 1 9 . 1 S e m a n t i c s : T y p e , g e n e r a t i n g t y p e o f a n o b j e c t ; g e n e r a t o r 101

(15)

8 . 1 9 . 2 D e f i n i t i o n : R e f e r e n c e , v o i d , a t t a c h e d , a t t a c h e d t o 101 8 . 1 9 . 3 S e m a n t i c s : O b j e c t p r i n c i p l e 101 8 . 1 9 . 4 D e f i n i t i o n : O b j e c t s e m a n t i c s 101 8 . 1 9 . 5 D e f i n i t i o n : N o n - b a s i c c l a s s , n o n - b a s i c t y p e , f i e l d 102 8 . 1 9 . 6 D e f i n i t i o n : S u b o b j e c t , c o m p o s i t e o b j e c t 102 8 . 1 9 . 7 D e f i n i t i o n : E n t i t y , v a r i a b l e , r e a d - o n l y 102 8 . 1 9 . 8 S y n t a x : E n t i t i e s a n d v a r i a b l e s 102 8 . 1 9 . 9 V a l i d i t y : E n t i t y r u l e 102 8 . 1 9 . 1 0 V a l i d i t y : V a r i a b l e r u l e 103 8 . 1 9 . 1 1 D e f i n i t i o n : S e l f - i n i t i a l i z i n g t y p e 103 8 . 1 9 . 1 2 S e m a n t i c s : D e f a u l t I n i t i a l i z a t i o n r u l e 104 8 . 1 9 . 1 3 D e f i n i t i o n : S e l f - i n i t i a l i z i n g v a r i a b l e 104 8 . 1 9 . 1 4 D e f i n i t i o n : E v a l u a t i o n p o s i t i o n , p r e c e d e s 104 8 . 1 9 . 1 5 D e f i n i t i o n : S e t t e r i n s t r u c t i o n 105 8 . 1 9 . 1 6 D e f i n i t i o n : P r o p e r l y s e t v a r i a b l e 105 8 . 1 9 . 1 7 V a l i d i t y : V a r i a b l e I n i t i a l i z a t i o n r u l e 105 8 . 1 9 . 1 8 D e f i n i t i o n : V a r i a b l e s e t t i n g a n d i t s v a l u e 106 8 . 1 9 . 1 9 D e f i n i t i o n : E x e c u t i o n c o n t e x t 106 8 . 1 9 . 2 0 S e m a n t i c s : V a r i a b l e S e m a n t i c s 106 8 . 1 9 . 2 1 S e m a n t i c s : E n t i t y S e m a n t i c s r u l e 107 8 . 2 0 C r e a t i n g o b j e c ts 107 8 . 2 0 . 1 S e m a n t i c s : C r e a t i o n p r i n c i p l e 107 8 . 2 0 . 2 D e f i n i t i o n : C r e a t i o n o p e r a t i o n 108 8 . 2 0 . 3 V a l i d i t y : C r e a t i o n P r e c o n d i t i o n r u l e 108 8 . 2 0 . 4 S y n t a x : C r e a t o r s p a r t s 108 8 . 2 0 . 5 D e f i n i t i o n : U n f o l d e d c r e a t o r s p a r t o f a c l a s s 108 8 . 2 0 . 6 V a l i d i t y : C r e a t i o n C l a u s e r u l e 109 8 . 2 0 . 7 D e f i n i t i o n : C r e a t i o n p r o c e d u r e s o f a c l a s s 109 8 . 2 0 . 8 C r e a t i o n p r o c e d u r e p r o p e r t y 109 8 . 2 0 . 9 D e f i n i t i o n : C r e a t i o n p r o c e d u r e s o f a t y p e 109 8 . 2 0 . 1 0 D e f i n i t i o n : A v a i l a b l e f o r c r e a t i o n ; g e n e r a l c r e a t i o n p r o c e d u r e 110 8 . 2 0 . 1 1 S y n t a x : C r e a t i o n i n s t r u c t i o n s 110 8 . 2 0 . 1 2 D e f i n i t i o n : C r e a t i o n t a r g e t , c r e a t i o n t y p e 110 8 . 2 0 . 1 3 S e m a n t i c s : C r e a t i o n T y p e t h e o r e m 110 8 . 2 0 . 1 4 D e f i n i t i o n : U n f o l d e d f o r m o f a c r e a t i o n i n s t r u c t i o n 110 8 . 2 0 . 1 5 V a l i d i t y : C r e a t i o n I n s t r u c t i o n r u l e 110 8 . 2 0 . 1 6 V a l i d i t y : C r e a t i o n I n s t r u c t i o n p r o p e r t i e s 111 8 . 2 0 . 1 7 S e m a n t i c s : C r e a t i o n I n s t r u c t i o n S e m a n t i c s 112 8 . 2 0 . 1 8 S y n t a x : C r e a t i o n e x p r e s s i o n s 112 8 . 2 0 . 1 9 D e f i n i t i o n : P r o p e r t i e s o f a c r e a t i o n e x p r e s s i o n 113 8 . 2 0 . 2 0 V a l i d i t y : C r e a t i o n E x p r e s s i o n r u l e 113 8 . 2 0 . 2 1 V a l i d i t y : C r e a t i o n E x p r e s s i o n P r o p e r t i e s 113 8 . 2 0 . 2 2 S e m a n t i c s : C r e a t i o n E x p r e s s i o n S e m a n t i c s 113 8 . 2 0 . 2 3 D e f i n i t i o n : G a r b a g e C o l l e c t i o n , n o t e n o u g h m e m o r y a v a i l a b l e 114

(16)

8 . 2 1 C o m pa r i n g a n d d u p l i c a t i n g o b j e c ts 114 8 . 2 1 . 1 O b j e c t c o m p a r i s o n f e a t u r e s f r o m ANY 114 8 . 2 1 . 2 S y n t a x : E q u a l i t y e x p r e s s i o n s 115 8 . 2 1 . 3 S e m a n t i c s : E q u a l i t y E x p r e s s i o n S e m a n t i c s 115 8 . 2 1 . 4 S e m a n t i c s : I n e q u a l i t y E x p r e s s i o n S e m a n t i c s 115 8 . 2 1 . 5 C o p y i n g a n d c l o n i n g f e a t u r e s f r o m ANY 115 8 . 2 1 . 6 D e e p e q u a l i t y , c o p y i n g a n d c l o n i n g 116 8 . 2 2 A t ta c h i n g v a l u e s t o e n t i t i e s 117 8 . 2 2 . 1 D e f i n i t i o n : R e a t t a c h m e n t , s o u r c e , t a r g e t 117 8 . 2 2 . 2 S y n t a x : A s s i g n m e n t s 117 8 . 2 2 . 3 V a l i d i t y : A s s i g n m e n t r u l e 117 8 . 2 2 . 4 S e m a n t i c s : R e a t t a c h m e n t p r i n c i p l e 117 8 . 2 2 . 5 S e m a n t i c s : A t t a c h i n g a n e n t i t y , a t t a c h e d e n t i t y 118 8 . 2 2 . 6 S e m a n t i c s : R e a t t a c h m e n t S e m a n t i c s 118 8 . 2 2 . 7 S e m a n t i c s : A s s i g n m e n t S e m a n t i c s 119 8 . 2 2 . 8 D e f i n i t i o n : D y n a m i c t y p e 119 8 . 2 2 . 9 D e f i n i t i o n : P o l y m o r p h i c e x p r e s s i o n ; d y n a m i c t y p e a n d c l a s s s e t s 119 8 . 2 2 . 1 0 S y n t a x : A s s i g n e r c a l l s 119 8 . 2 2 . 1 1 V a l i d i t y : A s s i g n e r C a l l r u l e 119 8 . 2 2 . 1 2 S e m a n t i c s : A s s i g n e r C a l l s e m a n t i c s 119 8 . 2 3 F e a t u r e c a l l 120 8 . 2 3 . 1 V a l i d i t y : C a l l U s e r u l e 120 8 . 2 3 . 2 S y n t a x : F e a t u r e c a l l s 120 8 . 2 3 . 3 S y n t a x : A c t u a l a r g u m e n t s 120 8 . 2 3 . 4 D e f i n i t i o n : U n q u a l i f i e d , q u a l i f i e d c a l l 120 8 . 2 3 . 5 D e f i n i t i o n : T a r g e t o f a c a l l 120 8 . 2 3 . 6 D e f i n i t i o n : T a r g e t t y p e o f a c a l l 121 8 . 2 3 . 7 D e f i n i t i o n : F e a t u r e o f a c a l l 121 8 . 2 3 . 8 D e f i n i t i o n : I m p o r t e d f o r m o f a Non_object_call 121 8 . 2 3 . 9 V a l i d i t y : N o n - O b j e c t C a l l r u l e 121 8 . 2 3 . 1 0 S e m a n t i c s : N o n - O b j e c t C a l l S e m a n t i c s 122 8 . 2 3 . 1 1 V a l i d i t y : E x p o r t r u l e 122 8 . 2 3 . 1 2 V a l i d i t y : E x p o r t S t a t u s p r i n c i p l e 122 8 . 2 3 . 1 3 V a l i d i t y : A r g u m e n t r u l e 122 8 . 2 3 . 1 4 V a l i d i t y : T a r g e t r u l e 123 8 . 2 3 . 1 5 V a l i d i t y : C l a s s - L e v e l C a l l r u l e 123 8 . 2 3 . 1 6 D e f i n i t i o n : V o i d - u n s a f e 123 8 . 2 3 . 1 7 D e f i n i t i o n : T a r g e t O b j e c t 123 8 . 2 3 . 1 8 S e m a n t i c s : F a i l e d t a r g e t e v a l u a t i o n o f a v o i d - u n s a f e s y s t e m 123 8 . 2 3 . 1 9 D e f i n i t i o n : D y n a m i c f e a t u r e o f a c a l l 124 8 . 2 3 . 2 0 D e f i n i t i o n : F r e s h n e s s o f a o n c e r o u t i n e c a l l 124 8 . 2 3 . 2 1 D e f i n i t i o n : L a t e s t a p p l i c a b l e t a r g e t a n d r e s u l t o f a n o n -f r e s h c a l l 124 8 . 2 3 . 2 2 S e m a n t i c s : O n c e R o u t i n e E x e c u t i o n S e m a n t i c s 124

(17)

8 . 2 3 . 2 3 S e m a n t i c s : C u r r e n t o b j e c t , c u r r e n t r o u t i n e 125 8 . 2 3 . 2 4 S e m a n t i c s : C u r r e n t S e m a n t i c s 125 8 . 2 3 . 2 5 S e m a n t i c s : N o n - O n c e R o u t i n e E x e c u t i o n S e m a n t i c s 125 8 . 2 3 . 2 6 S e m a n t i c s : G e n e r a l C a l l S e m a n t i c s 125 8 . 2 3 . 2 7 D e f i n i t i o n : T y p e o f a Call u s e d a s e x p r e s s i o n 126 8 . 2 3 . 2 8 S e m a n t i c s : C a l l R e s u l t 126 8 . 2 3 . 2 9 S e m a n t i c s : V a l u e o f a c a l l e x p r e s s i o n 126 8 . 2 4 E r a d i c a t i n g v o i d c a l l s 126 8 . 2 4 . 1 S y n t a x : O b j e c t t e s t 127 8 . 2 4 . 2 D e f i n i t i o n : O b j e c t - T e s t L o c a l 127 8 . 2 4 . 3 V a l i d i t y : O b j e c t T e s t r u l e 127 8 . 2 4 . 4 D e f i n i t i o n : C o n j u n c t i v e , d i s j u n c t i v e , i m p l i c a t i v e ; T e r m , s e m i s t r i c t t e r m 1 2 8 8 . 2 4 . 5 D e f i n i t i o n : S c o p e o f a n O b j e c t - T e s t L o c a l 128 8 . 2 4 . 6 S e m a n t i c s : O b j e c t T e s t s e m a n t i c s 128 8 . 2 4 . 7 S e m a n t i c s : O b j e c t - T e s t L o c a l s e m a n t i c s 128 8 . 2 4 . 8 D e f i n i t i o n : R e a d - o n l y v o i d t e s t 128 8 . 2 4 . 9 D e f i n i t i o n : S c o p e o f a r e a d - o n l y v o i d t e s t 128 8 . 2 4 . 1 0 D e f i n i t i o n : C e r t i f i e d A t t a c h m e n t P a t t e r n 129 8 . 2 4 . 1 1 D e f i n i t i o n : A t t a c h e d e x p r e s s i o n 129 8 . 2 5 Ty p i n g - r e l a t e d p r o p e r t i e s 130 8 . 2 5 . 1 D e f i n i t i o n : C a t c a l l 130 8 . 2 5 . 2 V a l i d i t y : D e s c e n d a n t A r g u m e n t r u l e 130 8 . 2 5 . 3 V a l i d i t y : S i n g l e - l e v e l C a l l r u l e 130 8 . 2 6 E x c e p t i o n h a n d l i n g 130 8 . 2 6 . 1 D e f i n i t i o n : F a i l u r e , e x c e p t i o n , t r i g g e r 130 8 . 2 6 . 2 S y n t a x : R e s c u e c l a u s e s 131 8 . 2 6 . 3 V a l i d i t y : R e s c u e c l a u s e r u l e 131 8 . 2 6 . 4 V a l i d i t y : R e t r y r u l e 131 8 . 2 6 . 5 D e f i n i t i o n : E x c e p t i o n - c o r r e c t 131 8 . 2 6 . 6 S e m a n t i c s : D e f a u l t R e s c u e O r i g i n a l S e m a n t i c s 131 8 . 2 6 . 7 D e f i n i t i o n : R e s c u e b l o c k 132 8 . 2 6 . 8 S e m a n t i c s : E x c e p t i o n S e m a n t i c s 132 8 . 2 6 . 9 D e f i n i t i o n : T y p e o f a n e x c e p t i o n 133 8 . 2 6 . 1 0 S e m a n t i c s : E x c e p t i o n C a s e s 133 8 . 2 6 . 1 1 S e m a n t i c s : E x c e p t i o n P r o p e r t i e s 133 8 . 2 6 . 1 2 D e f i n i t i o n : I g n o r i n g , c o n t i n u i n g a n e x c e p t i o n 134 8 . 2 7 A g e n ts 134 8 . 2 7 . 1 D e f i n i t i o n : O p e r a n d s o f a c a l l 134 8 . 2 7 . 2 D e f i n i t i o n : O p e r a n d p o s i t i o n 134 8 . 2 7 . 3 D e f i n i t i o n : C o n s t r u c t i o n t i m e , c a l l t i m e 134 8 . 2 7 . 4 S y n t a c t i c a l f o r m s f o r a c a l l a g e n t 135 8 . 2 7 . 5 S y n t a x : A g e n t s 135 8 . 2 7 . 6 S y n t a x : C a l l a g e n t b o d i e s 135 8 . 2 7 . 7 D e f i n i t i o n : T a r g e t t y p e o f a c a l l a g e n t 135 8 . 2 7 . 8 V a l i d i t y : C a l l A g e n t r u l e 135

(18)

8 . 2 7 . 9 D e f i n i t i o n : A s s o c i a t e d f e a t u r e o f a n i n l i n e a g e n t 135 8 . 2 7 . 1 0 V a l i d i t y : I n l i n e A g e n t r u l e 136 8 . 2 7 . 1 1 V a l i d i t y : I n l i n e A g e n t R e q u i r e m e n t s 136 8 . 2 7 . 1 2 D e f i n i t i o n : C a l l - a g e n t e q u i v a l e n t o f a n i n l i n e a g e n t 136 8 . 2 7 . 1 3 S e m a n t i c s : S e m a n t i c s o f a n i n l i n e a g e n t 136 8 . 2 7 . 1 4 S e m a n t i c s : U s e o f Result i n a n i n l i n e f u n c t i o n a g e n t 136 8 . 2 7 . 1 5 D e f i n i t i o n : O p e n a n d c l o s e d o p e r a n d s 136 8 . 2 7 . 1 6 D e f i n i t i o n : O p e n a n d c l o s e d o p e r a n 136 8 . 2 7 . 1 7 D e f i n i t i o n : T y p e o f a n a g e n t e x p r e s s i o n 137 8 . 2 7 . 1 8 S e m a n t i c s : A g e n t E x p r e s s i o n s e m a n t i c s 137 8 . 2 7 . 1 9 S e m a n t i c s : E f f e c t o f e x e c u t i n g call o n a n a g e n t 137 8 . 2 8 E x p r e s s i o n s 137 8 . 2 8 . 1 S y n t a x : E x p r e s s i o n s 137 8 . 2 8 . 2 D e f i n i t i o n : S u b e x p r e s s i o n , o p e r a n d 138 8 . 2 8 . 3 S e m a n t i c s : P a r e n t h e s i z e d E x p r e s s i o n S e m a n t i c s 138 8 . 2 8 . 4 S y n t a x : O p e r a t o r e x p r e s s i o n s 138 8 . 2 8 . 5 O p e r a t o r p r e c e d e n c e l e v e l s 138 8 . 2 8 . 6 D e f i n i t i o n : P a r e n t h e s i z e d F o r m o f a n e x p r e s s i o n 139 8 . 2 8 . 7 D e f i n i t i o n : T a r g e t - c o n v e r t e d f o r m o f a b i n a r y e x p r e s s i o n 139 8 . 2 8 . 8 V a l i d i t y : O p e r a t o r E x p r e s s i o n r u l e 139 8 . 2 8 . 9 S e m a n t i c s : E x p r e s s i o n S e m a n t i c s ( s t r i c t c a s e ) 139 8 . 2 8 . 1 0 D e f i n i t i o n : S e m i s t r i c t o p e r a t o r s 140 8 . 2 8 . 1 1 S e m a n t i c s : O p e r a t o r E x p r e s s i o n S e m a n t i c s ( s e m i s t r i c t c a s e ) 140 8 . 2 8 . 1 2 S y n t a x : B r a c k e t e x p r e s s i o n s 140 8 . 2 8 . 1 3 V a l i d i t y : B r a c k e t E x p r e s s i o n r u l e 141 8 . 2 8 . 1 4 D e f i n i t i o n : E q u i v a l e n t D o t F o r m o f a n e x p r e s s i o n 141 8 . 2 8 . 1 5 V a l i d i t y : B o o l e a n E x p r e s s i o n r u l e 141 8 . 2 8 . 1 6 V a l i d i t y : I d e n t i f i e r r u l e 141 8 . 2 8 . 1 7 D e f i n i t i o n : T y p e o f a n e x p r e s s i o n 141 8 . 2 9 C o n s ta n ts 142 8 . 2 9 . 1 S y n t a x : C o n s t a n t s 142 8 . 2 9 . 2 V a l i d i t y : C o n s t a n t A t t r i b u t e r u l e 142 8 . 2 9 . 3 S y n t a x : M a n i f e s t c o n s t a n t s 142 8 . 2 9 . 4 S y n t a x ( n o n - p r o d u c t i o n ) : S i g n S y n t a x r u l e 143 8 . 2 9 . 5 S y n t a x ( n o n - p r o d u c t i o n ) : C h a r a c t e r S y n t a x r u l e 143 8 . 2 9 . 6 D e f i n i t i o n : T y p e o f a m a n i f e s t c o n s t a n t 143 8 . 2 9 . 7 V a l i d i t y : M a n i f e s t - T y p e Q u a l i f i e r r u l e 143 8 . 2 9 . 8 S e m a n t i c s : M a n i f e s t C o n s t a n t S e m a n t i c s 144 8 . 2 9 . 9 D e f i n i t i o n : M a n i f e s t v a l u e o f a c o n s t a n t 144 8 . 2 9 . 1 0 S y n t a x : M a n i f e s t s t r i n g s 144 8 . 2 9 . 1 1 S y n t a x ( n o n - p r o d u c t i o n ) : L i n e s e q u e n c e 145 8 . 2 9 . 1 2 S y n t a x ( n o n - p r o d u c t i o n ) : M a n i f e s t S t r i n g r u l e 145 8 . 2 9 . 1 3 D e f i n i t i o n : Line_wrapping_part 145 8 . 2 9 . 1 4 S e m a n t i c s : M a n i f e s t s t r i n g s e m a n t i c s 146 8 . 2 9 . 1 5 V a l i d i t y : V e r b a t i m S t r i n g r u l e 146

(19)

8 . 2 9 . 1 6 S e m a n t i c s : V e r b a t i m s t r i n g s e m a n t i c s 146 8 . 2 9 . 1 7 D e f i n i t i o n : P r e f i x , l o n g e s t b r e a k p r e f i x , l e f t - a l i g n e d f o r m 146 8 . 3 0 B a s i c t y p e s 146 8 . 3 0 . 1 D e f i n i t i o n : B a s i c t y p e s a n d t h e i r s i z e d v a r i a n t s 147 8 . 3 0 . 2 D e f i n i t i o n : S i z e d v a r i a n t s o f STRING 147 8 . 3 0 . 3 S e m a n t i c s : B o o l e a n v a l u e s e m a n t i c s 147 8 . 3 0 . 4 S e m a n t i c s : C h a r a c t e r t y p e s 147 8 . 3 0 . 5 S e m a n t i c s : I n t e g e r t y p e s 147 8 . 3 0 . 6 S e m a n t i c s : F l o a t i n g - p o i n t t y p e s 147 8 . 3 0 . 7 S e m a n t i c s : A d d r e s s s e m a n t i c s 147 8 . 3 1 I n t e r f a c i n g w i t h C , C + + a n d o t h e r e n v i r o n m e n ts 148 8 . 3 1 . 1 S y n t a x : E x t e r n a l r o u t i n e s 148 8 . 3 1 . 2 S e m a n t i c s : A d d r e s s s e m a n t i c s 149 8 . 3 1 . 3 S y n t a x : R e g i s t e r e d l a n g u a g e s 149 8 . 3 1 . 4 S y n t a x : E x t e r n a l s i g n a t u r e s 149 8 . 3 1 . 5 V a l i d i t y : E x t e r n a l S i g n a t u r e r u l e 149 8 . 3 1 . 6 S e m a n t i c s : E x t e r n a l s i g n a t u r e s e m a n t i c s 149 8 . 3 1 . 7 S y n t a x : E x t e r n a l f i l e u s e 150 8 . 3 1 . 8 V a l i d i t y : E x t e r n a l F i l e r u l e 150 8 . 3 1 . 9 S e m a n t i c s : E x t e r n a l f i l e s e m a n t i c s 150 8 . 3 1 . 1 0 S y n t a x : C e x t e r n a l s 150 8 . 3 1 . 1 1 V a l i d i t y : C E x t e r n a l r u l e 151 8 . 3 1 . 1 2 S e m a n t i c s : C I n l i n e s e m a n t i c s 151 8 . 3 1 . 1 3 S y n t a x : C + + e x t e r n a l s 151 8 . 3 1 . 1 4 V a l i d i t y : C + + E x t e r n a l r u l e 152 8 . 3 1 . 1 5 S e m a n t i c s : C + + I n l i n e s e m a n t i c s 152 8 . 3 1 . 1 6 S y n t a x : D L L e x t e r n a l s 152 8 . 3 1 . 1 7 V a l i d i t y : E x t e r n a l D L L r u l e 152 8 . 3 1 . 1 8 S e m a n t i c s : E x t e r n a l D L L s e m a n t i c s 153 8 . 3 2 L e x i c a l c o m p o n e n ts 153 8 . 3 2 . 1 S y n t a x ( n o n - p r o d u c t i o n ) : C h a r a c t e r , c h a r a c t e r s e t 153 8 . 3 2 . 2 D e f i n i t i o n : L e t t e r , a l p h a _ b e t i c , n u m e r i c , a l p h a _ n u m e r i c , p r i n t a b l e 153 8 . 3 2 . 3 D e f i n i t i o n : B r e a k c h a r a c t e r , b r e a k 154 8 . 3 2 . 4 S e m a n t i c s : B r e a k s e m a n t i c s 154 8 . 3 2 . 5 D e f i n i t i o n : E x p e c t e d , f r e e c o m m e n t 154 8 . 3 2 . 6 S y n t a x ( n o n - p r o d u c t i o n ) : “ B l a n k s o r t a b s ” , n e w l i n e 154 8 . 3 2 . 7 S y n t a x : C o m m e n t s 154 8 . 3 2 . 8 S y n t a x ( n o n - p r o d u c t i o n ) : F r e e C o m m e n t r u l e 154 8 . 3 2 . 9 S e m a n t i c s : H e a d e r C o m m e n t r u l e 155 8 . 3 2 . 1 0 D e f i n i t i o n : S y m b o l , w o r d 155 8 . 3 2 . 1 1 S y n t a x ( n o n - p r o d u c t i o n ) : B r e a k r u l e 155 8 . 3 2 . 1 2 S e m a n t i c s : L e t t e r C a s e r u l e 155 8 . 3 2 . 1 3 D e f i n i t i o n : R e s e r v e d w o r d , k e y w o r d 155 8 . 3 2 . 1 4 S y n t a x ( n o n - p r o d u c t i o n ) : D o u b l e R e s e r v e d W o r d r u l e 156 8 . 3 2 . 1 5 D e f i n i t i o n : S p e c i a l s y m b o l 156

(20)

8 . 3 2 . 1 6 S y n t a x ( n o n - p r o d u c t i o n ) : I d e n t i f i e r 156 8 . 3 2 . 1 7 V a l i d i t y : I d e n t i f i e r r u l e 156 8 . 3 2 . 1 8 D e f i n i t i o n : P r e d e f i n e d o p e r a t o r 156 8 . 3 2 . 1 9 D e f i n i t i o n : S t a n d a r d o p e r a t o r 156 8 . 3 2 . 2 0 D e f i n i t i o n : O p e r a t o r s y m b o l 157 8 . 3 2 . 2 1 D e f i n i t i o n : F r e e o p e r a t o r 157 8 . 3 2 . 2 2 S y n t a x ( n o n - p r o d u c t i o n ) : M a n i f e s t c h a r a c t e r 158 8 . 3 2 . 2 3 S p e c i a l c h a r a c t e r s a n d t h e i r c o d e s 158 8 . 3 2 . 2 4 S y n t a x ( n o n - p r o d u c t i o n ) : P e r c e n t v a r i a n t s 159 8 . 3 2 . 2 5 S e m a n t i c s : M a n i f e s t c h a r a c t e r s e m a n t i c s 159 8 . 3 2 . 2 6 S y n t a x ( n o n - p r o d u c t i o n ) : S t r i n g , s i m p l e s t r i n g 159 8 . 3 2 . 2 7 S e m a n t i c s : S t r i n g s e m a n t i c s 159 8 . 3 2 . 2 8 S y n t a x : I n t e g e r s 159 8 . 3 2 . 2 9 V a l i d i t y : I n t e g e r r u l e 160 8 . 3 2 . 3 0 S e m a n t i c s : I n t e g e r s e m a n t i c s 160 8 . 3 2 . 3 1 S y n t a x ( n o n - p r o d u c t i o n ) : R e a l n u m b e r 160 8 . 3 2 . 3 2 S e m a n t i c s : R e a l s e m a n t i c s 161 I n d e x 163

(21)

1

Scope

1.1

Overview

This document provides the full reference for the Eiffel language.

Eiffel is a method of software construction and a language applicable to the analysis, design, implementation and maintenance of software systems. This Standard covers only the language, with an emphasis on the implementation aspects. As a consequence, the word “Eiffel” in the rest of this document is an abbreviation for “the Eiffel language”.

1.2

“The Standard”

The language definition proper — “the Standard” — is contained in Partition 8 of this document, with the exception of text appearing between markers Informative text and End; such text only plays an explanatory role for human readers.

1.3

Aspects covered

The Standard specifies:

The form of legal basic constituents of Eiffel texts, or lexical properties of the language.The structure of legal Eiffel texts made of lexically legal constituents, or syntax properties.Supplementary restrictions imposed on syntactically legal Eiffel texts, or validity properties.The computational effect of executing valid Eiffel texts, or semantic properties.

• Some requirements on a conforming implementation of Eiffel, such as the ability to produce certain forms of automatic documentation.

1.4

Aspects not covered

The Standard does not specify:

• The requirements that a computing environment must meet to support the translation, execution and other handling of Eiffel texts.

• The semantic properties of an Eiffel text if it or its data exceed the capacity of a particular computing environment.

• The mechanisms for translating Eiffel texts into a form that can be executed in a computing environment.

• The mechanisms for starting the execution of the result of such a translation.

• Other mechanisms for handling Eiffel texts and interacting with users of the language.

The specification of Partition 8 consists of precise specification elements, originating with the book Standard Eiffel where these elements are accompanied by extensive explanations and examples. The elements retained are:

• Definitions of technical terms and Eiffel concepts. • Syntax specifications.

• Validity constraints (with their codes, such as VVBG). • Semantic specifications.

(22)

2

Conformance

2.1

Definition

An implementation of the Eiffel language is conformant if and only if in its default operating mode, when provided with a candidate software text, it:

• Can, if the text and all its elements satisfy the lexical, syntax and validity rules of the Standard, execute the software according to the semantic rules of the Standard, or generate code for a computing environment such that, according to the specification of that environment, the generated code represents the semantics of the text according to these rules.

• Will, if any element of the text violates any lexical, syntactical or validity rule of the Standard, report an error and perform no semantic processing (such as generating executable code, or directly attempting to execute the software).

2.2

Compatibility and non-default options

Implementations may provide options that depart in minor ways from the rules of this Standard, for example to provide compatibility with earlier versions of the implementation or of the language itself. Such options are permitted if and only if:

• Per 2.1, they are not the default.

• The implementation includes documentation that states that all such options are nonconformant.

2.3

Departure from the Standard

Material reasons, such as bugs or lack of time, may lead to the release of an implementation that supports most of the Standard but misses a few rules and hence is not yet conformant according to the definition of 2.1. In such a case the implementation shall include documentation that:

• States that the implementation is not conformant. • Lists all the known causes of non-conformance.

• Provides an estimate of the date or version number for reaching full conformance.

3

Normative references

3.1

Earlier Eiffel language specifications

Bertrand Meyer: Eiffel: The Language, Prentice Hall, second printing, 1992 (first printing: 1991).

Bertrand Meyer: Standard Eiffel (revision of preceding entry), ongoing, 1997-present, at http://www.inf.ethz.ch/~meyer/ongoing/etl.

Bertrand Meyer: Object-Oriented Software Construction, Prentice Hall: first edition, 1988; second edition, 1997.

3.2

Eiffel Kernel Library

The terms “ELKS” and “Kernel Library”, as used in this Standard, refer to the latest version of the Eiffel Library Kernel Standard. A preliminary version is available from the NICE consortium:

NICE consortium: The Eiffel Library Kernel Standard, 2001 Vintage. The Standard assumes that ELKS includes at least the following classes:

• Classes representing fundamental language-related concepts: ANY, DISPOSABLE, NONE,

(23)

• Classes representing basic types and strings: BOOLEAN, CHARACTER, CHARACTER_8,

CHARACTER_32, INTEGER, INTEGER_8, INTEGER_16, INTEGER_32, INTEGER_64,

NATURAL, NATURAL_8, NATURAL_16, NATURAL_32, NATURAL_64, POINTER, REAL,

REAL_32, REAL_64, STRING, STRING_8, STRING_32.

• Classes representing fundamental data structures: ARRAY, TUPLE.

• Agent-related classes: FUNCTION, PREDICATE, PROCEDURE, ROUTINE.

• Exception-related classes: ASSERTION_VIOLATION, ATTACHED_TARGET_VIOLATION,

EXCEPTION, INSPECT_RANGE_VIOLATION, INVARIANT_ENTRY_VIOLATION,

INVARIANT_EXIT_VIOLATION, MEMORY_ALLOCATION_FAILURE, OLD_VIOLATION,

POSTCONDITION_VIOLATION, PRECONDITION_VIOLATION, ROUTINE_FAILURE.

The clauses referring to these classes list the features they need.

3.3

Floating point number representation

IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems (previously designated IEC 559:1989). Also known as ANSI/IEEE Standard 754-1985, IEEE Standard for Binary Floating-Point Arithmetic.

3.4

Character set: Unicode

The Unicode Consortium: The Unicode Standard, Version 4.1, at http://www.unicode.org/ versions/Unicode4.1.0/.

3.5

Character set: ASCII

ISO 14962:1997: Space data and information transfer systems.

3.6

Phonetic alphabet

International Phonetic Association: International Phonetic Alphabet (revised 1993, updated 1996).

4

Definitions

All the Eiffel-specific terms used in the Standard are defined in paragraphs labeled “Definition”.

5

Notational conventions

5.1

Standard elements

Every clause of the Standard belongs to one of the following categories:

Syntax: rule affecting the structure of Eiffel texts, including lexical properties as well as syntax

proper. The conventions for describing syntax appear below. • Validity: restrictions on syntactically legal texts.

Semantics: properties of the execution of valid texts.

Definition: introduction of a term defining a certain concept, which may relate to syntax,

validity or semantic properties; the rest of the Standard may use the term as an abbreviation for the concept.

Principle: a general language design rule, or a property of the software text resulting from

other properties covered by definition and syntax, validity and semantic rules.

The clauses of the Standard are labeled with the corresponding category. A clause with no label shall be considered as “Definition”.

5.2

Normative elements

The rules of syntax, validity and semantics constitute the necessary and sufficient conditions for an implementation to be conformant.

(24)

The entries labeled principle, addressing validity in most cases and semantics in a few others, express properties that follow from the official rules. For example the Feature Identifier principle (8.5.18) states

“ Given a class C and an identifier f, C contains at most one feature of identifier f.” This property (expressing that there must be no overloading of feature identifiers within a class) follows from a variety of validity rules.

Such principles are conceptually redundant and do not add any constraint on an implementation; They provide an interesting angle on the language definition, both for:

• Programmers, by capturing a general property in a concise way.

• Implementers, who when reporting a rule violation in a candidate Eiffel text may choose to refer to the principle rather than the (possibly less immediately clear) rules that underlie it.

5.3

Rules on definitions

In a definition, the first occurrence of each term being defined appears in bold.

Some definitions are recursive, meaning that the definition of a certain property of certain language elements distinguishes between two or more cases, and in some (but not all) of these cases uses the same property applied to smaller language elements. (The definition then makes sense as all cases eventually reduce to basic, non-recursive cases.) For clarity, the recursive branches are always marked by the word “recursively”” in parentheses.

In the text of the Standard, uses of a defined term may appear before the definition. The underlining convention described next helps avoid any confusion in such cases.

5.4

Use of defined terms

In any formal element of the language specification (definition, syntax, validity, semantics), appearance of a word as underlined means that this is a technical term introduced in one of the definitions of the Standard. For example, condition 1 in the Name Clash rule (8.16.16) reads:

“It is invalid for C to introduce two different features with the same name.”

The underlining indicates that words like “introduce” are not used in their plain English sense but as Eiffel-related concepts defined precisely elsewhere in the Standard. Indeed, 8.5.1 defines the notion that a class “introduces” a feature. Similarly, the notion of features having the “same name” is precisely defined (8.5.19) as meaning that their identifiers, excluding any Operator aliases, are identical except possibly for letter case.

This use of underlining is subject to the following restrictions:

• Underlining applies only to the first occurrence of such a defined term in a particular definition or rule.

• If a single clause defines a group of terms, occurrences of one of these terms in the definition of another are not underlined.

• As a consequence, uses of a term in its own definition are not underlined (they do bear, as noted, the mark “recursively”).

• In addition, a number of basic concepts, used throughout, are generally not underlined; they include:

Assertion Attribute Call Character Class

Cluster Entity Expression Feature Identifier

(25)

5.5

Unfolded forms

The definition of Eiffel in the Standard frequently relies on unfolded forms defining certain advanced constructs in terms of simpler ones. For example an “anchored type” of the form

like a has a “deanchored form”, which is just the type of a. Validity and semantic rules can then rely on the unfolded form rather than the original.

This technique, applied to about twenty constructs of the language, makes the description significantly simpler by identifying a basic set of constructs for which it provides direct validity and semantic specifications, and defining the rest of the language in terms of this core.

5.6

Language description

The Standard follows precise rules and conventions for language description, described in 8.2.

5.7

Validity: “if and only if” rules

A distinctive property of the language description is that the validity constraints, for example type rules, do not just, as in many language descriptions, list properties that a software text must satisfy to be valid. They give the rules in an “if and only if” style. For example (8.8.3, Formal Argument rule):

“Let fa be the Formal_arguments part of a routine r in a class C. Let formals be the concatenation of every Identifier_list of every Entity_declaration_group in fa. Then fa is valid if and only if no Identifiere appearing in formals is the final name of a feature of C.”

This does not just impose requirements on programmers, but tells them that if they satisfy these requirements they are entitled to having the construct (here a “Formal_arguments part”) accepted by an Eiffel language processing tool, for example a compiler. The rules, then, are not only necessary but sufficient. This contributes (except of course for the presence of any error or omission in the Standard) to the completeness of the language definition, and reinforces the programmers’ trust in the language.

6

Acronyms and abbreviations

6.1

Name of the language

The word “Eiffel” is not an acronym. It is written with a capital initial E, followed by letters in lower case.

6.2

Pronunciation

Verbally, with reference to the International Phonetic Alphabet, the name is pronounced: • In English: with the stress on the first syllable.

• In French: with the stress on the second syllable.

• In other languages: the closest approximation to the English or French variant as desired.

7

General description

The following is an informal introduction to the Eiffel language. It is informative only.

7.1

Design principles

The aim of Eiffel is to help specify, design, implement and modify quality software. This goal of quality in software is a combination of many factors; the language design concentrated on the three factors which, in the current state of the industry, are in direst need of improvements: reusability, extendibility and reliability. Also important were other factors such as efficiency, openness and portability.

(26)

Reusability is the ability to produce components that may be used in many different applications.

Central to the Eiffel approach is the presence of widely used libraries complementing the language, and the language’s support for the production of new libraries.

Extendibility is the ability to produce easily modifiable software. “Soft” as software is supposed

to be, it is notoriously hard to modify software systems, especially large ones.

Among quality factors, reusability and extendibility play a special role: satisfying them means having less software to write — and hence more time to devote to other important goals such as efficiency, ease of use or integrity.

The third fundamental factor is reliability, the ability to produce software that is correct and robust — that is to say, bug-free. Eiffel techniques such as static typing, assertions, disciplined exception handling and automatic garbage collection are essential here.

Four other factors are also part of Eiffel’s principal goals:

The language enables implementors to produce high efficiency compilers, so that systems developed with Eiffel may run under speed and space conditions similar to those of programs written in lower-level languages traditionally focused on efficient implementation.

Ensuring openness, so that Eiffel software may cooperate with programs written in other languages.

Guaranteeing portability by a platform-independent language definition, so that the same semantics may be supported on many different platforms.

High-precision language definition, allowing independent implementers to provide

compilers and other tools, and providing Eiffel users the guarantee that their software will work on all the Standard-compliant implementations. The language definition does not favor or refer to any particular implementation.

7.2

Object-oriented design

To achieve reusability, extendibility and reliability, the principles of object-oriented design provide the best known technical answer.

An in-depth discussion of these principles falls beyond the scope of this introduction but here is a short definition:

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.

• The basic modular unit, called the class, describes one implementation of an abstract data type (or, in the case of “deferred” classes, as studied below, a set of possible implementations of the same abstract data type).

The word collection reflects how classes should be designed: as units interesting and useful on their own, independently of the systems to which they belong, and ready to be reused by many different systems. Software construction is viewed as the assembly of existing classes, not as a top-down process starting from scratch.

Finally, the word structured reflects the existence of two important relations between classes: the client and inheritance relations.

Eiffel makes these techniques available to software developers in a simple and practical way.

(27)

As a language, Eiffel includes more than presented in this introduction, but not much more; it is a small language, not much bigger (by such a measure as the number of keywords) than Pascal. The description as given in the Standard text — excluding “informative text” and retaining only the rules — takes up about 80 pages. Eiffel was indeed meant to be a member of the class of languages which programmers can master entirely — as opposed to languages of which most programmers know only a subset. Yet it is appropriate for the development of industrial software systems, as has by now been shown by many full-scale projects, some in the thousands of classes and millions of lines, in companies around the world, for mission-critical systems in many different areas from finance to health care and aerospace.

7.3

Classes

A class, it was said above, is an implementation of an abstract data type. This means that it describes a set of run-time objects, characterized by the features (operations) applicable to them, and by the formal properties of these features.

Such objects are called the direct instances of the class. Classes and objects should not be confused: “class” is a compile-time notion, whereas objects only exist at run time. This is similar to the difference that exists in pre-object-oriented programming between a program and one execution of that program, or between a type and a run-time value of that type.

(“Object-Oriented” is a misnomer; “Class-Oriented Analysis, Design and Programming” would be a more accurate description of the method. )

To see what a class looks like, let us look at a simple example, ACCOUNT, which describes bank accounts. But before exploring the class itself it is useful to study how it may be used by other classes, called its clients.

A class X may become a client of ACCOUNT by declaring one or more entities of type

ACCOUNT. Such a declaration is of the form:

An entity such as acc that programs can directly modify is called a variable. An entity declared of a reference type, such as acc, may at any time during execution become “attached to” an object (see figure 1); the type rules imply that this object must be a direct instance of ACCOUNT — or, as seen later, of a “descendant” of that class.

An entity is said to be void if it is not attached to any object. As seen below, the type system achieves strict control over void entities, for run-time safety. To obtain objects at run-time, a routine r appearing in the client class X may use a creation instruction of the form acc: ACCOUNT create acc acc balance owner A direct instance of PERSON A direct instance of ACCOUNT

References

Related documents

Категорія підприємств Склад звітності Індивідуальна фінансова звітність: - звіт про фінансовий стан (ф. №4); - примітки до річної фінансової звітності; - додаток до

Este é constituído de 36 itens que avaliam a saúde geral do indivíduo, fornecendo pontuação nas dimensões da qualidade de vida: capacidade funcional,

Pasitaiko atvejų, kai mokesčių inspekcija išsiunčia čekį tiesiogiai Jums į namų adresą arba perveda į užsienio šalyje turėtą sąskaitą.. Tokiu atveju turite susisiekti

The former is a variety used by English mother-tongue speakers, whereas the latter refers to the English spoken by second-language speakers whose mother tongue is one of the

Keywords: Battery energy storage system, Isolated asynchronous generator, Voltage and frequency controller, Integrated electronic load

(b) in the directors’ opinion, the attached financial statements and notes thereto are in accordance with the Corporations Act 2001, including compliance with accounting standards

While the point of SSS is to allow individuals to assess their own status, it is likely that our sample (and probably the population) has a somewhat unbalanced opinion of status,

In extrapolation approach II, the dust emissions of the sectors not surveyed were estimated on the basis of the mean volume flows determined for each company size category from