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=0.0 required=5.0 tests=none 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 439AEBC69 for ; Wed, 21 Mar 2007 13:47:39 +0100 (CET) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2LClcUD025824 for ; Wed, 21 Mar 2007 13:47:39 +0100 Received: from [84.59.122.240] (helo=gate.lan.gerd-stolpmann.de) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1HU0E40c6g-0002AA; Wed, 21 Mar 2007 13:47:37 +0100 Received: from flakew.lan.gerd-stolpmann.de (fw.lan.gerd-stolpmann.de [192.168.1.1]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id DC2A8C074; Wed, 21 Mar 2007 13:47:35 +0100 (CET) Subject: Re: [Caml-list] Re: Why isn't -rectypes command line option the default From: Gerd Stolpmann To: Erik de Castro Lopo Cc: caml-list@inria.fr In-Reply-To: <20070321131334.e381b5fb.mle+ocaml@mega-nerd.com> References: <20070321113430.f32c802a.mle+ocaml@mega-nerd.com> <87vegvv01u.fsf@pps.jussieu.fr> <20070321131334.e381b5fb.mle+ocaml@mega-nerd.com> Content-Type: text/plain Date: Wed, 21 Mar 2007 13:47:34 +0100 Message-Id: <1174481255.11709.23.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX19EhUeAutgKIfrK40ccXDgtOcC8c+sM1da24/Y rVLjBIxM2hERgpcOIYs2jHyav/j5+JyBInlIJ10vynDCeHE2+f mtRVLHnJf2ZcPDoUtWVgPPm7n2mykHf X-Miltered: at discorde with ID 4601296A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; -rectypes:01 gerd:01 stolpmann:01 recursive:01 -rectypes:01 recursive:01 recursion:01 runtime:01 gerd:01 stolpmann:01 viktoriastr:01 64293:01 darmstadt:01 6151:01 6151:01 Am Mittwoch, den 21.03.2007, 13:13 +1100 schrieb Erik de Castro Lopo: > Zheng Li wrote: > > > So the main consideration is safety, though it's really fun to play with > > recursive types sometimes. > > Ok, I can see why they aren't on by default, but using -rectypes on > the whole file exposes to the whole file to these errors. > > Wouldn't it be nicer to be able to specify the rectypes behaviour > per type? Maybe something like this would work: > > rec type 'a t = 'a * 'a t Lazy.t You can do that: type 'a t = T of 'a * 'a t Lazy.t Recursive types are accepted without -rectypes when the recursion crosses a variant type. Note that the runtime costs are usually negligible. Gerd -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------