From: "Christopher L Conway" <cconway@cs.nyu.edu>
To: "Damien Doligez" <damien.doligez@inria.fr>
Cc: "Caml Mailing List" <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Re: large hash tables
Date: Thu, 21 Feb 2008 11:40:09 -0500 [thread overview]
Message-ID: <4a051d930802210840g31dc1cdds38123dc194db3b65@mail.gmail.com> (raw)
In-Reply-To: <055012C9-F9CC-4252-8520-64860F8F388D@inria.fr>
On Thu, Feb 21, 2008 at 8:54 AM, Damien Doligez <damien.doligez@inria.fr> 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
prev parent reply other threads:[~2008-02-21 16:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.XXbywsQknpl7bhlesWN8vFLM58c@ifi.uio.no>
[not found] ` <55e81f00-5ef7-4946-9272-05595299e114@41g2000hsc.googlegroups.com>
2008-02-20 5:18 ` John Caml
2008-02-20 6:11 ` [Caml-list] " Francois Rouaix
2008-02-20 8:37 ` David Allsopp
2008-02-20 8:44 ` Alain Frisch
2008-02-20 13:37 ` Damien Doligez
2008-02-20 14:37 ` Oliver Bandel
2008-02-20 16:02 ` Christopher L Conway
2008-02-21 13:54 ` Damien Doligez
2008-02-21 16:40 ` Christopher L Conway [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a051d930802210840g31dc1cdds38123dc194db3b65@mail.gmail.com \
--to=cconway@cs.nyu.edu \
--cc=caml-list@yquem.inria.fr \
--cc=damien.doligez@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox