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.6 required=5.0 tests=NO_REAL_NAME 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 CC7DABBB7 for ; Tue, 8 Jul 2008 00:48:37 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoQEACU6ckjAXQIm/2dsb2JhbACRYzeZP4Vh X-IronPort-AV: E=Sophos;i="4.30,318,1212357600"; d="scan'208";a="14859215" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 08 Jul 2008 00:48:37 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m67MmY3U019208 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 8 Jul 2008 00:48:37 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlgFAMs5ckjRVcisY2dsb2JhbACRYzc5GgQeA5hGhWA X-IronPort-AV: E=Sophos;i="4.30,318,1212357600"; d="scan'208";a="27108735" Received: from wf-out-1314.google.com ([209.85.200.172]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 Jul 2008 00:48:36 +0200 Received: by wf-out-1314.google.com with SMTP id 25so2799011wfa.0 for ; Mon, 07 Jul 2008 15:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=eDdxmqSyl6SLfuyV1rYZtP/pssFRwy1IUtI3o5x7DRQ=; b=hwHDjidIsMUU69qpSZbuZ1xPns1KUfcwKcfZ3FbxCQexgRPd0HN4Zu/kUtU+5CW0ra 737bQzltFMhLhmTXetwNiDj5cLFn/yZS3YL/BxOIeuOuGJk+CxOAQdR/sc1n2bglLvLj SENfTCOJWfXUI+pz5kN44N0rXlaVX9U/bkA28= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=OabAY4r/ESD5/dy7tM6rsBo6WRF04TMup5V2ia3HuP4h/kqE4wHdXsLAMB/tCMcpx0 bbrPhFeRJ4EBzPqVJEarXep0kSvTL5FbmxVLtfcShjEiaxft9PSY+MZ2O0JQlhUNb54Z DI2Lr8GWD5DJ/5MbjAPoKpxkPY/yiq27nLKjg= Received: by 10.142.245.6 with SMTP id s6mr1530104wfh.157.1215470915335; Mon, 07 Jul 2008 15:48:35 -0700 (PDT) Received: by 10.143.195.4 with HTTP; Mon, 7 Jul 2008 15:48:34 -0700 (PDT) Message-ID: Date: Tue, 8 Jul 2008 00:48:34 +0200 From: asmadeus77@gmail.com To: "Fabrice Marchant" Subject: Re: [Caml-list] functions' recursive construction Cc: caml-list@inria.fr In-Reply-To: <20080707211133.21ee2905@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080707200128.4e125865@free.fr> <48727BA5.1010806@ed.ac.uk> <20080707211133.21ee2905@free.fr> X-Miltered: at discorde with ID 48729D42.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; recursive:01 printf:01 printf:01 martinet:01 glanced:98 integer:01 integer:01 typing:01 caml-list:01 functions:01 functions:01 lazy:02 argument:02 argument:02 arg:03 Hello, I am not sure I remember what was said exactly, and I'm quite too lazy to check, but I remember that someone gave a possible implementation with Obj.magic ? This also is about the same as the Printf functions which can take a variable amount of arguments and need a bit of tinkering, and I remember a function 'eat", taking an integer n, which would ignore the n first arguments given to the function. Now, if you have this, getting the first argument should be possible after looking at the printf source :) (although I could not find it searching in my mails, sorry) Actually, I've just glanced at the source and there _is_ a "get_arg" function, taking a single integer and returning an Obj.magic'ed item which would most likely be the nth argument of a function - however I can't separate the function from the rest of the code properly in just a minute, but it definitly is a place to look at if you need such a function... Although it might be quite dangerous. But as it was said, the type is impossible to represent and magic is probably necessary without typing multiple calls to functions manually; but Jeremy's solution could be enough :) Good luck, Dominique Martinet