Difference between revisions of "Interval types updated"

 
(Introduction)
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 ==

Revision as of 13:37, 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 any type in the interval B .. NONE.
  • (2) is valid if and only if y is any type in the interval ANY .. A.