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
[Caml-list] function vs. parser
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-09-13 (08:17)
From: SooHyoung Oh <shoh@d...>
Subject: [Caml-list] function vs. parser


Could anyone explain me why "parser" was introduced in Ocaml?
As you know, "function" is using in the caml light-instead of "parser".
"parser" must be a reserved word like "let" and "function", right?

I reviewed  "The Objective Caml system release 3.02", specially
  1.8 Pretty-printing and parsing
      it introduces lex and parser.
  7.1 Streams and stream parser
      it shows the syntax of parser and stream matching.

But I don't know why "parser" was introduced.
Here is an example.

# let next = parser
  [< 'x >] -> x
  | [<>] -> raise (Failure "end of stream")
val next : 'a Stream.t -> 'a = <fun>

Thanks in advance for your help.

SooHyoung Oh

Bug reports:  FAQ:
To unsubscribe, mail  Archives: