From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 71CC07EE5B for ; Wed, 14 May 2014 22:57:35 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of milanst@gmail.com) identity=pra; client-ip=209.85.213.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="milanst@gmail.com"; x-sender="milanst@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of milanst@gmail.com designates 209.85.213.170 as permitted sender) identity=mailfrom; client-ip=209.85.213.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="milanst@gmail.com"; x-sender="milanst@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ig0-f170.google.com) identity=helo; client-ip=209.85.213.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="milanst@gmail.com"; x-sender="postmaster@mail-ig0-f170.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al8BADLYc1PRVdWqlGdsb2JhbABZhC2CaMMGAYEeCBYOAQEBAQcLCwkSKoIlAQEFIx0BGxAKAwEDDAYFCw0CAiYCAiIBEQEFARwGE4gsAQMRoC2MEVGDDZooChknDWSFVhEBBQyBHo0kB4J1gUsEmVGRIxgphQIh X-IPAS-Result: Al8BADLYc1PRVdWqlGdsb2JhbABZhC2CaMMGAYEeCBYOAQEBAQcLCwkSKoIlAQEFIx0BGxAKAwEDDAYFCw0CAiYCAiIBEQEFARwGE4gsAQMRoC2MEVGDDZooChknDWSFVhEBBQyBHo0kB4J1gUsEmVGRIxgphQIh X-IronPort-AV: E=Sophos;i="4.97,1054,1389740400"; d="scan'208";a="73714724" Received: from mail-ig0-f170.google.com ([209.85.213.170]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 14 May 2014 22:57:34 +0200 Received: by mail-ig0-f170.google.com with SMTP id r10so7655904igi.3 for ; Wed, 14 May 2014 13:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=KIWVf6RehuqKBWcvattCl+LHK/t2cN4sF5uQ/skxsj8=; b=wpDYtQhHzBT3ITlxrbP8wY9ucCGMn3ItjaWKhFgibBdNiPndkIBsNgPrM4IBS6WB1A G5oRI3IF9IeGyvIV9GXWlc6Ld/UMVPVWWbIS4+sDd6llQTE4KsA2dPhW2T58KUs/Qcup 47o4J5yeDsH9JPphPb46zevGFcQbyXczbrqtHNR75cTuWYs1WKuz9BKJf1Zp/7O1PuqP VWZVRtSrUr5x9y16uo3KaXDzbhZ0RKjzQs0zcUJ+y0RPrTDgxS0BO7JnCevCPtL8n4sV IiCo9NBI08qjcLij1NvIvHGHhDT1xUkEfXZSN1n9MVxnNQcp2nQfMrwPcisMIgh/oYcb fp4Q== X-Received: by 10.50.79.202 with SMTP id l10mr68052474igx.23.1400101053435; Wed, 14 May 2014 13:57:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.141.114 with HTTP; Wed, 14 May 2014 13:56:53 -0700 (PDT) In-Reply-To: <5373B924.9020206@lexifi.com> References: <5373B8C5.2000804@frisch.fr> <5373B924.9020206@lexifi.com> From: =?UTF-8?Q?Milan_Stanojevi=C4=87?= Date: Wed, 14 May 2014 16:56:53 -0400 Message-ID: To: Alain Frisch Cc: Jeremie Dimino , Caml List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] open extensible types representation On Wed, May 14, 2014 at 2:42 PM, Alain Frisch wrote: > On 05/14/2014 08:41 PM, Alain Frisch wrote: >> >> One could think about improving that, for instance by matching first on >> the constructor name (relying on the new much-improved compilation for >> pattern matching on strings). But this doesn't work in presence of >> constructor rebinding (which can change the name). > > > Well, of course, one could always use this technique as a fast path and use > linear search as fall back. It's not clear that the gain justifies the > extra effort. And linear search is likely faster for a small number of variants. The rebinding of constructors is interesting. What are uses case apart from reducing verbosity in some cases?