mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2026-04-05 17:49:26 +02:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user