caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Teller <David.Teller@univ-orleans.fr>
To: Jean-Christophe <Jean-Christophe.Filliatre@lri.fr>
Cc: OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Pattern-matching destructors ?
Date: Tue, 16 Oct 2007 20:53:34 +0200	[thread overview]
Message-ID: <1192560814.6368.20.camel@Blefuscu> (raw)
In-Reply-To: <4714F87B.8040807@lri.fr>

On Tue, 2007-10-16 at 19:44 +0200, Jean-Christophe wrote:
> David Teller a écrit :
> > 
> >  I'm currently working on static analysis of JavaScript 2. For this, I
> > need to keep lots of informations in each node of my AST, including
> > things such as line/column (for better error messages), unique
> > identifier (for storing inferred information), etc. As things progress,
> > I fear that the number of such informations is growing prohibitive and
> > very much getting into the way of pattern-matching.
> 
> I don't see why a lot of information in AST nodes is getting into the 
> way of pattern-matching. 

Okay, it is possible to write it in a rather concise manner. But it
still exposes somewhat too much information for my taste. I'll look at
Martin's camlp4 extension.

> When decorating ASTs, you basically replace a 
> type definition such as
> 
> type t =
>    | A
>    | B of b
>    | C of string * t * t
>    | D of t list
> 
> by two mutual recursive types

Well, I actually have about 15 recursive types, which does make it
somewhat more difficult, in part because my records need to have
different field names. Now, I guess I can just parametrize your second
type t upon t_node.

Thanks for the answers,
 David


-- 
David Teller ------------------------------------------
Security of Distributed Systems -----------------------
Project JStify: Static Analysis for JavaScript 2  -----
-- http://www.univ-orleans.fr/lifo/Members/David.Teller
----- Laboratoire d'Informatique Fondamentale d'Orleans


      reply	other threads:[~2007-10-16 18:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-16 15:20 David Teller
2007-10-16 17:09 ` [Caml-list] " Alain Frisch
2007-10-16 17:28 ` Jon Harrop
2007-10-16 17:44 ` Jean-Christophe
2007-10-16 18:53   ` David Teller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1192560814.6368.20.camel@Blefuscu \
    --to=david.teller@univ-orleans.fr \
    --cc=Jean-Christophe.Filliatre@lri.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).