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] productivity improvement
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-07-19 (08:50)
From: Andreas Rossberg <rossberg@p...>
Subject: Re: [Caml-list] productivity improvement
Oleg wrote:
> On Friday 19 July 2002 03:03 am, Issac Trotts wrote:
> > Right, so how is your C++ compiler going to remind you when you forget to
> > include a needed case in the switch statement (assuming there is something
> > in the typeinfo to switch on; you can't switch on a string in C++.)  OCaml
> > will remind you, but I don't see how a C++ compiler could.
> Correct. Since C++ compiler can not possibly know of all existent sub-types,
> there is no way it can warn you. This is why virtual member functions are
> still preferred.

And how would you do more complex case analysis, corresponding to nested
patterns? This is more than cumbersome and error-prone in C++ - with
RTTI, and even more so with method dispatch, where your single algorithm
will have to be scattered over tons of distant functions. A maintenance

BTW, as Issac noted, you cannot even use switch statements to perform
RTTI in C++. You have to program if cascades.

Andreas Rossberg,

"Computer games don't affect kids; I mean if Pac Man affected us
 as kids, we would all be running around in darkened rooms, munching
 magic pills, and listening to repetitive electronic music."
 - Kristian Wilson, Nintendo Inc.
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: