English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 1999-12-23 (16:37)
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!