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 VAA10649; Thu, 12 Aug 2004 21:15:01 +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 VAA11074 for ; Thu, 12 Aug 2004 21:15:00 +0200 (MET DST) Received: from plato.rocketdogcreative.com (plato.rocketdogcreative.com [66.139.78.99]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i7CJExRM006374 for ; Thu, 12 Aug 2004 21:15:00 +0200 Received: from [10.0.1.3] (65-103-213-184.tcsn.qwest.net [65.103.213.184]) by plato.rocketdogcreative.com (8.11.6/8.11.6) with ESMTP id i7CJEw108345 for ; Thu, 12 Aug 2004 12:14:58 -0700 Mime-Version: 1.0 (Apple Message framework v619) Content-Transfer-Encoding: 7bit Message-Id: <058C1DD2-EC94-11D8-9939-000A95C19BAA@Avisere.com> Content-Type: text/plain; charset=US-ASCII; format=flowed To: caml-list@inria.fr From: David McClain Subject: [Caml-list] CFG's and OCaml Date: Thu, 12 Aug 2004 12:15:49 -0700 X-Mailer: Apple Mail (2.619) X-Miltered: at concorde with ID 411BC1B3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; mcclain:01 mcclain:01 appel's:01 closet:99 behold:01 recognizable:99 recognizes:01 ocaml:01 ocaml:01 heh:01 parser:02 parser:02 meaningful:04 detect:06 habits:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Heh! I just dug out Andrew Appel's book from the closet and began reading it anew. Lo and behold, he shows how grammars that invite reduce/reduce conflicts are best handled by opening up the universe of sytactically recognizable sentences -- well beyond anything meaningful for the language at hand -- and then using a later semantic analysis stage to detect and report the error. So this explains why the parser.ml for OCaml has all those apparently illegal accepting clauses in it. The parser recognizes all kinds of wild things that would be patently invalid OCaml code. I began life in this field more than 30 years ago using a simple language called Forth to control a large 100 inch telescope in Wyoming... I learned many "bad habits" in programming -- most notably to write code that works when fed correct input for its intended purpose -- and to hell with what happens in any other case. I watched and learned from the practicioners of this language what I came to call "Kamakazi Programming Style". Now after spending the last 30 years trying hard to overcome these initial misguidings, I find once again, that this is the appropriate solution -- at least in the parsing stage. Very interesting... David McClain Senior Corporate Scientist Avisere, Inc. david.mcclain@avisere.com +1.520.390.7738 (USA) ------------------- 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