From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA22418; Sun, 14 Jul 2002 10:58:25 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA22424 for ; Sun, 14 Jul 2002 10:58:24 +0200 (MET DST) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g6E8wNj25630 for ; Sun, 14 Jul 2002 10:58:24 +0200 (MET DST) Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id g6E8wNo01080 ; Sun, 14 Jul 2002 10:58:23 +0200 (CEST) Received: from localhost (frisch@localhost) by clipper.ens.fr (8.12.3/jb-1.1) id g6E8wMJF009234 ; Sun, 14 Jul 2002 10:58:22 +0200 (MET DST) Date: Sun, 14 Jul 2002 10:58:22 +0200 (MET DST) From: Alain Frisch To: YAMAGATA yoriyuki cc: Caml list Subject: Re: [Caml-list] Five Questions about Objects In-Reply-To: <20020714095816B.yoriyuki@mbg.sphere.ne.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-milter (http://amavis.org/) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners