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 LAA21271; Wed, 24 Dec 2003 11:29:37 +0100 (MET) 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 LAA23859 for ; Wed, 24 Dec 2003 11:29:35 +0100 (MET) 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 hBOATXb18634 for ; Wed, 24 Dec 2003 11:29:34 +0100 (MET) Received: from 203-213-81-64-syd-ts13-2600.tpgi.com.au (203-213-81-64-syd-ts13-2600.tpgi.com.au [203.213.81.64]) by mail3.tpgi.com.au (8.11.6/8.11.6) with ESMTP id hBOARrh03958; Wed, 24 Dec 2003 21:27:54 +1100 Subject: Re: [Caml-list] Ocaml syntax. From: skaller Reply-To: skaller@ozemail.com.au To: brogoff@speakeasy.net Cc: caml-list In-Reply-To: References: Content-Type: text/plain Message-Id: <1072261671.2702.67.camel@pelican> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 24 Dec 2003 21:27:52 +1100 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ozemail:01 brogoff:01 raisins:01 beneficiary:99 endmatch:01 endmatch:01 nesting:01 ocaml:01 ocaml:01 speakeasy:01 simpler:01 syntax:02 syntax:02 match:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 2003-12-24 at 08:52, brogoff@speakeasy.net wrote: > > The native ocaml syntax has a bunch of strange inconsistencies. > If I believed that, I'd be using Perl and C++ more than I do. Nope, I think > "hysterical raisins" and human laziness/inertia/risk-avoidance explains a lot. Some of the 'inconsistencies' aren't: an 'arbitrary' decision was made, and the result seems 'inconsistent' only when you're not the beneficiary of the choice made :-) As a comparison, Felix mimics many Ocaml constructions but uses slightly different syntax in some cases. In particular: ; match .. with .. endmatch if .. then .. else .. endif but I still use let .. in .. unterminated. My opinion is that the endmatch is ugly, longwinded, but otherwise desirable. However, the if/then/else/endif leads to a lot of extra ugly 'endif' keywords for chains, which also force incorrect nesting. The fix of course is to include elif as a suboption. I'm seriously thinking of the equivalent for matches: match .. with ... elmatch .. with .. else .. endmatch and now, the original Ocaml syntax looks simpler .. especially when you consider that 'elif' makes sense in a match, and 'elmatch' makes sense in a conditional ... ------------------- 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