Re: Type constraints

From: Vale'rie Me'nissier-Morain (Valerie.Menissier-Morain@dyade.fr)
Date: Fri May 30 1997 - 12:01:21 MET DST


Date: Fri, 30 May 1997 12:01:21 +0200
Message-Id: <199705301001.MAA32195@ebene.inria.fr>
From: Valerie.Menissier-Morain@dyade.fr (Vale'rie Me'nissier-Morain)
To: mposada@impsat.net.co
Subject: Re: Type constraints

Why do you need to define t2 simultaneously to 'a node and t1?

The following session is ok in Caml Light

> Caml Light version 0.73

#type 'a node = {x: 'a; y: t1}
and t1 = A | B of t1*t1;;
Type node defined.
Type t1 defined.
#type t2 = C | D of (string * t2) node;;
Type t2 defined.
#type t2 = C | D of (string * t2) node | E of bool node;;
Type t2 defined.
#

or, if you prefer in Objective Caml

        Objective Caml version 1.05

# type 'a node = {x: 'a; y: t1}
a nd t1 = A | B of t1*t1;;
type 'a node = { x: 'a; y: t1 }
type t1 = | A | B of t1 * t1
# type t2 = C | D of (string * t2) node;;
type t2 = | C | D of (string * t2) node
# type t2 = C | D of (string * t2) node | E of bool node;;
type t2 = | C | D of (string * t2) node | E of bool node

V. Ménissier-Morain



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:11 MET