Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Pattern-matching destructors ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ 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

 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 Teller ------------------------------------------
Security of Distributed Systems -----------------------
----- Laboratoire d'Informatique Fondamentale d'Orleans