[Gllug] trashman - a trash management utility for Linux filesystem

Richard Jones rich at annexia.org
Thu Feb 2 11:33:56 UTC 2006


On Thu, Feb 02, 2006 at 08:24:22AM +0000, Nix wrote:
> Exactly. We have a bunch of interlinked trees representing all-the-
> versions-of-this-file-across-time, and other tracking all-inodes-
> that-have-ever-had-this-name, and another chaining versions together
> into branches, and so on...
[...]
> Ooo! I know classic ML was awful at it...

My classic ML is not so good.  Sticking with OCaml though ...

This C code:

  struct foo {
    struct bar *ptr;
  }

  foo_a->ptr = foo_b;

is exactly equivalent to this in OCaml:

  type foo = {
    mutable ptr : bar;
  }

  foo_a.ptr <- foo_b;

Even the in-memory representation and the code generated to
read/update the pointer is identical.

The only thing OCaml won't let you do is to create a foo without
initializing the ptr field (which you can obviously do in C just by
using malloc and then not bothering to initialize the field).  This
"limitation" of OCaml is probably to be regarded as a Good Thing ...

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list