From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id D9214BBAF for ; Thu, 20 May 2010 07:11:55 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsUCAENh9EvZSMDji2dsb2JhbACRc4wPFQEBAQoLCgcPBR+8ToURBA X-IronPort-AV: E=Sophos;i="4.53,268,1272837600"; d="scan'208";a="50916902" Received: from fmmailgate02.web.de ([217.72.192.227]) by mail3-smtp-sop.national.inria.fr with ESMTP; 20 May 2010 07:11:55 +0200 Received: from smtp08.web.de ( [172.20.5.216]) by fmmailgate02.web.de (Postfix) with ESMTP id C08E11616A716 for ; Thu, 20 May 2010 07:11:54 +0200 (CEST) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OEy30-0002ct-00 for caml-list@yquem.inria.fr; Thu, 20 May 2010 07:11:54 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.71) (envelope-from ) id 1OEy36-00081j-Aj for caml-list@yquem.inria.fr; Thu, 20 May 2010 07:12:00 +0200 From: Goswin von Brederlow To: Subject: Problem with recursive class and non-class types Date: Thu, 20 May 2010 07:12:00 +0200 Message-ID: <87mxvvma1r.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX18NAQgbJunSWsShLMy3qcrUSoT0n+HBsfLsaVlN dF4M9j6BdvpydF65IN7gfa+xVJUZMp3mvJmDIpFXRoh+xYwSka QxCSjm3MQ= X-Spam: no; 0.00; recursive:01 foo:01 val:01 mutable:01 foo:01 val:01 mutable:01 baz:01 mfg:98 define:02 types:05 types:05 problem:05 object:09 object:09 Hi, I want to define the two types below: type foo = { bar : bar; } class bar = object val mutable foo : foo list = [] end Is there another way of doing this other than: # type 'a foo = { bar : 'a; } class bar = object val mutable foo : #bar foo list = [] end;; type 'a foo = { bar : 'a; } class bar : object val mutable foo : #bar foo list end I don't want any 'a foo other than 'a = #bar. It is too easy to create a baz foo and then much later get a type error when trying to use it as bar foo. I want the error where the foo gets created. MfG Goswin