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 LAA03050; Sun, 13 Jul 2003 11:11:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA07059 for ; Sun, 13 Jul 2003 11:11:46 +0200 (MET DST) Received: from mail3.tpgi.com.au (mail.tpgi.com.au [203.12.160.59]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6D9Bif18785; Sun, 13 Jul 2003 11:11:44 +0200 (MET DST) Received: from ozemail.com.au (203-219-67-160-syd-ts23-2600.tpgi.com.au [203.219.67.160]) (authenticated (0 bits)) by mail3.tpgi.com.au (8.11.6/8.11.6) with ESMTP id h6D9Bea06455; Sun, 13 Jul 2003 19:11:40 +1000 Message-ID: <3F11224B.10106@ozemail.com.au> Date: Sun, 13 Jul 2003 19:11:39 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Pierre Weis CC: brogoff@speakeasy.net, caml-list@inria.fr Subject: Re: [Caml-list] syntax of private constructors in CVS version References: <200307072231.AAA14343@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ozemail:01 caml-list:01 pierre:01 weis:01 numerator:01 val:01 accessor:01 shorthand:01 toxteth:01 glebe:01 2037,:01 9660:01 0850:01 explicitely:01 mutable:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Pierre Weis wrote: > Records with mutable fields are permitted. Mutators explicitely exported > as functions are allowed, other mutations are forbidden. ... > type rat = { > mutable numerator : int; > mutable denominator : int; > };; > Then interface of the module would abstract creation and mutation: > > type rat = private { > mutable numerator : int; > mutable denominator : int; > };; > > val mk_rat : int -> int -> rat;; > val normalize_rat : rat -> unit;; OK. Nice. 'private' is allowed in the interface, and matches a non-private record defined in the module. [I imagine generated accessor and mutators here .. a field label just being shorthand way to specify a projection function etc ..] -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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