From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA09163; Sat, 1 Jun 2002 10:37:25 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA08903 for ; Sat, 1 Jun 2002 10:37:24 +0200 (MET DST) Received: from favie.faith.gr.jp (favie.faith.gr.jp [61.127.175.250]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g518bM511604 for ; Sat, 1 Jun 2002 10:37:22 +0200 (MET DST) Received: from localhost (dhcp7.faith.gr.jp [192.168.1.17]) by favie.faith.gr.jp (8.9.3/8.9.3) with ESMTP id RAA02031; Sat, 1 Jun 2002 17:37:17 +0900 To: zhudp@cs.bu.edu Cc: caml-list@inria.fr Subject: Re: [Caml-list] about Obj.magic In-Reply-To: References: <20020531060028.A31866@verdot.inria.fr> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20020601173711W.garrigue@kurims.kyoto-u.ac.jp> Date: Sat, 01 Jun 2002 17:37:11 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: dengping zhu > After carefully checking my code, I tried to remove Obj.magic from my > code. Anyway, at last I have to keep one which is not the case you guys > mentioned. My code is very simple: > > ----------- > type ty = ty1 -> ty2 > > (* where ty1, ty2 are some types I defined before, ty1 is some type like > g * h, while ty2 likes c * d * e * f. *) > > > let x = (f (g)) a > > ----------- > Here, f and g are functions, and the return type of (f (g)) is ty, which > is a function type ty1 -> ty2. While, the type of a is ty1. So, the > return type of (f (g)) a should be ty2. Anyway, every time I get an > error here. The error message is: You applied too many > parameters... The behaviour you describe definitely looks like a bug in the compiler. But I couldn't reproduce your problem, so I would need the real code (or a simplified version of it) to check whether this is really a bug. Another reason might be difference in behaviour between SML and Caml modules and functors. In Caml all signatures are opaque. To check this try writing let x = (f (g) : ty1 -> ty2) a If you get an error saying that ty is not compatible with ty1 -> ty2, then this probably means that ty is abstract. This may happen if you define a signature in which ty appears without the equation ty = ty1 -> ty2. Adding the equation should solve the problem. Hope this helps, but your description is to incomplete to conclude anything. Jacques Garrigue ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners