From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0KE5ekG008404 for ; Fri, 20 Jan 2012 15:05:40 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgECAGx0GU/RVaG2kGdsb2JhbABDgw2Bd6h1CCIBAQEBCQkNBxQEIYFyAQEBBBICDxUIARscAgMMBgULDQICBRYLAgIJAwIBAgEREQEFARwGAQwIAQEeoyUKiyJIgm+EdT+IcQIFC4EkiWGBFgSIPIxdhVWBN4cEPYQc X-IronPort-AV: E=Sophos;i="4.71,542,1320620400"; d="scan'208";a="140742448" Received: from mail-gx0-f182.google.com ([209.85.161.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Jan 2012 15:05:27 +0100 Received: by ggki1 with SMTP id i1so350123ggk.27 for ; Fri, 20 Jan 2012 06:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=BvOatumT/vSZ1N8T0w+9X1gmuTBwfumRPiP1U71LnLA=; b=lmGTODA2BCrn0yVOjjm85FCGoa8L7nlrUI95O1X06wcaYn1EZdKmDJrY0YQ++Rem73 vRGb1+7ko91SNnh4ivtEdd9cIatAHD0d6Rkf6gmIinaDWunQtFS2In4L9CTULXC9Waiy 7Z5CjE9qM1maHCZlDSIgyBwKukU7lk66P5N68= Received: by 10.50.156.138 with SMTP id we10mr2767120igb.10.1327068327014; Fri, 20 Jan 2012 06:05:27 -0800 (PST) Received: from [192.168.1.65] (99-121-78-10.lightspeed.lnngmi.sbcglobal.net. [99.121.78.10]) by mx.google.com with ESMTPS id 5sm10284905ibe.8.2012.01.20.06.05.25 (version=SSLv3 cipher=OTHER); Fri, 20 Jan 2012 06:05:26 -0800 (PST) Message-ID: <4F1974A2.1030701@gmail.com> Date: Fri, 20 Jan 2012 09:05:22 -0500 From: Edgar Friendly User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 MIME-Version: 1.0 To: oliver , caml-list@inria.fr References: <4F196C25.7070402@gmail.com> <20120120135814.GB2927@siouxsie> In-Reply-To: <20120120135814.GB2927@siouxsie> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] is there a more concise way to write this? On 01/20/2012 08:58 AM, oliver wrote: > On Fri, Jan 20, 2012 at 08:29:09AM -0500, Edgar Friendly wrote: > [...] >> if a then if b then [a;b] else [a] >> else if b then [b] else [] > [...] > > For me, the original pattern matching code looks much easier to read. > I agree - this was not meant to be a suggestion on how to make the original code easy to read, but instead to point out that it's as efficient as this ugly "optimized" code. I included it in my benchmark as well for only this reason, to verify that the original code was as efficient as it. E.