Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Function call with a list of parameters
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alain Frisch <frisch@c...>
Subject: Re: [Caml-list] Function call with a list of parameters
On Thu, 13 Dec 2001, Diego Olivier Fernandez Pons wrote:

> I am afraid I do not understand how are cyclic types and OOP related.
> Could you explain more precisely this point ?

Cyclic (aka recursive) types are necessary to type such an expression:
# fun x -> x # run (); x;;
- : (< run : unit -> 'b; .. > as 'a) -> 'a = <fun>

Note that recursive constructed (variant,record) types are not considered
cyclic:  type 'a tree = Leaf | Node of 'a * 'a. Except for objects,
recursive types are often unecessary; allowing them may hide or deplace
type errors, and make error messages difficult to understand. Moreover,
they sensibly complexify the implementation. I don't want to speak for the
OCaml team, but it seems reasonnable to consider that recursive types are
supported in OCaml only because of OOP ...



Alain

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr