caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Casteran <pierre.casteran@labri.fr>
To: Jonathan Roewen <jonathan.roewen@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Creating a tree type
Date: Wed,  9 Feb 2005 07:43:10 +0100	[thread overview]
Message-ID: <1107931390.4209b0fea7f00@mailhost.labri.fr> (raw)
In-Reply-To: <ad8cfe7e0502082028bd9caeb@mail.gmail.com>

Hello,

Did you look at Huet's zippers ?

http://caml.inria.fr/archives/200304/msg00202.html

Pierre


Selon Jonathan Roewen <jonathan.roewen@gmail.com>:

> On Mon, 7 Feb 2005 16:01:01 +0000, Jon Harrop <jon@jdh30.plus.com> wrote:
> > On Monday 07 February 2005 11:41, Jonathan Roewen wrote:
> > > What would be the best approach to creating a tree type such that at
> > > each node, it has some sort of reference to the parent node...
> >
> > Adding references to the parent of each node in a tree makes the data
> > structure a graph and not a tree.
> >
> > This can be implemented in several ways. However, I strongly recommend that
> > you do not do this to begin with, for several reasons:
>
> Okay, so I realised I could just use a Stack to track a walk through the
> tree...
>
> A couple more questions though:
>
> 1. For the Stack, when I put something in it, is it copied or what?
> How does that work?
>
> 2. How do I make my tree like a hashtable, i.e. modifications are done
> in-place? Some sort of nested Map or something? Using lists to build
> up the tree would cause pain when wanting to modify it. It would also
> seem inefficient to use lists for this particular use case.
>
> Regards,
>
> Jonathan.
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


-- 
Pierre Casteran
(+33) 540006931

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


      reply	other threads:[~2005-02-09  6:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-07 11:41 Jonathan Roewen
2005-02-07 11:58 ` Richard Jones
     [not found] ` <200502071601.01981.jon@jdh30.plus.com>
2005-02-09  4:28   ` Jonathan Roewen
2005-02-09  6:43     ` Pierre Casteran [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=1107931390.4209b0fea7f00@mailhost.labri.fr \
    --to=pierre.casteran@labri.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=jonathan.roewen@gmail.com \
    /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).