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] semi-colons and begin
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-04-05 (03:48)
From: Brian Rogoff <bpr@b...>
Subject: Re: [Caml-list] semi-colons and begin
On Wed, 4 Apr 2001 wrote:
> another minor point regarding syntax : 
> the use of "(* ... *)" prevents one from passing the multiplication
> "*" operator as an argument (say to List.map2) without 
> padding some space as in : ( * ) as opposed to (*).
> it's a small point, but i don't think i've come across such unintended
> interactions between comments and other constructs in other languages.

Not comments, but C++ has a similar issue with template syntax last I
looked. That's no excuse, just an observation. 

> while i still have your attention, one last comment :
> as you may have guessed i primarily use OCAML for writing code that
> mostly do number crunching. i know you've all seen others writing similar
> code beg for something like overloading. and i want to chime in too
> for what its worth : why can't OCAML do what SML does ? 
> overload the standard arithmetic operators to do both int and double

No no no no no no! I'd run screaming if the good folks at INRIA botched
overloading as feebly as SML. I *hate* languages that provide some
overloading and then place bizarre restrictions on it, or where the
designers tell you that overloading is bad, except where they've decided
it's good, like Java. 

Phew, that said, it looks like the extensional polymorphism approach is
what will make it (maybe) into OCaml. No response yet on the question of
having to define all overloadings in the same place. 

As long as we're making random comments, it would be nice to see a bit
more discussion of syntax here (apart from the annual label war :). I
really liked ddr's approach to separating the cases of tupling in
Revised. I think that I'm leaning more to Gerard Huet's syntax preference
on imperative constructs though, which is to use parens around the
sequence, rather than the do .. return exp syntax, though I suppose in
the interests of looking like Haskell (and making imperative constructs
stand out a bit more) I could handle a do (e1; ...; en) or some brackets
that stand out more, like (< >) for example

-- Brian

To unsubscribe, mail  Archives: