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 VAA26822; Wed, 4 Sep 2002 21:50:09 +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 VAA26802 for ; Wed, 4 Sep 2002 21:50:08 +0200 (MET DST) Received: from hirsch.in-berlin.de (hirsch.in-berlin.de [192.109.42.6]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g84Jo7127513; Wed, 4 Sep 2002 21:50:07 +0200 (MET DST) Received: from hirsch.in-berlin.de (localhost [127.0.0.1]) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with ESMTP id g84Jo5mg003564 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT); Wed, 4 Sep 2002 21:50:05 +0200 Received: (from uucp@localhost) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with UUCP id g84Jo1k1003540; Wed, 4 Sep 2002 21:50:01 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: caml-list@inria.fr Received: from localhost (oliver@localhost) by first.in-berlin.de (8.7.6/8.7.3) with SMTP id VAA00221; Wed, 4 Sep 2002 21:46:53 +0200 Date: Wed, 4 Sep 2002 21:46:53 +0200 (MET DST) From: Oliver Bandel To: Daniel de Rauglaudre cc: caml-list@inria.fr Subject: Re: [Caml-list] Camlp4-tutorial-Example In-Reply-To: <20020903090842.B30173@verdot.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Tue, 3 Sep 2002, Daniel de Rauglaudre wrote: > Hi, > > On Mon, Sep 02, 2002 at 10:52:27PM +0200, Oliver Bandel wrote: > > > What I do not understand: > > This calculator knows that * and / have higher Priority > > than + and -. > > How is this achieved? > > By the order of the rules. The rules with same priority are grouped > together: > [ ... | ... | ... ] > > and there is another level of parentheses (of bracket parentheses) > separated by vertical bars to indicate the priority: > [ > [ ... | ... | ... ] (* lowest priority *) > | [ ... | ... | ... ] ... > | [ ... | ... | ... ] (* highest priority *) > ] [...] Ok, that was surprising. But it's a very good idea. :) BTW: The problem in the tutorial, I mentioned was my own: I wrote wrong code. But the reason was, that I didn't understand how the Camlp4 really works (the Grammar-Module). I now print the tutorial out to paper, and hope I will see problems better than on screen. But in general, Ocaml-Software seems to be written for many-years-Ocaml-programmers: They are very fluently in understanding the mli-files and using them as sufficient for programming. Maybe I should read more informations7documentations about the Module-system, so that I can rely on the same mechanism: Reading the mli-files to understand the programs. But nevertheless, an overwiev-documentation is always a good Idea. I hope that I will understand the Camlp4-tutorial, now where I can write my comments on the paper. ;-) > > > I didn't find any entries, that provide priority-distinction > > between +,-,*,/. > > Forget Yacc! :-) OK, I decided to forget it now. What is yacc? ;-) > > > Is the Grammar-Module magic? > > (Gramagic?) > > What do you mean by "magic"? It was a joke. :) It looked like the Camlp4-Preprocessor and the Grammar-Module did know, what to do, and how to handle mathematical operations. After experimenting with changing the levels of the tutorial's code, I thought, that the levels may be levels of priority. I thought, not to read it in the tutorial, but maybe I have not seen it there. I will reread the tutorial in a more patient manner. Ciao, Oliver ------------------- 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