Author:halw

Date:2008-10-15T22:26:20.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@83 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
halw
2008-10-15 22:41:53 +00:00
parent a7cbdda131
commit 3e5e123581
3 changed files with 133 additions and 95 deletions

View File

@@ -40,7 +40,11 @@ Distinctive of Eiffel is the rule that lasses can only be connected through thes
==The global inheritance structure==
An Eiffel class that you write does not come into a vacuum but fits in a preordained structure, shown in the figure and involving two library classes: <code> ANY </code> and <code> NONE </code>.
[[Image:tutorial-4]]
[[Image:tutorial-4]]
Any class that does not explicitly inherit from another is considered to inherit from <code> ANY </code>, so that every class is a descendant, direct or indirect, of <code> ANY </code>. <code> ANY </code> introduces a number of general-purpose features useful everywhere, such as copying, cloning and equality testing operations (page [[6 The Dynamic Structure: Execution Model|28]] ) and default input-output. The procedure <code> print </code> used in the first version of our "Hello World" (page [[4 Hello World|11]] ) comes from <code> ANY </code>.
<code> NONE </code> inherits from any class that has no explicit heir. Since inheritance has no cycles, <code> NONE </code> cannot have proper descendants. This makes it useful, as we will see, to specify non-exported features, and to denote the type of void values. Unlike <code> ANY </code>, class <code> NONE </code> doesn't have an actual class text; instead, it's a convenient fiction.
@@ -55,7 +59,7 @@ Above classes, you will find the concept of cluster. A cluster is a group of rel
The subsequent sections will show how to write Eiffel classes with their features. In an Eiffel system, however, not everything has to be written in Eiffel: some features may be '''external''' , coming from languages such as C, C++, Java, C# Fortran and others. For example a feature declaration may appear (in lieu of the forms seen later) as
<code>
file_status (filedesc: INTEGER): INTEGER is
file_status (filedesc: INTEGER): INTEGER
-- Status indicator for filedesc
external
"C" alias "_fstat"