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.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id C8EC3BBAF for ; Tue, 6 Oct 2009 18:31:44 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEADQNy0qFBoIF/2dsb2JhbADESY8cAQaEKoFXWA X-IronPort-AV: E=Sophos;i="4.44,513,1249250400"; d="scan'208";a="48072866" Received: from rabbit.math.nagoya-u.ac.jp (HELO mailhost.math.nagoya-u.ac.jp) ([133.6.130.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 06 Oct 2009 18:31:43 +0200 Received: from mailhost.math.nagoya-u.ac.jp (localhost [127.0.0.1]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id 7A51CB761; Wed, 7 Oct 2009 01:30:36 +0900 (JST) Received: from mailhost.math.nagoya-u.ac.jp (localhost [127.0.0.1]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id E6006889E; Wed, 7 Oct 2009 01:30:35 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=math.nagoya-u.ac.jp; h= date:message-id:to:cc:subject:from:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=alpha; bh=GfEfM27YbVFwBoG4Nwm7s5Pf2fc=; b=wsqsRSEcDvBDb+CpbO3zs1UF1cbL hc10qVPXhboqai8SMBiV7Gw+NZ3byBhj306CeHCg4Y5fn/xwYaOiCzqRdOnhuPyt BjBSJLxToEBMSujMPxVf66kiKs04WzspZFIZ7Riz6/s5P2NEgOvLiYkB3sNopiAG tDISZxL1ZPUgJig= DomainKey-Signature: a=rsa-sha1; h=Received:Date:Message-Id:To:Cc:Subject:From:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; b=XpcaD+lt/kK9M1ZoVBtYXobd+2Hgqx+uc4tlR5YtgFAceUJhW221Ddsu6DD74Ak2b5oOywzFXaBPTBGk4/2ytyFVS+FDSqVSkYLpZbfivCUu3lhE5/zzsavu4RND4Dl1WNHT1t+tQPJyPCmsXFIhXCNj5aNicF1X27Owph2JwWw=; c=nofws; d=math.nagoya-u.ac.jp; q=dns; s=alpha Received: from localhost (millas [172.16.30.29]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id 903BE889C; Wed, 7 Oct 2009 01:30:35 +0900 (JST) Date: Wed, 07 Oct 2009 01:31:10 +0900 (JST) Message-Id: <20091007.013110.71115501.garrigue@math.nagoya-u.ac.jp> To: rich@annexia.org Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Constructors are not functions From: Jacques Garrigue In-Reply-To: <20091006152404.GA19326@annexia.org> References: <200910061415.48065.jon@ffconsultancy.com> <005501ca468d$dc9b51a0$95d1f4e0$@metastack.com> <20091006152404.GA19326@annexia.org> X-Mailer: Mew version 6.2.51 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; constructors:01 camlp:01 ocaml:01 syntax:01 typable:01 transforming:01 dumped:01 caml-list:01 functions:01 expression:02 garrigue:03 garrigue:03 theoretical:03 strong:96 jacques:03 From: Richard Jones > It would be so nice to have a macro tool which was aware of types, but > that tool isn't camlp4. There are probably theoretical problems with > this, but having a "give_me_the_type_of (ocaml_subexpression)" > function would be awesome indeed. The trouble here is that the type of the subexpression depends on its context... so that you would need to have already typed the whole expression to do that. If you are extending the syntax, this is a rather strong requirement. On the other hand, if you design your extension so that the program is typable before transforming it, then it would not be theoretically impossible to have campl4 read the dumped types and use them for an extra pass. You would still need to type everything once more after that for safety. Jacques Garrigue