Difference between revisions of "Interval types updated"
(Fixed error in the validity) |
|||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
{{Research}} | {{Research}} | ||
==Introduction== | ==Introduction== | ||
− | This is a simplification of [[Read-write types]] where we use the syntax proposed in [[Interval types]] with a special meaning of the interval when used in arguments or return type. | + | This is a simplification of [[Read-write types]] where we use the syntax proposed in [[Interval types]] with a special meaning of the interval when it is the type of an actual generic parameter used in arguments or return type. |
== Example == | == Example == | ||
Line 15: | Line 15: | ||
The rules, supposing that we have `extend (g: G)' and `item: G', are that: | The rules, supposing that we have `extend (g: G)' and `item: G', are that: | ||
− | * '''(1)''' is valid if and only if x is | + | * '''(1)''' is valid if and only if x is a subset of the interval '''B .. NONE'''. |
− | * '''(2)''' is valid if and only if y is | + | * '''(2)''' is valid if and only if y is a superset of the interval '''A.. NONE'''. |
Latest revision as of 21:27, 7 July 2007
Research: This page describes research about Eiffel, not the actual language specification.
Introduction
This is a simplification of Read-write types where we use the syntax proposed in Interval types with a special meaning of the interval when it is the type of an actual generic parameter used in arguments or return type.
Example
When you have the following:
a: LIST [A .. B] a.extend (x) -- (1) y := a.item -- (2)
The rules, supposing that we have `extend (g: G)' and `item: G', are that:
- (1) is valid if and only if x is a subset of the interval B .. NONE.
- (2) is valid if and only if y is a superset of the interval A.. NONE.