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 QAA14310; Wed, 15 Sep 2004 16:50:57 +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 QAA01568 for ; Wed, 15 Sep 2004 16:50:54 +0200 (MET DST) Received: from francois.mpi-sb.mpg.de (francois.mpi-sb.mpg.de [139.19.1.2]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8FEor1v028831 for ; Wed, 15 Sep 2004 16:50:54 +0200 Received: from amavis by francois.mpi-sb.mpg.de with scanned-ok (Exim 3.35 #1 (Debian)) id 1C7b7U-0003eG-00 for ; Wed, 15 Sep 2004 16:50:52 +0200 Received: from maildist ([139.19.90.238] helo=mpi-sb.mpg.de) by francois.mpi-sb.mpg.de with esmtp (Exim 3.35 #1 (Debian)) id 1C7b7P-0003dm-00; Wed, 15 Sep 2004 16:50:47 +0200 Received: from mpiat2314 (Debian-exim@mpiat2314 [139.19.20.103]) by mpi-sb.mpg.de (8.12.9+Sun/8.12.9) with ESMTP id i8FEolqs029833; Wed, 15 Sep 2004 16:50:47 +0200 (MEST) Received: from localhost.mpi-sb.mpg.de ([127.0.0.1] helo=mpiat2314 ident=prevosto) by mpiat2314 with smtp (Exim 4.34) id 1C7b7P-0000UZ-F0; Wed, 15 Sep 2004 16:50:47 +0200 Date: Wed, 15 Sep 2004 16:50:46 +0200 From: Virgile Prevosto To: Radu Grigore Cc: caml-list@inria.fr Subject: Re: [Caml-list] Confused Message-ID: <20040915165046.081f6b31@mpiat2314> In-Reply-To: <7f8e92aa04091507237e187ac5@mail.gmail.com> References: <41472EC6.2080007@gmx.net> <200409151428.54124.jon@jdh30.plus.com> <200409151513.13792.jon@jdh30.plus.com> <7f8e92aa04091507233d074f31@mail.gmail.com> <7f8e92aa04091507237e187ac5@mail.gmail.com> X-Mailer: Sylpheed-Claws 0.9.12a (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by AMaViS perl-11 X-Miltered: at concorde with ID 414856CD.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; virgile:01 prevosto:01 prevosto:01 caml-list:01 camlp:01 ctrl-c:01 camlp:01 755:99 'let:01 virgile:01 ecrit:01 ocaml:01 ocaml:01 caml:01 rec:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Le 15.09.2004, =E0 17:23:48, Radu Grigore a =E9crit: > But it still doesn't explain why I was unable to exit ocaml > interactive interpreter after loading camlp4r and typing your exact > example: exit doesn't work, #quit doesn't work, ctrl-C doesn't work, > etc. The only solution that worked was ctrl-Z followed by "kill". >=20 because camlp4R loads the Revised syntax, in which toplevel sentences are ended by a single semicolumn, not a double one: ~ [754]$ ocaml Objective Caml version 3.08.1 # #load "camlp4r.cma";; (* normal syntax, use ';;' *) Camlp4 Parsing version 3.08.1 # exit 0; (* revised syntax, use ';' *) ~ [755]$ To go back to the initial question, note that the revised syntax has two different keywords for global declaration and local binding: the former is introduced by 'value', while the latter is still 'let ... in'. Hence, you'll have to write # #load "camlp4r.cma";; # value test =3D=20 let rec build =3D=20 fun [0 -> [] | n -> [1e-6 :: build (n-1)]]=20 in [1.::(build 1000)];=20 (* There are also differences in lists and pattern-matching syntax *) value test : list float =3D [1; 1e-06; 1e-06; 1e-06; 1e-06; 1e-06; 1e-06; 1e-06; 1e-06; 1e-06; 1e-06; The revised syntax is described in the chapter 6 of the camlp4 manual. --=20 E tutto per oggi, a la prossima volta Virgile ------------------- 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