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
Objects, dynamic cast, Obj.magic abuse and dragons
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-26 (14:48)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Objects, dynamic cast, Obj.magic abuse and dragons
On Tue, Feb 26, 2008 at 03:28:01PM +0100, Berke Durak wrote:
> Your solution first seemed like a kludge but, given the alternatives, it 
> appears to be the best solution.
> And it's reasonably efficient (after all, we're using objects here.)

Yeah, I suspect the real lesson here is don't use objects at all.
They are rarely as useful as people make out, and most uses of them
seem to be because lesser languages lack good compiler checks on
variants.  After all, there's no real problem at all spreading match
statements around the program if I can be sure that the compiler will
highlight everywhere which needs to change when I change my variant.


Richard Jones
Red Hat