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 7B94DBC0A for ; Wed, 4 Apr 2007 03:40:55 +0200 (CEST) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l341ervU002057 for ; Wed, 4 Apr 2007 03:40:54 +0200 X-IronPort-AV: E=Sophos;i="4.14,367,1170595800"; d="scan'208";a="105939075" Received: from ppp36-111.lns2.syd6.internode.on.net (HELO [192.168.1.201]) ([59.167.36.111]) by ipmail02.adl2.internode.on.net with ESMTP; 04 Apr 2007 11:10:51 +0930 Subject: Re: [Caml-list] Polymorphic recursion From: skaller To: brogoff Cc: caml-list@yquem.inria.fr In-Reply-To: <1175650026.24309.7.camel@rosella.wigram> References: <6f9f8f4a0704030959l8ebb155g8532e3ee6d31c66d@mail.gmail.com> <9d3ec8300704031035g5a69d98dx7f7e8e5b2f7037f3@mail.gmail.com> <1175650026.24309.7.camel@rosella.wigram> Content-Type: text/plain Date: Wed, 04 Apr 2007 11:40:46 +1000 Message-Id: <1175650846.24409.1.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 46130225.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; recursion:01 seq:01 seq:01 camlp:01 sourceforge:01 polymorphic:01 wrote:01 rec:01 rec:01 caml-list:01 int:01 unit:03 let:03 let:03 size:95 On Wed, 2007-04-04 at 11:27 +1000, skaller wrote: > Why not: > > let fun rec size : 'a . 'a seq -> int = > | Unit -> 0 > | Seq(_,b) -> 1 + 2 * (size b) > > with a nice camlp4 example for people by nicolas.pouillard@gmail.com ? Opps .. should be let rec fun .. and fun .. and .. in let fun .. and .. that is, the 'fun' should come after the 'rec' keyword if present. -- John Skaller Felix, successor to C++: http://felix.sf.net