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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 8B3F67EC41 for ; Tue, 23 Oct 2012 15:31:25 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.223.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.223.182 as permitted sender) identity=mailfrom; client-ip=209.85.223.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ie0-f182.google.com) identity=helo; client-ip=209.85.223.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ie0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8CAHebhlDRVd+2m2dsb2JhbABEr1WNXIQsCCMBAQEBAQgJFBQngh4BAQEEEgIsARsSCwEDDAYFCwMKDSEiAREBBQEKEgYTEgIOh08BAw8LnVQJA4wogWyBCoUHChknAwpZiHUBBQyLUwUihjcDlXGBF41BFimEE4Fa X-IronPort-AV: E=Sophos;i="4.80,635,1344204000"; d="scan'208";a="178544365" Received: from mail-ie0-f182.google.com ([209.85.223.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 23 Oct 2012 15:31:24 +0200 Received: by mail-ie0-f182.google.com with SMTP id k10so9375041iea.27 for ; Tue, 23 Oct 2012 06:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=0Z08D55nYoB4AbY1ofHL5L7oEcMRTa+oSHVd//a+lA0=; b=sf47ccx6UsKqlPgj81XTLh9iD31+aXyapxm7PaiHrkzm16V5UfBJtuNRElEDm1jVEU jF6Bb+Y7guiKFuqh1zWEg5iqpxWPvDMUgNXVXNeD3oXmqHR1hGO1iygZLyzspXeQVPEz xUv8BAfHll6UG1UdUdj5l5XIvp7mi37WniBItYHkW1Ct7bTNmhCbb2Tq4FcCcmZXAItN CGVbgwRIROj03lLdxNYgQQ2gVOFWwUlvqsH3tK9gwjjfc9sCakbQy97niUquWL0ukUsG atdMxUX1yhO/uv5Dby/cYvvHIfXS/lpkmoGFJvwIxHIqFovbpGKSPpS/+uuHrYNgSX1z W7wA== Received: by 10.50.1.170 with SMTP id 10mr12794272ign.2.1350999083610; Tue, 23 Oct 2012 06:31:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.65.9 with HTTP; Tue, 23 Oct 2012 06:30:41 -0700 (PDT) In-Reply-To: <877gqhnzq1.fsf@golf.niidar.ru> References: <877gqhnzq1.fsf@golf.niidar.ru> From: Gabriel Scherer Date: Tue, 23 Oct 2012 15:30:41 +0200 Message-ID: To: Ivan Gotovchits Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] [Batteries or Camlp4] Functionaly updating several fields in an object It appears to be a parsing bug in the 3.11 version of Camlp4. It happens neither with 3.10.2 or with more recent version. (I was lucky to find a machine with 3.11.2 installed; it's good to have rarely-updated servers around) Steps to reproduce: camlp4o -str 'let _ =3D {< a =3D a; b =3D b >}' Observed result: {< a =3D (a; b =3D b); >} Upgrading to a more recent version of OCaml would solve your problem. Otherwise, not using syntax extensions is also fine. On Tue, Oct 23, 2012 at 2:24 PM, Ivan Gotovchits wrote: > > I do not know whether the following behaviour is a bug or a feature, so > I've decided to consult with a community. > > Given a simple definition: > > let create () =3D > object > val a =3D [] > val b =3D [] > method step =3D {< a =3D a; b =3D b; >} > end > > when compiling using batteries extensions: > > ocamlfind ocamlc -c -package batteries.syntax -package lablgtk2 > -package lablgtk2.init -package oUnit -package threads -package uuidm > -syntax camlp4o -thread -package batteries -syntax camlp4o -I +gsl -I > +res -I +xml-light -I +lablgtk2 -I gui -o gui/bug.cmo gui/bug.ml > > I'm receiving the following error: > File "gui/bug.ml", line 7, characters 10-11: > Warning S: this expression should have type unit. > File "gui/bug.ml", line 8, characters 6-11: > Error: This expression has type bool but an expression was expected of ty= pe > 'a list > > It seems that compilet thinks that something like this: > =ABa =3D begin a; b =3D b end=BB. > > After disabling syntax extension everything is ok. > > So the questions: > 1) Is this a bug? If not, then how to overcome this unwanted behaviour? > 2) If this is a bug? What must be blamed: camlp4 or Batteries? > > > Thanks in advance, for any comments! > > P.S. My setup: > OS: Debian Squeeze 6.0.5 > Objective Caml: 3.11.2 > Batteries: 1.2.2-1 > > > > > -- > (__) > (oo) > /------\/ > / | || > * /\---/\ > ~~ ~~ > ...."Have you mooed today?"... > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs