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
Efficency of varient types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-26 (01:17)
From: Brian Hurt <bhurt@s...>
Subject: Re: [Caml-list] Efficency of varient types

On Sat, 26 Nov 2005, Nicolas Cannasse wrote:

> If you have a tagged variant where all constructors have a parameter, you can 
> use Obj module to unbox the Int variant but the code is a lot less readable.

As a general rule, unless you work at INRIA, you should never, ever use 
the Obj module.  Not only will the code be signifigantly less readable, 
it'll also be signifigantly more error prone, especially obscure, hard to 
debug unless you are intimately familiar with the inners of the garbage 
collector, segfault you program at random times, boy doesn't this feel 
like C++ bugs.