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:53)
From: Ville-Pertti Keinonen <will@e...>
Subject: Re: [Caml-list] Shortest hanging
On Thu, 2005-09-08 at 04:50 +0100, Jon Harrop wrote:
> 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;;

Are you counting characters or tokens?  The following is shorter either

    while true do () done;;

With -rectypes you can also do:

    let f f = f f in f f;;

Which is shorter in characters but has more tokens.