Version française
Home     About     Download     Resources     Contact us    
Browse thread
grammar for class types, reraised
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques GARRIGUE <garrigue@k...>
Subject: Re: grammar for class types, reraised
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>