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.3 required=5.0 tests=AWL,SUBJ_HAS_SPACES autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 9D6DBBC6B for ; Mon, 8 Oct 2007 11:57:15 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHibCUeLEwECjGdsb2JhbACORAIBCAQGCQYa X-IronPort-AV: E=Sophos;i="4.21,242,1188770400"; d="scan'208";a="2425433" Received: from ns2.mpi-inf.mpg.de (HELO francois.mpi-sb.mpg.de) ([139.19.1.2]) by mail1-smtp-roc.national.inria.fr with ESMTP; 08 Oct 2007 11:57:15 +0200 Received: from loopback.mpi-sb.mpg.de ([127.0.0.1]:60417 helo=localhost ident=amavis) by francois.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.50) id 1IepMQ-0005Mh-Qc; Mon, 08 Oct 2007 11:57:14 +0200 Received: from francois.mpi-sb.mpg.de ([127.0.0.1]) by localhost (aspirin.mpi-sb.mpg.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18031-07; Mon, 8 Oct 2007 11:57:14 +0200 (CEST) Received: from zak.mpi-sb.mpg.de ([139.19.1.28]:40365) by francois.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.50) id 1IepMQ-0005MX-Dn; Mon, 08 Oct 2007 11:57:14 +0200 Received: from groove.ds.mpi-sws.mpg.de ([139.19.131.41]:55144) by zak.mpi-sb.mpg.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1IepMQ-0006xu-31; Mon, 08 Oct 2007 11:57:14 +0200 X-Notes-Item: NOT CHECKED; name=$DNSBLSite Message-ID: <4709FEF9.5020405@mpi-sws.mpg.de> Date: Mon, 08 Oct 2007 11:57:13 +0200 From: Andreas Rossberg User-Agent: Mozilla-Thunderbird 2.0.0.4 (X11/20070619) MIME-Version: 1.0 To: skaller Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: How important are circular lists/recursive objects? References: <1175664498.24614.5.camel@rosella.wigram> <20071004194808.6d7e1136@localhost.localdomain> <1191530384.7078.102.camel@rosella.wigram> <60663.84.159.34.129.1191533795.squirrel@www.ps.uni-sb.de> <1191536723.7771.20.camel@rosella.wigram> In-Reply-To: <1191536723.7771.20.camel@rosella.wigram> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mpi-sb.mpg.de X-Spam: no; 0.00; rossberg:01 rossberg:01 recursive:01 ocaml:01 ocaml:01 -rectypes:01 -rectypes:01 mpg:98 polymorphic:01 wrote:01 rec:01 andreas:01 andreas:01 caml-list:01 cyclic:01 skaller wrote: >>> Note that stuff like: >>> >>> let rec x= (1,x) >>> >>> is not generally allowed: in functional terms it is ill-defined, >>> >> It is disallowed in OCaml because it has a cyclic type, not because it is >> a cyclic value. Try with "ocaml -rectypes". >> > > lists have cyclic types too, they're not disallowed! > Technically speaking they haven't, because conventional variant types are nominal, not structural. In any case, even OCaml without -rectypes allows some cyclic types (if the cycle goes through an object or polymorphic variant type), but not arbitrary ones. That is a pragmatic design decision to avoid too many bogus examples to type-check. - Andreas