From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 8E1EDBC69 for ; Wed, 21 Mar 2007 02:47:56 +0100 (CET) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2L1ltCA019078 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 21 Mar 2007 02:47:56 +0100 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HTpvN-00060o-P9 for caml-list@inria.fr; Wed, 21 Mar 2007 02:47:37 +0100 Received: from ivr94-8-88-162-26-239.fbx.proxad.net ([88.162.26.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Mar 2007 02:47:37 +0100 Received: from li by ivr94-8-88-162-26-239.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Mar 2007 02:47:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Zheng Li Subject: Re: Why isn't -rectypes command line option the default Date: Wed, 21 Mar 2007 02:48:45 +0100 Message-ID: <87vegvv01u.fsf@pps.jussieu.fr> References: <20070321113430.f32c802a.mle+ocaml@mega-nerd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: ivr94-8-88-162-26-239.fbx.proxad.net User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) Cancel-Lock: sha1:n8Uj3HB36TMnQgVgcJpPSQLBjjg= Sender: news X-Miltered: at discorde with ID 46008ECB.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; -rectypes:01 ocaml:01 -rectypes:01 recursive:01 recursive:01 writes:01 pps:01 pps:01 jussieu:01 jussieu:01 types:03 types:03 typed:03 typed:03 erik:04 Erik de Castro Lopo writes: > but I was wondering if there was a reason why -rectypes wasn't the > default. It's consciously disabled to avoid mysterious report of errors. Many careless coding errors can be typed with recursive types, for example # fun x-> x::x;; - : ('a list as 'a) -> 'a list = in this case, the programmer is probably thinking of connecting @ two list. With recursive types, instead of a immediately type error report in place, the function is typed without any problem, and finally some accident may be happened far away from here, where the original function is likely to be under several layers of composition and hard to recognized. So the main consideration is safety, though it's really fun to play with recursive types sometimes. -- Zheng Li http://www.pps.jussieu.fr/~li