Version française
Home     About     Download     Resources     Contact us    
Browse thread
Internals details for cmmgen.ml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Prevost <prevost@m...>
Subject: Re: Internals details for cmmgen.ml
Jerome Vouillon <Jerome.Vouillon@inria.fr> writes:

> You could also probably make the permission check only once, when the
> region is created, and use the type system to enforce safety.  For
> instance, the interface could look something like this:
> 
>     type 'a perms
>     type 'a t
> 
>     val read_only : <read:unit> perms
>     val write_only : <write:unit> perms
>     val read_write : <read:unit;write:unit> perms

Oho!  Nice trick.  I'd thought of using the type system, but it hadn't
occurred to me that I could use object types in such a nefarious way!
Nice!

John.