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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-02-25 (12:36)
From: Pierre Weis <weis@p...>
Subject: Re: Break
> I would like to suggest a "new" standard exception: Pervasives.Break.

There already exists a Break exception:

# Sys.Break;;
- : exn = Break

It has another meaning, snce it is used to signal an interrupt (^C in
general under Unix).

# raise Sys.Break;;

Ther is no problem to use it to exit from loops, but it could be a bit
confusing. Thus, there also exists an exception devoted to premature
exits from loops:

# Pervasives.Exit;;
- : exn = Exit

you should raise the Exit exception when you want a premature end of
loop. (This is also true for Caml Light.)

> [ En mauvais francais ]
> Chers Utilisateurs de Caml,
> Je voudrais vous proposer un exception nouveau : Pervasives.break.

Elle existe de'ja`: c'est l'exception Pervasives.Exit en Objective
Caml ou Exit en Caml Light. L'exception Sys.Break (ou sys__Break) est
consacre'e a` signaler les interruption venant du syste`me
d'exploitation (en ge'ne'ral appui sur ^C sous Unix).

Best regards,

Pierre Weis

INRIA, Projet Cristal,,