caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Accumulating state
@ 2005-03-24 16:21 Jon Harrop
  0 siblings, 0 replies; only message in thread
From: Jon Harrop @ 2005-03-24 16:21 UTC (permalink / raw)
  To: Ocaml


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-24 16:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-24 16:21 Accumulating state Jon Harrop

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).