caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Noel Welsh <noelwelsh@yahoo.com>
To: Brian Hurt <brian.hurt@qlogic.com>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Probably FAQ: Why is list-append (list :: elem) so expensive?
Date: Wed, 25 Sep 2002 08:39:18 -0700 (PDT)	[thread overview]
Message-ID: <20020925153918.52238.qmail@web11205.mail.yahoo.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0209250958520.1974-100000@eagle.ancor.com>

O'Caml's heritage is from the functional world, so
side-effects are discouraged.  Maintaining a tail
pointer requires side-effects.  

For more insight consider that a list is defined by
its recursive definition:

List 'a :=  Cons 'a * List
        |   Null

A list is a cons cell containing an element and the
rest of the list, or null, which terminates the list. 
Now tell me which cons cell is the head, and so should
maintain the tail pointer. Welcome to a world of pain!

HTH,
Noel


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-09-25 15:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-25 15:33 Brian Hurt
2002-09-25 15:39 ` Noel Welsh [this message]
2002-09-25 15:42 ` Oleg
2002-09-25 16:17 ` Markus Mottl
2002-09-25 18:44   ` Brian Hurt
2002-09-25 19:22     ` Markus Mottl
2002-09-26  7:10     ` Florian Hars
2002-09-26 14:44 ` Kontra, Gergely

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=20020925153918.52238.qmail@web11205.mail.yahoo.com \
    --to=noelwelsh@yahoo.com \
    --cc=brian.hurt@qlogic.com \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).