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] 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: 2002-10-29 (21:30)
From: M E Leypold @ labnet <leypold@i...>
Subject: Re: [Caml-list] CamlP4 Revised syntax comment

Damien Doligez writes:

 >    begin match a with
 >    | 0 -> ...
 >    | n -> ...
 >    end

While we are at it, why don't we have something like:

   ok, man, we will be doing a match now.
   lets start matching:
   now, match the expression a against the following patterns

     first pattern is the  pattern 0, if that applies do ...
     else if not try the   pattern n, if that applies do ...

     ok, that were all the patterns
   and we are done matching now.

Sometimes a short notation has some merits. :-) Not to be understood
wrongly: I like the idea to experiment with different syntax. I like
CamplP4. But I prefer to use the 'old' syntax (doesn't force me to
write opening and closing stuff all the time, I can pretty well
understand my own code without all that). I like the idea of a
completedly different syntax (or even a Ada or Pascal like language,
which maps to OCaml at the backend) though.

Some contributors in this discussion seem to be driven by the idea, to
make the programming language 

  (a) either more similar to spoken English:

         Like: let a be expr1 in expr2

  (b) more understandable to the computer

         Like: while expr do { ... }

      (the idea is to have more syntactic elements, to make the block
      structure explicit)

I think there is merit on both efforts (really ambigous syntax is a
pain even for humans and too cryptic code -- like obfuscated C is also
a pain), but to tell the truth, I prefer to make things harder for the
computer and easier for me. And I think

     let a = expr1 in expr2

is simpler to read, it resembles common mathematical notation better.

I'm not really sure, wether I should take this discussion serious
... It's not even really about syntax, but replacement of single
keywords. I'll just wait for the day, when someone of the
radically-new-syntax school actually presents a working implementation
and shows some medium to large program written in it. I think this is
a good plan :-).

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