From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id DA28CBB91 for ; Sun, 26 Dec 2004 14:09:05 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iBQD95cF006089 for ; Sun, 26 Dec 2004 14:09:05 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA17879 for ; Sun, 26 Dec 2004 14:09:05 +0100 (MET) Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBQD94ru017041 for ; Sun, 26 Dec 2004 14:09:04 +0100 Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef2.ens.fr (8.12.11/1.01.28121999) with ESMTP id iBQD94T9078311 for ; Sun, 26 Dec 2004 14:09:04 +0100 (CET) Received: from (george@localhost) by clipper.ens.fr (8.13.1/jb-1.1) Date: Sun, 26 Dec 2004 14:09:04 +0100 From: Nicolas George To: Caml mailing list Subject: Re: [Caml-list] Checking for eof Message-ID: <20041226130904.GA24805@clipper.ens.fr> References: <20041226011212.GA10516@gentoo.malaquias.no-ip.org> <16846.6882.973973.179486@soggy.deldotd.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline In-Reply-To: <16846.6882.973973.179486@soggy.deldotd.com> User-Agent: Mutt/1.4.2i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.10 (nef2.ens.fr [129.199.96.32]); Sun, 26 Dec 2004 14:09:04 +0100 (CET) X-Miltered: at concorde with ID 41CEB7F1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41CEB7F0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 nivose:01 ocaml:01 syntax:01 unpack:01 syntax:01 stand-alone:01 semantics:01 ...:98 ...:98 exceptions:01 checking:01 nicolas:02 nicolas:02 awkward:02 X-Attachments: type="application/pgp-signature" X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le sextidi 6 niv=F4se, an CCXIII, briand@aracnet.com a =E9crit=A0: > try > (input_line chan), false > with > | End_of_file -> "", true I would have written that try Some (input_line chan) with | End_of_file -> None but the idea is the same. I find it is an irritating limitation of OCaml syntax to have to pack and then unpack all local values in order to uncatch exceptions. Something like try let line =3D input_line chan in untry loop (line :: rlst) with | End_of_file -> List.rev rlst This syntax is somewhat awkward: untry is neither a third member of the try...with structure, because it must be inside the flow of let...in declaration, nor a stand-alone statement, because it must not be allowed anywhere outside try...with. On the contrary, as far as I can see, the semantics is quite simple. --PEIAKu/WMn1b1Hv9 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (SunOS) iD8DBQFBzrfwsGPZlzblTJMRAo72AJ9pQ3aqAmt3nO+ASTXVjNvu1lx3HgCgwFFf lLrEjYWStVntUcxrFFYKjO4= =f/DV -----END PGP SIGNATURE----- --PEIAKu/WMn1b1Hv9--