From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id JAA18642 for caml-redistribution; Fri, 29 Sep 1995 09:02:06 +0100 Received: (from xleroy@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id QAA06395; Thu, 28 Sep 1995 16:28:24 +0100 From: Xavier Leroy Message-Id: <199509281528.QAA06395@pauillac.inria.fr> Subject: Re: CSL questions To: Emmanuel.Engel@lri.fr (Emmanuel Engel) Date: Thu, 28 Sep 1995 16:28:23 +0100 (MET) Cc: caml-list@pauillac.inria.fr In-Reply-To: <199509251101.MAA00575@newsun8.lri.fr> from "Emmanuel Engel" at Sep 25, 95 12:01:55 pm MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis > 1) Why cslc and cslopt don't print part of the source > to explain where is error. Correct. I finally noticed that during batch compilation it's basically useless to print source fragments with the errors underlined: since you're compiling from a file, you'll have to open it with an editor and go to the line with the error anyway; you'll locate the error inside the editor, not on the output of the compiler. For Emacs users, the best solution is still to compile under Emacs with M-x compile, then use find-next-error to jump to the error location. > How can I recursivly define modules ? I need SetExpr to define > the type expr and I need the type expr to define SetExpr. You can't. That's one of the most annoying restrictions of SML-style module systems. Unfortunately, compiling mutually recursive module definitions is hard. Some workarounds are described in the user's manual (chapter "Batch compilation", section "Common errors". I'm afraid they won't apply in your example, though. > 3) If I suppress the case AC_op in my definition I still have some problems. The Set.Make functor requires a type named "t" in its argument; just provide it: type expr = V of int | Binop of expr * expr | A_op of expr list module SetExpr = Set.Make(struct type t = expr let compare = compare end) By the way, there's no need to write all these signature constraints by hand, the system will do the right thing if you don't put them; moreover, over-constraining may cause some types to become abstract when you don't want them to. > So I try to use the "with" constuct There is a misunderstanding here: "with" does not rename type fields, it adds an equality over an existing type field. So if S is sig type t ... end then S with t = expr is sig type t=expr ... end but not sig type expr ... end - Xavier Leroy