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 UAA06923; Thu, 15 Aug 2002 20:16:14 +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 UAA06883 for ; Thu, 15 Aug 2002 20:16:13 +0200 (MET DST) Received: from day.its.uiowa.edu (day.its.uiowa.edu [128.255.56.107]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g7FIGCv08345 for ; Thu, 15 Aug 2002 20:16:12 +0200 (MET DST) Received: from uiowa.edu (host38-92.uihc.uiowa.edu [129.255.38.92]) by day.its.uiowa.edu (8.11.6/8.11.6/ns-mx-1.14) with ESMTP id g7FIG9l16448 for ; Thu, 15 Aug 2002 13:16:10 -0500 Message-ID: <3D5BEFE9.6080200@uiowa.edu> Date: Thu, 15 Aug 2002 13:16:09 -0500 From: Brian Smith User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1a) Gecko/20020611 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Cyclic ?! References: <000301c24468$6cb5b350$6601a8c0@hicks> <200208151725.NAA12685@dewberry.cc.columbia.edu> <20020815180552.GB26027@fichte.ai.univie.ac.at> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, Markus Mottl wrote: > On Thu, 15 Aug 2002, Oleg wrote: > >>I'm not sure I understand you. If the two definitions are equivalent WRT >>Empty <-> None & Node <-> Some name substitution, then the fact that the >>compiler accepts one, but not the other must be a bug, yes? > > This is not a bug, because you can have the compiler typecheck it using > the command-line flag "-rectypes". > > The problem rather is that programmers can accidently write down > meaningless expressions for which the compiler infers absolutely crazy > types. If I remember correctly, OCaml already had the more general rule > by default in some ancient version, but the developers found that this > generality caused more confusion than benefits to programmers... But, if this is the case, then wouldn't that still apply to other parts of a program using recursive types? In other words, if I use one recursive type, then I must use -rectypes, but that means that the "extra strict checking" that O'Caml normally does won't help me in the rest of my program, where I might use recursive types accidently and thus cause O'Caml to infer "absolutely crazy types". I think, instead of a command-line option, it would be better to provide a syntactical annotation on each type definition where this behavior is desired. That way, the default strict checking would always apply, but it can be overridden by somebody that knows they really really want a recursive type. What do you think? - Brian ------------------- 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