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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 853D67F75C for ; Wed, 10 Sep 2014 14:56:47 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of bmillwood@janestreet.com) identity=pra; client-ip=38.105.200.233; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bmillwood@janestreet.com"; x-sender="bmillwood@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of bmillwood@janestreet.com designates 38.105.200.233 as permitted sender) identity=mailfrom; client-ip=38.105.200.233; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bmillwood@janestreet.com"; x-sender="bmillwood@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mxout4.mail.janestreet.com) identity=helo; client-ip=38.105.200.233; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="bmillwood@janestreet.com"; x-sender="postmaster@mxout4.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AucBAC5KEFQmacjpnGdsb2JhbABZhDcEgnjPBwGBBggWEAEBAQEBBhYJPoQEAQEEEhEdAQE3AQ8LCwMKAgImAgIiEgEFARwGEyKIIAOcNWuKOHiBbYMVAQWQGgERBgqBIo4hB4J5gVOaa4INh0GLexgpgxocgV1rgk8BAQE X-IPAS-Result: AucBAC5KEFQmacjpnGdsb2JhbABZhDcEgnjPBwGBBggWEAEBAQEBBhYJPoQEAQEEEhEdAQE3AQ8LCwMKAgImAgIiEgEFARwGEyKIIAOcNWuKOHiBbYMVAQWQGgERBgqBIo4hB4J5gVOaa4INh0GLexgpgxocgV1rgk8BAQE X-IronPort-AV: E=Sophos;i="5.04,499,1406584800"; d="scan'208";a="78442905" Received: from mxout4.mail.janestreet.com ([38.105.200.233]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 10 Sep 2014 14:56:44 +0200 Received: from tot-oib-smtp1.delacy.com ([172.27.22.15] helo=tot-smtp) by mxout4.mail.janestreet.com with esmtps (UNKNOWN:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1XRhRv-0005JX-0H for caml-list@inria.fr; Wed, 10 Sep 2014 08:56:39 -0400 Received: from [172.27.229.230] (helo=mxgoog1.mail.janestreet.com) by tot-smtp with esmtps (UNKNOWN:AES256-GCM-SHA384:256) (Exim 4.72) (envelope-from ) id 1XRhRu-0007yO-TV for caml-list@inria.fr; Wed, 10 Sep 2014 08:56:38 -0400 Received: from mail-qa0-f48.google.com ([209.85.216.48]) by mxgoog1.mail.janestreet.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.72) (envelope-from ) id 1XRhRu-0006xP-Qj for caml-list@inria.fr; Wed, 10 Sep 2014 08:56:38 -0400 Received: by mail-qa0-f48.google.com with SMTP id v10so1792191qac.7 for ; Wed, 10 Sep 2014 05:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ix/6RkkfdiZAg4qjZLv3+L6G0IGaO3LpdS+wMuFZ+wI=; b=hjImHIz5zAB58SN2yNrg0qbU6Lq9/TKP+KkJ9RmHfnBQvABs+AJeBSTifnzB3q64v8 TLsNb6D5LIBM76y7GmNPC8wGDQ6OrAa10xmuhDQ53iOmnel9aHm4bYqV9UQtq6DofVQe 91KgzztpSWDydEc5bw29UcQpoDOJc4Pv3/9LY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Ix/6RkkfdiZAg4qjZLv3+L6G0IGaO3LpdS+wMuFZ+wI=; b=XX4rqIa7UKro+xSV5xSkGpS0I/UzDlQEdf2BceaG+nRT/eX8nzBJr/L8qBwdDwzOc/ pLwTYoKdawm6ZEjOlp2OUNRp0t7AZpGKGRQCmI+j8kOBExbukqnD2L9rP5gCQIdaoSTo 0mLBIzAPoPCJQYpi1QNYBCzlqv6JpCDkq4N7y5YmrCoZtjLJynWWggjA7drMsFID2Bc6 JnHfQbnz5GjpLcb53CywyFECNg3aCokpXIOt1CalL7ByraNgacgLhTc89WgFLA+MLIw0 VZVTg9/bnWBdHYGxtGMcU9hlb8Nf6ZKEtEAmAyflDIxFY1SzqUJ76TnwmNT1ovsT2l6Q vyJg== X-Gm-Message-State: ALoCoQnVVPJ9Sl/G+rEGakZQWvswrrC41lr2eq0iWZIR5MqsQx1JI98Uf1onXWfTnS8J+lQga/uQF8ctsDpgbeJ5EKgLY8gOGiYQhppHgH3emGiKsbJQVAp7RWy+P+PcRWGoSWOy392B X-Received: by 10.224.161.140 with SMTP id r12mr60512737qax.74.1410353798606; Wed, 10 Sep 2014 05:56:38 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.224.161.140 with SMTP id r12mr60512724qax.74.1410353798525; Wed, 10 Sep 2014 05:56:38 -0700 (PDT) Received: by 10.140.34.107 with HTTP; Wed, 10 Sep 2014 05:56:38 -0700 (PDT) In-Reply-To: <1410353499.3003.29.camel@thinkpad> References: <54101221.3010304@users.sourceforge.net> <1410348425.3003.11.camel@thinkpad> <1410351988.3003.19.camel@thinkpad> <20140910124101.GA30231@xinutec.org> <1410353499.3003.29.camel@thinkpad> Date: Wed, 10 Sep 2014 13:56:38 +0100 Message-ID: From: Ben Millwood To: Gerd Stolpmann Cc: Pippijn van Steenhoven , caml users Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Clarification for the configuration of comparison functions On 10 September 2014 13:51, Gerd Stolpmann wrote: > Am Mittwoch, den 10.09.2014, 13:41 +0100 schrieb Pippijn van Steenhoven: >> Also, if you store the hash before the actual value, compare will >> probably stop comparing after it finds that the hashes are not equal, so >> you can simply use the polymorphic compare on t_cmp. I don't know this >> for sure, since I haven't looked at the source, but I would assume this >> is true. > > The OCaml manual doesn't define compare for tuples, so you cannot > exploit that. I wouldn't bet that compare runs from left to right over > the values, as OCaml is known for sometimes preferring right to left. > But maybe this could be a future language feature? If the OCaml manual > defined compare on tuples, this would in deed be a fine trick. On the other hand, perhaps the fact that no-one is sure without checking whether or not this works is indication enough that it is too clever a trick for its own good, and just doing the obviously-right thing is a more sensible option :)