RE: stream pattern [< pat=exp >] and extensions to ordinary patte

From: Manuel Fahndrich (maf@microsoft.com)
Date: Fri May 14 1999 - 18:14:34 MET DST


From: Manuel Fahndrich <maf@microsoft.com>
To: "'caml-list@inria.fr'" <caml-list@inria.fr>
Subject: RE: stream pattern [< pat=exp >] and extensions to ordinary patte
Date: Fri, 14 May 1999 09:14:34 -0700

I have to reply to my own earlier (faulty) comments...

  [...]
  I believe that with such an extension to
  OCAML, the pattern language we explored in the ICFP paper could be
expressed
  completely (and more).
  [...]

This is not entirely true. The pattern language explored in the ICFP paper
allows one to write non-deterministic patterns that get influenced by the
context. For example:

        pat leftOrRight(x) =
            (x, _)
          | (_, x)

If I then write

        match (1,2) with

        leftOrRight(2) ->
      | leftOrRight(y) ->

the first clause would apply. Using the pat=exp approach from stream
parsers, such choices in function of pat would not be possible. I consider
this feature not essential, and having pat=exp patterns whose semantics
evaluate exp first without regard to pat would still be very useful.

-Manuel Fahndrich



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:22 MET