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 QAA31838; Wed, 8 May 2002 16:03:27 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA31828 for caml-list@pauillac.inria.fr; Wed, 8 May 2002 16:03:26 +0200 (MET DST) 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 PAA31691 for ; Wed, 8 May 2002 15:59:25 +0200 (MET DST) Received: from sarg.ryerson.ca (sarg.ryerson.ca [141.117.18.117]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g48DxOD23378 for ; Wed, 8 May 2002 15:59:24 +0200 (MET DST) Received: from sarg.ryerson.ca (dmason@localhost) by sarg.ryerson.ca (8.11.2/8.11.2) with ESMTP id g48DxNO09861 for ; Wed, 8 May 2002 09:59:23 -0400 Message-Id: <200205081359.g48DxNO09861@sarg.ryerson.ca> To: "Caml Mailing List (E-mail)" Subject: Re: [Caml-list] Naming conventions In-reply-to: Your message of "Wed, 08 May 2002 09:33:03 EDT." User-Agent: EMH/1.10.0 SEMI/1.13.7 (Awazu) CLIME/1.13.6 (=?ISO-2022-JP?B?GyRCQ2YlTj4xGyhC?=) MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (alpha-redhat-linux) MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII Date: Wed, 08 May 2002 09:59:23 -0400 From: Dave Mason Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk For non-OO style Ocaml, I agree that the type signature is usually enough, although I also often use is_foo or fooP as predicates. But, the original question was about objects. In Java there is a style that is fairly convenient, whereby mutators for objects return the object itself instead of void (unit). This allows doing: let theLeftFoo = new foo(42) in theLeftFoo.setX(...) .setY(...) .initBar() as opposed to: let theLeftFoo = new foo(42) in theLeftFoo.setX(...); theLeftFoo.setY(...); theLeftFoo.initBar(); theLeftFoo I am undecided whether I think this is a good style or not, but it is more readable if you like to give meaningful (and hence long) variable names. (If I'd used x instead of theLeftFoo, you probably wouldn't have noticed much difference.) ../Dave ------------------- 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