Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Sylvain BOULM'E <Sylvain.Boulme@l...>
Subject: Re: Tree of a certain class:
Hello,

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 =
  object
    constraint 'a=#debug
    inherit ['a] ctree
  end

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

class dtree =
  object
    inherit [debug] ctree
  end

Regards,

Sylvain.