English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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.