From: | RLake@oxfam.org.uk |
Newsgroups: | comp.compilers |
Date: | 15 Dec 2005 17:53:58 -0500 |
Organization: | Compilers Central |
References: | 05-12-036 |
Keywords: | C, design |
Posted-Date: | 15 Dec 2005 17:53:58 EST |
> Have there been any proposals or prototypes built
> for introducing some form of ML-style pattern matching
> in C-like languages?
You might find this interesting: http://tom.loria.fr/
From the "About TOM" page:
"Tom is language extension which adds a new matching primitives to C
and Java: %match. This construct is similar to the match primitive
found in functional languages: given a term (called subject) and a
list of pairs: pattern-action, the match primitive selects a pattern
that matches the subject and performs the associated action. This
construct may thus be seen as an extension of the classical
switch/case construct. The main difference is that the discrimination
occurs on a term and not on atomic values like characters or integers:
the patterns are used to discriminate and retrieve information from an
algebraic data structure. Therefore, Tom is a good language for
programming by pattern matching."
Return to the
comp.compilers page.
Search the
comp.compilers archives again.