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 RAA10973; Wed, 23 Apr 2003 17:56:27 +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 RAA10649 for ; Wed, 23 Apr 2003 17:56:25 +0200 (MET DST) Received: from eposta.kablonet.com.tr ([62.248.102.66]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h3NFuMT15790 for ; Wed, 23 Apr 2003 17:56:23 +0200 (MET DST) Received: (qmail 26984 invoked by uid 0); 23 Apr 2003 16:03:51 -0000 Received: from unknown (HELO 195.174.169.185) (exa@195.174.169.185) by 0 with SMTP; 23 Apr 2003 16:03:51 -0000 From: Eray Ozkural Reply-To: erayo@cs.bilkent.edu.tr Organization: Bilkent University CS Dept. To: Neel Krishnaswami Subject: Re: [Caml-list] Yelling Date: Wed, 23 Apr 2003 18:56:00 +0300 User-Agent: KMail/1.5.9 References: <200304231716.23923.exa@kablonet.com.tr> <16038.43443.192953.705022@h00045a4799d6.ne.client2.attbi.com> In-Reply-To: <16038.43443.192953.705022@h00045a4799d6.ne.client2.attbi.com> Cc: caml-list@inria.fr MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200304231856.00290.exa@kablonet.com.tr> X-Spam: no; 0.00; eray:01 ozkural:01 caml-list:01 functors:01 neel:01 krishnaswami:01 foo:01 struct:01 intermix:01 erayo:01 bilkent:01 ankara:01 kde:01 malfunction:01 ariza:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Just what I was looking for (^_^) I didn't know of this syntax. I used functors here and there but I'm not too experienced in using signatures yet. I'm relatively new to ocaml and therefore constantly seeing things that surprise me! Thanks! On Wednesday 23 April 2003 17:56, Neel Krishnaswami wrote: > module Foo : FOO = > struct > type t = Foo of unit > > let v = Foo() > end > > module Bar : BAR with type t = Foo.t = > struct > include Foo (* Add the type t and value v to the Foo module *) > > let v' = v > end > > The "with type t = Foo.t" thing at the top of Bar is a sharing > declaration. It informs the compiler that the type Bar.t is the same > as the type Foo.t, so you can freely intermix Foo.t and Bar.t values. > (Otherwise the compiler would forbid it, on the grounds that these are > two different abstract types.) > > I hope this helps! -- Eray Ozkural (exa) Comp. Sci. Dept., Bilkent University, Ankara KDE Project: http://www.kde.org www: http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://mp3.com/ariza GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C ------------------- 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