Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Brian Rogoff <bpr@b...>
Subject: Re: [Caml-list] function vs. parser
On Thu, 13 Sep 2001, Daniel de Rauglaudre wrote:
> On Thu, Sep 13, 2001 at 05:20:11PM +0900, SooHyoung Oh wrote:
>
> > 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?
>
> Right: "parser" is used because they are not functions. In Caml Light,
> we used "function", but it was an bad idea: the pattern matching rules
> in parsers have nothing to do with the pattern matching rules in
> functions and it was important to separate the notions.

I have a petty complaint. Another name would have been better, say "parse"
to match "match" since "parser" is a good name for a type and at least in
English there are no good synonyms. If you start writing combinator
parsers you have to hack the keyword parser to be parser_t or _parser or
somesuch, which is a little ugly.

Hey, I said it is a *petty* complaint! ;-)

-- Brian


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr