From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 1C55881792 for ; Tue, 9 Jul 2013 22:50:25 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.17.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=mailfrom; client-ip=212.227.17.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.17.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqkCAE533FHU4xELnGdsb2JhbABbv2uCOoJuBAGBGhYOAQEBAQEGDQkJFCiCIwEBBTIBVgsYCSUPBSiIMAEWsGMfiQmOVIEeFoJzawOXU4YRjkw X-IPAS-Result: AqkCAE533FHU4xELnGdsb2JhbABbv2uCOoJuBAGBGhYOAQEBAQEGDQkJFCiCIwEBBTIBVgsYCSUPBSiIMAEWsGMfiQmOVIEeFoJzawOXU4YRjkw X-IronPort-AV: E=Sophos;i="4.87,1030,1363129200"; d="scan'208";a="25273574" Received: from mout.web.de ([212.227.17.11]) by mail2-smtp-roc.national.inria.fr with ESMTP; 09 Jul 2013 22:50:14 +0200 Received: from frosties.localnet ([95.208.119.3]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LhNs4-1URwgt32mW-00mbAI for ; Tue, 09 Jul 2013 22:50:11 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.80) (envelope-from ) id 1UwerN-0007uH-U0 for caml-list@inria.fr; Tue, 09 Jul 2013 22:50:05 +0200 Date: Tue, 9 Jul 2013 22:50:05 +0200 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20130709205005.GB30194@frosties> References: <51AF09A1.2040002@gmail.com> <51AF0A71.9020302@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <51AF0A71.9020302@inria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:3ynLdiB7necwRAYczysXMKDXT8KGvQJHmN3SvtvG7gX6fsFxxdK JSOiVSgow9keZgBwDbJYDpUTvB16D2FiFyJJHfgthVPT3bV/CyJr4rctX/5+Mn0v5BQ38az dFXE0awxXBO4qHC3TUomlc+uXJGwDT+AhF+lvt6ZKuqBpn0/ZI9jLwY9FwSLgjLBc3nHraV GrGpyw3Ux/QjB/V/ecnRw== Subject: Re: [Caml-list] Ocaml parser reports strange syntax-error position. On Wed, Jun 05, 2013 at 11:52:49AM +0200, Romain Bardou wrote: > Le 05/06/2013 11:49, Matej Kosik a écrit : > > Hi, > > > > If I type this to the Ocaml toplevel: > > > > Printf "%d" 10;; > > > > The actual problem is that instead of "Printf" I should have typed "Printf.printf". > > > > However, the parser complains about literal "10". > > > > Is this the expected behavior or a bug (in parser's error-reporting routines)? > > > > I guess it believes Printf here is not a module name (there is no dot) > but a constructor (it is a capitalized identifier). But the syntax for > constructors is either: > A > A x > A (x1, ..., xn) > In other words, if A is a constructor, "A x y" is never a valid > expression. It could also be a type error ("A x" is not a function, it > cannot be applied) but apparently it is catched by the parser. > > So I would say it is the expected behavior, but that it could be > improved, as all error messages. Can't be a function since it start with an uppercase. Otherwise you are spot on: # Printf "%d";; Error: Unbound constructor Printf MfG Goswin