Re: grammar for class types, reraised

From: Jacques GARRIGUE (garrigue@kurims.kyoto-u.ac.jp)
Date: Wed Jun 23 1999 - 03:40:49 MET DST


To: tews@tcs.inf.tu-dresden.de
Subject: Re: grammar for class types, reraised
In-Reply-To: Your message of "Tue, 22 Jun 1999 19:00:22 +0200"
 <199906221700.TAA21025@ithif20.inf.tu-dresden.de>
Message-Id: <19990623104049R.garrigue@kurims.kyoto-u.ac.jp>
Date: Wed, 23 Jun 1999 10:40:49 +0900
From: Jacques GARRIGUE <garrigue@kurims.kyoto-u.ac.jp>

From: Hendrik Tews <tews@tcs.inf.tu-dresden.de>

> From: Jerome Vouillon <Jerome.Vouillon@inria.fr>

> > 2. Why is it not possible to add type constraints to the first
> > kind of type abbreviation, like in
> >
> > class type ['a] c = ['a, string] a constraint 'a = int;;
>
> There is no real reason. I think I could add this quite easily to the
> language if you need this.

In fact, you can already do that:

class type ['a, 'b] a = object method m : 'a -> 'b end
class type ['a] c = object
  inherit ['a,string] a
  constraint 'a = int
end

Remark also that inheritance at the type level does not presuppose
inheritance at the value level, so this should be general enough.

        Jacques
---------------------------------------------------------------------------
Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp
                <A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>



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