Version française
Home     About     Download     Resources     Contact us    
Browse thread
Estimating the size of the ocaml community
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] Estimating the size of the ocaml community
On Fri, Feb 04, 2005 at 11:02:49PM +0100, Thomas Fischbacher wrote:
> 
> On Fri, 4 Feb 2005, Oliver Bandel wrote:
> 
> > On Thu, Feb 03, 2005 at 10:16:33PM +0100, Thomas Fischbacher wrote:
> > [...]
> > > (3) The type system is annoying. People claim it helps catching errors, 
> > > but my impression is it only catches those which I would never make 
> > > anyway.
> > [...]
> > 
> > Well if it catches only errors you never make, you should
> > never had any warnings nor error messages from the type
> > system.
> > So, why is it annoying, if you never get a warning/error message?
> > 
> > Normally you should not be aware of the type system, because you
> > do not make type-system-errors.
> 
> Because the type system occasionally forces me to write code in funny 
> ways, as I cannot "sometimes return an integer, sometimes a symbol" from a 
> function, say. I would have to wrap this up.
> 
[...]

...well....

type sometimes_t = Integer of int | One_symbol | Another_symbol

let look_inside thing = match thing with
      Integer i      -> print_endline ("Got an int! " ^ string_of_int i)
    | One_symbol     -> print_endline "Got ONE symbol"
    | Another_symbol -> print_endline "Got ANOTHER symbol"


...isn't that nice?!


Ciao,
   Oliver