Interval types updated

Revision as of 21:27, 7 July 2007 by Manus (Talk | contribs) (Fixed error in the validity)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.