caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: Ocaml <caml-list@inria.fr>
Subject: Accumulating state
Date: Thu, 24 Mar 2005 16:21:50 +0000	[thread overview]
Message-ID: <200503241621.50618.jon@ffconsultancy.com> (raw)


I've just finished converting some library code from imperative to functional 
style. The code is used to represent a scene graph (for graphics). The 
motivation is that the use of a functional style vastly simplifies undo 
buffers, which can (almost) simply use persistence now.

However, I'm finding that it is too easy to accumulate the scene graph 
incorrectly, creating external "references" (handles) for a version of the 
scene graph which is incorrectly forgotten about and then getting an 
exception when this handle is used with a scene graph that doesn't recognise 
it.

What recommendations do people have on approaches to minimise this problem? At 
the moment, I'm just factoring my code to minimise the number of places which 
handle functional updates but I've got a feeling there's more that can be 
done...

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


                 reply	other threads:[~2005-03-24 16:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200503241621.50618.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.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).