[Shootout-list] Stuff

Bengt Kleberg bengt.kleberg@ericsson.com
Mon, 25 Apr 2005 11:34:14 +0200


Jon Harrop wrote:
...deleted
> For example, here is a minimal core of the "nth" program in OCaml:
> 
>   let rec nth_nn n (i, io) = match n with
>     0 -> singleton (i, io)
>   | 1 -> fold (fun (j, jo) s -> add (j, add_i io jo) s) bonds.(i - 1) empty
>   | n ->
>       let pprev = nth_nn (n - 2) (i, io) in
>       let prev = nth_nn (n - 1) (i, io) in
>       let aux j t = union (nth_nn 1 j) t in
>       diff (diff (fold aux prev empty) prev) pprev
> 

would it be possible to explain this program without using ocaml (or any 
other programming languge)?


bengt