From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 6943ABC6B for ; Wed, 11 Jul 2007 12:10:15 +0200 (CEST) Received: from smtp.irisa.fr (smtp.irisa.fr [131.254.254.26]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6BAAFX1018405 for ; Wed, 11 Jul 2007 12:10:15 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.irisa.fr (Postfix) with ESMTP id EABEDFA9E for ; Wed, 11 Jul 2007 12:10:14 +0200 (CEST) Received: from smtp.irisa.fr ([131.254.254.26]) by localhost (meli.irisa.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22992-04; Wed, 11 Jul 2007 12:10:12 +0200 (CEST) Received: from [131.254.14.123] (eltanin.irisa.fr [131.254.14.123]) by smtp.irisa.fr (Postfix) with ESMTP id 4552BFA8E; Wed, 11 Jul 2007 12:10:12 +0200 (CEST) Message-ID: <4694AC82.2060001@irisa.fr> Date: Wed, 11 Jul 2007 12:10:10 +0200 From: Sebastien Ferre Organization: IRISA User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: caml-list@inria.fr Cc: =?UTF-8?B?U8OpYmFzdGllbiBGZXJyZQ==?= Subject: syntax changes from 3.08 to 3.10 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at irisa.fr X-Miltered: at concorde with ID 4694AC87.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; irisa:01 syntax:01 3.08:01 ocaml:01 3.08:01 syntax:01 ocaml:01 bool:01 camlp:01 ocamlc:01 -pp:01 work-around:01 val:01 val:01 bug:01 Hi, moving my application from OCaml 3.08 to 3.10, I encountered 2 syntax problems, i.e. syntax errors when compiling: 1. record copy and modification: {f x with y = 1; z = 2} this can be solved by parenthesizing the evaluation of the record to be copied. {(f x) with y = 1; z = 2} 2. object copy and modification in a method: {< x = 1; y = 2>} OCaml says the first field is a bool instead of an int, which leads me to think it parenthesizes in the following way: {< x = (1; y = 2)>} In fact, this behaviour is only when compiling with camlp4o: ocamlc -pp ocamlp4o ... The work-around I found to implement a copy method is as follows: class c = object (self) val x = 0 val y = 0 method copy = (Oo.copy self) # copy_aux method private copy_aux = x <- 1; y <- 2; self end Has anybody encountered the same problem ? Is there a better workaround ? Is it a bug ? Sébastien