From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA15665 for caml-redistribution; Fri, 24 Sep 1999 18:12:13 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA23748 for ; Fri, 24 Sep 1999 15:09:03 +0200 (MET DST) Received: from cs.clemson.edu (citron.cs.clemson.edu [130.127.48.6]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id PAA19898 for ; Fri, 24 Sep 1999 15:08:59 +0200 (MET DST) Received: from merlin.cs.clemson.edu (merlin [130.127.48.80]) by cs.clemson.edu (8.9.3/8.9.3) with ESMTP id JAA00957 for ; Fri, 24 Sep 1999 09:08:59 -0400 (EDT) Received: (from steve@localhost) by merlin.cs.clemson.edu (8.9.3/8.9.3) id JAA01550; Fri, 24 Sep 1999 09:08:59 -0400 (EDT) From: Steve Stevenson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 24 Sep 1999 09:08:58 -0400 (EDT) To: caml-list@inria.fr Subject: Help --- type checker and I agree to disagree... X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14315.30432.686941.63376@merlin.cs.clemson.edu> Sender: weis I'm still experimenting with the deque I wrote about some time ago. Now the type checker and I can't come to an agreement in one module which we agree on the exact same construct somewhere else. What am I not seeing? Best regards, steve ----- Steve (really "D. E.") Stevenson Assoc Prof Department of Computer Science, Clemson, (864)656-5880.mabell Support V&V mailing list: ivandv@cs.clemson.edu ------------------------------------------------------------ The code: open Objdeque (* See below *) open Rtnppxsem (* Has type definitions for (NoOp,Nil) *) let definemacro c_inp = c_inp#hpop let gpm c_inp = let nulltype = ((NoOp,Nil):semantics) in let h_out = new objdeque nulltype in while true do let a = c_inp#hpop in match a with | (Definiendum, Nil) -> (definemacro c_inp); () | _ -> (h_out#tpush a); () done; h_out ------------------------------------------------------------ The disagreement (merlin)[ORTN] 49) ocamlc -c test.ml File "test.ml", line 8, characters 27-35: This expression has type Rtnppxsem.semantics = Rtnppxsem.action * Rtnppxsem.semantics_data but is here used with type 'a Objdnode.objdnode option as 'a (merlin)[ORTN] 50) ------------------------------------------------------------ Objdeque: (merlin)[ORTN] 46) ocamlc -c -i objdnode.ml class ['a] objdnode : 'a -> object val mutable aft : 'a objdnode option val node : 'a method aftof : unit -> 'a objdnode option method nodeof : unit -> 'a method setaft : 'a objdnode option -> unit end (merlin)[ORTN] 48) ocamlc -c -i objdeque.ml exception Empty class ['a] objdeque : 'a -> object constraint 'a = ('a Objdnode.objdnode as 'b) option val mutable hd : 'a val mutable tl : 'a Objdnode.objdnode as 'c method connect : 'a objdeque -> unit method convert : 'a list method createreader : 'a objdeque method gethead : 'a list method head : unit -> 'a method hpop : 'a method hpush : 'a -> unit method hread : 'a method iter_p : (int -> 'a -> unit) -> unit method tail : unit -> ('a Objdnode.objdnode as 'd) method tpush : 'a -> unit end