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=1.5 required=5.0 tests=SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id F236FBBAF for ; Sun, 14 Jun 2009 18:32:46 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnUCAFjDNErUGyoClGdsb2JhbACBT5Z3AQEBAQcNCAkTA7cxhA0F X-IronPort-AV: E=Sophos;i="4.42,218,1243807200"; d="scan'208";a="28044797" Received: from smtp2-g21.free.fr ([212.27.42.2]) by mail2-smtp-roc.national.inria.fr with ESMTP; 14 Jun 2009 18:32:46 +0200 Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id 5F6834B003F for ; Sun, 14 Jun 2009 18:32:40 +0200 (CEST) Received: from macbookpro.local (lns-bzn-48f-81-56-220-129.adsl.proxad.net [81.56.220.129]) by smtp2-g21.free.fr (Postfix) with ESMTP id 64D9D4B007C for ; Sun, 14 Jun 2009 18:32:38 +0200 (CEST) Message-ID: <4A352717.7020909@univ-savoie.fr> Date: Sun, 14 Jun 2009 18:36:39 +0200 From: Christophe Raffalli User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: OCaml Subject: evaluation order Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; christophe:01 raffalli:01 raffalli:01 univ-savoie:01 ocaml-:01 bytecode:01 nativecode:01 decr:01 ocamlc:01 ocamlopt:01 bug:01 cheers:01 christophe:01 pair:01 int:01 Hello, In OCaml-3.11.1 (I did not try other version), the following code print 0 when compiled in bytecode and 1 in nativecode for obvious reason of different evaluation order in the pair ... let ptr = ref 0 let fn b = if b then incr ptr else decr ptr let c = fn true, !ptr let _ = print_int (snd c); print_newline () Is any difference between ocamlc and ocamlopt a bug ? Cheers, Christophe