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=1.0 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL 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 183E9BC69 for ; Mon, 11 Jun 2007 00:07:15 +0200 (CEST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5AM7DPQ025867 for ; Mon, 11 Jun 2007 00:07:14 +0200 Received: by wa-out-1112.google.com with SMTP id j37so2059114waf for ; Sun, 10 Jun 2007 15:07:12 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=eMQFVOmhJBlTAuSfgT1dopS4Mx5O0w9FJkGolqHZFA8RSb0W0xQ9GRUR6cZSyzu5OHeAYPoqoasREi3ir+89KTJYwbBlcCaJ47q+l8gY8EL+36AtZo3dY55SYigyYGVptgvdO4n8+EoCUoKoxNNVT+LC4z019r5SpHavCp7HZhA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=XWoJPcJ/MHOJYbE8cpD5qano0oVp7S8jauk5BwrypeSLnquOidO0cZTa18TVf6EedK1VR+5huQLPLDTGMWyGlfNg6iQznbdSEcSEv0iaBR9YI+sUbBL7GMWlcLITzPtxUuBWiton1mxU2YVcrUwGkHR/7qefnEYgi8CP8XyHkSA= Received: by 10.115.93.16 with SMTP id v16mr4835052wal.1181513232846; Sun, 10 Jun 2007 15:07:12 -0700 (PDT) Received: by 10.114.52.9 with HTTP; Sun, 10 Jun 2007 15:07:12 -0700 (PDT) Message-ID: <891bd3390706101507h68b5436s458e213a813d7ce0@mail.gmail.com> Date: Sun, 10 Jun 2007 18:07:12 -0400 From: "Yaron Minsky" Sender: yminsky@gmail.com To: "Joel Reymont" Subject: Re: [Caml-list] camlp4 and class introspection Cc: caml-list@yquem.inria.fr In-Reply-To: <9E55FC99-E968-45E2-9F64-A2B6BE6ED415@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_87531_17361872.1181513232802" References: <7C9995D9-AC11-4E7C-8477-25CA4B88A0F4@gmail.com> <891bd3390706101302h443da391x9a4bef15da9c730f@mail.gmail.com> <9E55FC99-E968-45E2-9F64-A2B6BE6ED415@gmail.com> X-Google-Sender-Auth: 93d86c08908c58d8 X-Miltered: at discorde with ID 466C7611.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 camlp:01 sexp:01 sexp:01 run-time:01 type-related:01 yaron:01 minsky:01 camlp:01 run-time:01 type-related:01 2007,:98 blog:98 ------=_Part_87531_17361872.1181513232802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Others can probably give a better definition of type-directed programming than I can, and it's possible I'm misusing the time. But in any case, what I mean by type-directed programming is roughly this: for each type, you define a value corresponding to that type that contains useful information about the type. In our s-expression macros, these values are simply functions named sexp_of_ and _of_sexp for each type. The role of these values is to essentially give you a run-time representation of the type, in a rather static way. Macros come in by giving you a way to automate the generation of these type-related values, which otherwise can be rather tedious. y On 6/10/07, Joel Reymont wrote: > > Yaron, > > On Jun 10, 2007, at 9:02 PM, Yaron Minsky wrote: > > I actually think you can do this kind of thing with a combination of > > type-directed programming and macros. > > What would be type-directed programming in this scenario? > > Would this be done within camlp4? > > Thanks, Joel > > -- > http://topdog.cc - EasyLanguage to C# translator > http://wagerlabs.com - Blog > > > ------=_Part_87531_17361872.1181513232802 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Others can probably give a better definition of type-directed programming than I can, and it's possible I'm misusing the time.  But in any case, what I mean by type-directed programming is roughly this:  for each type, you define a value corresponding to that type that contains useful information about the type.  In our s-expression macros, these values are simply functions named sexp_of_<type> and <type>_of_sexp for each type.  The role of these values is to essentially give you a run-time representation of the type, in a rather static way.

Macros come in by giving you a way to automate the generation of these type-related values, which otherwise can be rather tedious.

y

On 6/10/07, Joel Reymont <joelr1@gmail.com> wrote:
Yaron,

On Jun 10, 2007, at 9:02 PM, Yaron Minsky wrote:
> I actually think you can do this kind of thing with a combination of
> type-directed programming and macros.

What would be type-directed programming in this scenario?

Would this be done within camlp4?

        Thanks, Joel

--
http://topdog.cc      - EasyLanguage to C# translator
http://wagerlabs.com   - Blog



------=_Part_87531_17361872.1181513232802--