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
Re: [Caml-list] CamlP4 Revised syntax comment
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] CamlP4 Revised syntax comment

On Wed, Oct 30, 2002 at 12:49:48PM -0500, Arturo Borquez wrote:
> I prefer the revised syntax despite extra verbosity because
> it overcomes some confusing situations of the official syntax.
> (if with or without else, { and begin, } and end, the match
> function ... among others).

It is exactly my position: more verbosity is a drawback, but the fact
that there is sometimes necessary in normal syntax to enclose statements
with parentheses is a bad property.

An example of that is the pretty print.

The pretty print in normal syntax is a difficulty, because of these
pending "else" and pending "vertical bar": we have sometimes to
enclose "if" and "match" statements with parentheses, sometimes not.

A solution could be to always print with parentheses, but the result
is ugly.

I found another solution by calling the pretty printing functions with
an extra parameter telling "what is printed after", and when I print a
"match" statement, if that parameter is "|", it means that this match
must be enclosed with parentheses "(..)" or "begin..end".

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: