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
[Caml-list] Five Questions about Objects
[ 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] Five Questions about Objects
On Sun, 14 Jul 2002, YAMAGATA yoriyuki wrote:

> However, I wonder why a class is necessary in the first place.  I'm
> not familiar with the theory of OOP, but I feel like direct creation
> of objects is possible in functional languages.

It is already possible in OCaml, thanks to local modules:

"object ... end"
let module M = struct class o = object ... end end in new M.o

It would be straightforward to define a Camlp4 syntax extension for this.

-- Alain

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: