caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Teller <David.Teller@univ-orleans.fr>
To: OCaml <caml-list@inria.fr>
Subject: Pattern-matching destructors ?
Date: Tue, 16 Oct 2007 17:20:45 +0200	[thread overview]
Message-ID: <1192548046.6061.18.camel@Blefuscu> (raw)

   Hi everyone,

 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.

 However, I do remember reading on this list a discussion regarding the
possibility of extending pattern-matching so as to allow matching
against user-defined criteria rather than constructors -- I'm afraid I
don't remember the name of these criteria, possibly "destructors" or
"queries".

 As far as I remember this discussion, the feature was present in F# (or
at least planned), but not in OCaml. Could anyone tell me if things have
evolved on the OCaml side, perhaps with a little camlp4 magic ? 


Thanks in advance,
 David

-- 
David Teller ------------------------------------------
Security of Distributed Systems -----------------------
-- http://www.univ-orleans.fr/lifo/Members/David.Teller
----- Laboratoire d'Informatique Fondamentale d'Orleans


             reply	other threads:[~2007-10-16 15:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-16 15:20 David Teller [this message]
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
2007-10-16 16:16 Jeff Shaw

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=1192548046.6061.18.camel@Blefuscu \
    --to=david.teller@univ-orleans.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).