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 WAA04494; Sat, 14 Aug 2004 22:47:43 +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 WAA06274 for ; Sat, 14 Aug 2004 22:47:42 +0200 (MET DST) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i7EKlZRM011209 for ; Sat, 14 Aug 2004 22:47:38 +0200 Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.11.6/8.10.1) with ESMTP id i7EKl7J18642; Sat, 14 Aug 2004 15:47:07 -0500 (CDT) Date: Sat, 14 Aug 2004 15:55:03 -0500 (CDT) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Jon Harrop cc: Ocaml Mailing List Subject: Re: [Caml-list] CFG's and OCaml In-Reply-To: <200408142119.11234.jon@jdh30.plus.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 411E7A67.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 disallow:01 'a-:01 'a-:01 parses:01 bool:01 evaluates:01 ocaml:01 ocaml:01 syntax:02 ast:02 enforce:02 comparison:02 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, 14 Aug 2004, Jon Harrop wrote: > On Saturday 14 August 2004 04:33, Brian Hurt wrote: > > > 3. If so, is the fact that most languages disallow "a > > > No. "a > Sorry, I should have been more specific. With left- or right- or > non-associative, commuting, 'a->'a->'a operators (like + and *) you can get > away with parsing that way, e.g. "a+b+c" as: > > either (a+b)+c or a+(b+c) > > But you can't do this with comparison 'a->'a->bool operators because it forces > you to deviate from conventional mathematical meaning, e.g. you get a type > error in OCaml on the "3" in "1<2<3" because it parses as "(1<2)<3" which > evaluates to "true<3" which just doesn't make any sense. > The syntax of a language doesn't enforce a given meaning on the language being parsed. "Colorless green ideas sleep furiously" is a syntactically correct English sentence, even if it is utterly meaningless. The AST of a