Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: What am I missing?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-09-24 (16:05)
From: Sylvain BOULM'E <Sylvain.Boulme@l...>
Subject: Re: Tree of a certain class:

Actually, #debug is an abbrevation for 
 <method debug : unit; ..>
where ".." is a row type variable, you may imagine as universally quantified.
And methods of a class are not allowed to be polymorphic. Only classes are.
So, you have to bound this row variable to a type parameter of the class. 

* So a general solution is :

class ['a] dtree =
    constraint 'a=#debug
    inherit ['a] ctree

* But if you want only a "debug tree", you may write :

class dtree =
    inherit [debug] ctree