Version française
Home     About     Download     Resources     Contact us    
Browse thread
infinite loop that cannot be interrupted by Control-C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] infinite loop that cannot be interrupted by Control-C
> It seems that the infinite loop
>
>  let rec x = 1 :: x in x = x ;;
>
> cannot be interrupted by Control-C in the interactive session of
> Objective Caml 3.09.0

This is probably because of the way the interpreter is designed.

Signals are only checked after function calls, and one other operation
I can't remember off hand. Obviously, in your example, neither of
these cases occur, so ocaml doesn't get a chance to check for any
signals: hence, can't be interrupted.

Jonathan