caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Break
@ 1997-02-24 20:00 Andrew Conway
  1997-02-25 12:34 ` Break Pierre Weis
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Conway @ 1997-02-24 20:00 UTC (permalink / raw)
  To: caml-list


Dear Caml community,

I would like to suggest a "new" standard exception: Pervasives.Break.

I frequently wish to break out of a "for" loop, when looking for
something, and want some exception designed for that purpose. Having
a standard one would make programs more standard, and reduce proliferation
of custom Break type exceptions.


[ En mauvais francais ]

Chers Utilisateurs de Caml,

Je voudrais vous proposer un exception nouveau : Pervasives.break.

Souvent je veux quitter "for ... do .. done", quand je cherche quelque
chose, et il faut definer un exception neuveau. S'il y avait un
exception commun, les logiciels serait plus facile a comprendre, et
il n'y aurait pas tellement des exceptions comme A.Break, B.Break,...

Amities,

Andrew.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Break
  1997-02-24 20:00 Break Andrew Conway
@ 1997-02-25 12:34 ` Pierre Weis
  0 siblings, 0 replies; 2+ messages in thread
From: Pierre Weis @ 1997-02-25 12:34 UTC (permalink / raw)
  To: Andrew Conway; +Cc: caml-list

> 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;;
Interrupted.

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, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis







^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-02-25 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-24 20:00 Break Andrew Conway
1997-02-25 12:34 ` Break Pierre Weis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).