Re: ML-style pattern matching in C-like languages

RLake@oxfam.org.uk
15 Dec 2005 17:53:58 -0500

          From comp.compilers

Related articles
ML-style pattern matching in C-like languages rsc@swtch.com (Russ Cox) (2005-12-15)
Re: ML-style pattern matching in C-like languages just-for-news-frido@q-software-solutions.de (Friedrich Dominicus) (2005-12-15)
Re: ML-style pattern matching in C-like languages gtg983q@mail.gatech.edu (Ben Chambers) (2005-12-15)
Re: ML-style pattern matching in C-like languages torbenm@app-2.diku.dk (2005-12-15)
Re: ML-style pattern matching in C-like languages RLake@oxfam.org.uk (2005-12-15)
Re: ML-style pattern matching in C-like languages rvclayton@acm.org (2005-12-15)
Re: ML-style pattern matching in C-like languages haberg@math.su.se (2005-12-19)
Re: ML-style pattern matching in C-like languages Juergen.Kahrs@vr-web.de (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2005-12-19)
Re: ML-style pattern matching in C-like languages rsc@swtch.com (Russ Cox) (2005-12-23)
Re: ML-style pattern matching in C-like languages nr@eecs.harvard.edu (2005-12-29)
Re: ML-style pattern matching in C-like languages Vladimir.Y.Morozov@gmail.com (2006-01-18)
| List of all articles for this month |

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

> 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."


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.