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.3 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id B7462BBAF for ; Thu, 29 May 2008 06:50:41 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtgFANbSPUhA6bL7aWdsb2JhbACSKA0EAwQJDwWWHocJ X-IronPort-AV: E=Sophos;i="4.27,560,1204498800"; d="scan'208";a="13185399" Received: from hs-out-0708.google.com ([64.233.178.251]) by mail3-smtp-sop.national.inria.fr with ESMTP; 29 May 2008 06:50:41 +0200 Received: by hs-out-0708.google.com with SMTP id h53so359954hsh.11 for ; Wed, 28 May 2008 21:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date:user-agent:content-type:content-transfer-encoding:content-disposition:message-id; bh=dF5h/vgP7ttWpoKIXg5t6HA8hlKmd9C9EJmS7gx11TQ=; b=bHTfAx1R+1DOlTj8KbujyGnD5b33zzSryoh/RoWdD8bnia2DQEW/w/HK9kGvuTcfzZHVHzcogFrYCHX71+edWmQzoHiztwbm5GGbqvmP2VMATC5gSatvgaJNm/a+eEPAwmCRvoYpKvecMnmzwnYi0pW/lYM6fMYE9zgPzzrkRlI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:content-type:content-transfer-encoding:content-disposition:message-id; b=uWtySHi72q1sPQLNTvH8dz062c2lKetIU1tzJmkEEXSl9xWHWWT9DnOYeBKt7//avr/HrKSId1P+Ercz0tODhOgOkYG163dC1edo6mPeZeWD9m4K9Y14r+A9uo8CNyAj6jl3sCe+uYBAo6sCzdqz76ocz8r26LA1WQBWpctYJ3w= Received: by 10.90.68.20 with SMTP id q20mr4638003aga.107.1212036639701; Wed, 28 May 2008 21:50:39 -0700 (PDT) Received: from ?192.168.0.103? ( [24.99.180.210]) by mx.google.com with ESMTPS id n26sm398473ele.13.2008.05.28.21.50.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 28 May 2008 21:50:38 -0700 (PDT) From: Peng Zang Reply-To: peng.zang@gmail.com To: caml-list@yquem.inria.fr Subject: on objects, equality and playing nicely with the stdlib Date: Thu, 29 May 2008 00:50:33 -0400 User-Agent: KMail/1.9.7 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805290050.36980.peng.zang@gmail.com> X-Spam: no; 0.00; stdlib:01 hash:01 subtyping:01 stdlib:01 hashtbl:01 peng:98 peng:98 equality:01 equality:01 polymorphic:01 stack:01 data:02 modules:02 modules:02 namely:02 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello list, Recently, in building some toy games, I've started using objects. I've been pleased with them and often find the subtyping convenient. However, I've run into some issues with the standard physical equality of objects that the (=) operator performs. Namely, it makes several stdlib modules difficult to use. Modules that provides a polymorphic (generic) interface such as Hashtbl, List, Stack, etc.. rely on the (=) operator. This is fine as long as it happens to be what I need. The minute I introduce my own equality however, things break down. What is the best way to go about using the stdlib (or similar) when you have your own equality function? This problem almost never shows up if you just stick with basic data types, but with objects you quickly run into it. Thanks in advance, Peng -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iD8DBQFIPjYcfIRcEFL/JewRAlkvAKCYjJhIc5dw5YMiwUS02LR8RowsDQCgzzAI gpif0G1fWn0vlCzzaoalWa4= =+0ZK -----END PGP SIGNATURE-----