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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-09-08 (09:42)
From: Jon Harrop <jon@f...>
Subject: Shortest hanging

Whilst trying to find the shortest OCaml program that hangs, I came up with:

  let rec f() = f() in f();;


  let rec x = 1::x in x=x;;

Curiously, you can interrupt the former with C-C but not the latter when run 
in the top level?! I guess the latter is stuck in polymorphic equality within 
the run time system, where it doesn't check for interruption, whereas the 
former cycles around inside the bytecode interpreter. But how come the signal 
isn't raised inside compare_val?

Dr Jon D Harrop, Flying Frog Consultancy Ltd.