English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Void type?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-07-31 (15:27)
From: Markus Mottl <markus.mottl@g...>
Subject: Re: [Caml-list] Re: Void type?
On 7/31/07, Chris King <colanderman@gmail.com> wrote:
> Personally I would use the second.  That way, when you come across a
> void value (say, in pattern matching a variant), you can take care of
> that match case without resorting to "assert false" (whether directly
> or via void_elim):

This is the exact reason why I used this solution: the compiler
essentially proves to you that this branch will never be taken,
because it is impossible to create a value that is a member of any
type (without black magic, that is).  This is important if you want to
check your code for uncaught exceptions, especially if you eventually
want to do this mechanically.


Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com