From a9213f71a764c7088799e1a54fd4f1f408b7eaf3 Mon Sep 17 00:00:00 2001 From: eiffel-org Date: Wed, 5 Jul 2017 17:41:29 +0000 Subject: [PATCH] Update wikipage Types. (Signed-off-by:alexk). git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1868 abb3cda0-5349-4a8f-a601-0c33ac3a8c38 --- .../Types.wiki | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/documentation/trunk/eiffel/Language_reference/quick-reference-eiffel-programming-language/Types.wiki b/documentation/trunk/eiffel/Language_reference/quick-reference-eiffel-programming-language/Types.wiki index b7c2f11f..9367b14a 100644 --- a/documentation/trunk/eiffel/Language_reference/quick-reference-eiffel-programming-language/Types.wiki +++ b/documentation/trunk/eiffel/Language_reference/quick-reference-eiffel-programming-language/Types.wiki @@ -5,11 +5,41 @@ == Common ancestor type == -A *common ancestor type* is a type computed for a list of types using the following algorithm: +A '''common ancestor type''' is a type computed for a list of types using the following algorithm: -1. Temporary ignore whether any types are detachable or separate. -2. Add a type `NONE` to the list of types (this makes sure the list is never empty). -3. If there is a type in the list to which all other types conform, remember it as T. -4. Otherwise, use `ANY` for T. -5. If there is a detachable or separate type in the list, use the corresponding detachable and/or separate version of type T. +# Temporary ignore whether any types are detachable or separate. +# Add a type `NONE` to the list of types (to make sure the list is never empty). +# If there is a type in the list to which all other types conform, remember it as T. +# Otherwise, use `ANY` for T. +# If there is a detachable or separate type in the list, use the corresponding detachable and/or separate version of T. + +Here are some examples: +{| +! Type list +! Common ancestor type +|- +| (empty) +| NONE +|- +| BOOLEAN +| BOOLEAN +|- +| BOOLEAN, BOOLEAN +| BOOLEAN +|- +| INTEGER_32, REAL_64, COMPARABLE +| COMPARABLE +|- +| INTEGER_32, REAL_64 +| ANY +|- +| INTEGER_32, detachable COMPARABLE +| detachable COMPARABLE +|- +| INTEGER_32, separate COMPARABLE +| separate COMPARABLE +|- +| detachable STRING, separate COMPARABLE +| detachable separate COMPARABLE +|} \ No newline at end of file