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=AWL 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 1946BBBAF for ; Thu, 24 Jul 2008 21:28:01 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAGR0iEiAKgEfiGdsb2JhbACSVAEBAQ8gnyQ X-IronPort-AV: E=Sophos;i="4.31,248,1215381600"; d="scan'208";a="13427259" Received: from mail.cs.rice.edu ([128.42.1.31]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Jul 2008 21:28:00 +0200 Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 136A12C2AD0 for ; Thu, 24 Jul 2008 14:27:59 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ry9PeL-r-pax for ; Thu, 24 Jul 2008 14:27:58 -0500 (CDT) Received: from [10.121.20.231] (unknown [10.121.20.231]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 6E3B22C2A91 for ; Thu, 24 Jul 2008 14:27:58 -0500 (CDT) Message-ID: <4888D7B7.8030703@rice.edu> Date: Thu, 24 Jul 2008 14:27:51 -0500 From: Raj Bandyopadhyay User-Agent: Thunderbird 2.0.0.14 (X11/20080502) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: equality operators in OCaml Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 pointer:01 equality:01 equality:01 match:02 raj:05 raj:05 comparison:05 implementing:06 entity:08 resolve:08 i'm:09 object:09 basically:10 Hi OCaml folk I apologize if I've been asking too many questions on this list recently, but I'm working on a heavy OCaml application and need help sometimes. I am having a disagreement with a colleague about how the equality operators in OCaml work and am trying to resolve it conclusively. 1) I understand that the '==' operator is basically a pointer comparison i.e. a==b true iff a and b are the same entity. Is this true? 2) Where can I find the code implementing the '==' operator in the OCaml code? 3) In case I do want to check object identity and can use the == operator, would it be faster to use '==', '=' or a match statement? Thanks Raj