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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 01593BBAF for ; Mon, 7 Jul 2008 21:59:54 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqMCAGMSckjUGypAgWdsb2JhbACBW5EAAQEQIAOYSYU5 X-IronPort-AV: E=Sophos;i="4.30,318,1212357600"; d="scan'208";a="12905584" Received: from smtp7-g19.free.fr ([212.27.42.64]) by mail2-smtp-roc.national.inria.fr with ESMTP; 07 Jul 2008 21:59:54 +0200 Received: from smtp7-g19.free.fr (localhost [127.0.0.1]) by smtp7-g19.free.fr (Postfix) with ESMTP id 0FC0A322848 for ; Mon, 7 Jul 2008 21:59:54 +0200 (CEST) Received: from localhost.localdomain (c5850-a2-3-62-147-8-93.dial.proxad.net [62.147.8.93]) by smtp7-g19.free.fr (Postfix) with ESMTP id 060B43227EF for ; Mon, 7 Jul 2008 21:59:52 +0200 (CEST) Date: Mon, 7 Jul 2008 20:01:28 +0200 From: Fabrice Marchant To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] functions' recursive construction Message-ID: <20080707200128.4e125865@free.fr> In-Reply-To: References: X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.10; i486-pc-linux-gnu) X-Face: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; recursive:01 damien:01 damien:01 ocaml:01 coq:01 ocaml:01 wrote:01 rec:01 integer:01 caml-list:01 argument:02 let:03 let:03 nth:05 behave:06 On Wed, 23 May 2007 01:17:08 +0200 "Damien Lefortier" wrote: > Hi, > > I try to do a function f which takes one integer argument and returns > a function g which returns its nth arguments. > > For example f 3 gives g with let g = fun x -> fun y -> fun z -> z ;; > > I tried to do that kind of f function. > > let rec f = function > 1 -> fun x -> x > | n -> fun _ -> f (n-1) > ;; > > But it does not work, any idea ? Hi List, Sometimes, trying to learn a bit more about OCaml, I dig into old List topics. But here, outside Coq answer, I'm not sure to understand the explanations about the original OCaml question. Please, is it possible to write an OCaml function that would behave the way Damien Lefortier wish ? (I think the answer is 'No') Could you shed light on this ? Thanks, Fabrice