caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* infinite loop that cannot be interrupted by Control-C
@ 2005-12-07  5:49 Eijiro Sumii
  2005-12-07  5:55 ` [Caml-list] " Jonathan Roewen
  2005-12-07  6:06 ` Eijiro Sumii
  0 siblings, 2 replies; 3+ messages in thread
From: Eijiro Sumii @ 2005-12-07  5:49 UTC (permalink / raw)
  To: caml-list

Hi,

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, at least on linux-i386 and solaris-sparc.  Is
this a feature or a bug?

(I did some search and found the same question at

http://caml.inria.fr/pub/ml-archives/caml-list/2005/09/3440c94ff51afc4a5db290c9d811f406.en.html

but there seems to be no answer...)

Thanks,

        Eijiro


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

* Re: [Caml-list] infinite loop that cannot be interrupted by Control-C
  2005-12-07  5:49 infinite loop that cannot be interrupted by Control-C Eijiro Sumii
@ 2005-12-07  5:55 ` Jonathan Roewen
  2005-12-07  6:06 ` Eijiro Sumii
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Roewen @ 2005-12-07  5:55 UTC (permalink / raw)
  To: Eijiro Sumii; +Cc: caml-list

> 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


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

* Re: infinite loop that cannot be interrupted by Control-C
  2005-12-07  5:49 infinite loop that cannot be interrupted by Control-C Eijiro Sumii
  2005-12-07  5:55 ` [Caml-list] " Jonathan Roewen
@ 2005-12-07  6:06 ` Eijiro Sumii
  1 sibling, 0 replies; 3+ messages in thread
From: Eijiro Sumii @ 2005-12-07  6:06 UTC (permalink / raw)
  To: caml-list

P.S.  For information, the execution _does_ terminate in some older
versions (because = used to check == first) as well as in
non-interactive cases.


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

end of thread, other threads:[~2005-12-07  6:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-07  5:49 infinite loop that cannot be interrupted by Control-C Eijiro Sumii
2005-12-07  5:55 ` [Caml-list] " Jonathan Roewen
2005-12-07  6:06 ` Eijiro Sumii

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).