Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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();;

and:

  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.
http://www.ffconsultancy.com