Browse thread
Pattern-matching destructors ?
- David Teller
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | David Teller <David.Teller@u...> |
| Subject: | Pattern-matching destructors ? |
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