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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 72C35BBC1 for ; Thu, 21 Feb 2008 17:40:12 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADA4vUdA6bjhkWdsb2JhbACQXQEBAQEHBAQLCBEHl2KHEg X-IronPort-AV: E=Sophos;i="4.25,387,1199660400"; d="scan'208";a="22881156" Received: from wr-out-0506.google.com ([64.233.184.225]) by mail4-smtp-sop.national.inria.fr with ESMTP; 21 Feb 2008 17:40:11 +0100 Received: by wr-out-0506.google.com with SMTP id 68so153808wri.3 for ; Thu, 21 Feb 2008 08:40:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=1U7dx3SNig0qSMzZtFwtsnl8jHBLTnz8z9HVQljAtGg=; b=VIkqNcMFDWXzAZcOgkxiaESERG3EU7MTZO0ijOoZiCCrg3PyBbeUe1x6QBtclmEdf8yfKnOHi8qK+wh3XxETi5CAwB95/G+2kBoLFaNr4/egW9Tvwv64Jj3J1+VZ98ebkWVN3ZFoNGht3/ADOW1sQ0wvrz8qxnZP5ECVuoDv8BI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=KFI2Szw6MP6M+HTeQgY0FlxOVRyl5Xraylnys+aDahqTrS5toJG8WrOcQp7tcqKW233dHQ3yUMZsjZylgxanyowWNx/5YWGhe0UFGIuL6PE0ovwZRNnPZbJBOMjdk9jSwhZEnqrm6U53t+B2LipIlsJhrfS+LON8TAVFvYM72BU= Received: by 10.142.191.2 with SMTP id o2mr7764111wff.209.1203612009100; Thu, 21 Feb 2008 08:40:09 -0800 (PST) Received: by 10.142.134.13 with HTTP; Thu, 21 Feb 2008 08:40:09 -0800 (PST) Message-ID: <4a051d930802210840g31dc1cdds38123dc194db3b65@mail.gmail.com> Date: Thu, 21 Feb 2008 11:40:09 -0500 From: "Christopher L Conway" Sender: christopherleeconway@gmail.com To: "Damien Doligez" Subject: Re: [Caml-list] Re: large hash tables Cc: "Caml Mailing List" In-Reply-To: <055012C9-F9CC-4252-8520-64860F8F388D@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <55e81f00-5ef7-4946-9272-05595299e114@41g2000hsc.googlegroups.com> <33d2b3f70802192118p4d887212mcf76e34447c54e52@mail.gmail.com> <4a051d930802200802w6c0e9a0ayde1000f1b4584753@mail.gmail.com> <055012C9-F9CC-4252-8520-64860F8F388D@inria.fr> X-Google-Sender-Auth: 1aeca67992c58049 X-Spam: no; 0.00; hash:01 damien:01 damien:01 20,:98 doligez:01 doligez:01 wrote:01 wrote:01 caml-list:01 append:02 append:02 functional:02 let:03 let:03 thu:05 On Thu, Feb 21, 2008 at 8:54 AM, Damien Doligez wrote: > > On 2008-02-20, at 17:02, Christopher L Conway wrote: > > >> let newList = List.rev_append [newElement] oldList in > > > > This is what is known as a "functional anti-pattern" [1]. > > Not really. This is just a rather long-winded way to write > > let newList = newElement :: oldList in > > but it doesn't take much more time or memory to execute. That was silly of me. A point (not my original point) still stands: the code is non-idiomatic. List.rev_append [newElement] oldList = List.append [newElement] oldList = newElement :: oldList Regards, Chris