From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA30131 for caml-redistribution; Thu, 23 Dec 1999 17:37:49 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA26868 for ; Thu, 23 Dec 1999 06:34:27 +0100 (MET) Received: from isil.maya.com (isil.maya.com [192.70.254.5]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id GAA18934; Thu, 23 Dec 1999 06:34:25 +0100 (MET) Received: (from prevost@localhost) by isil.maya.com (8.9.3/8.9.3) id AAA00976; Thu, 23 Dec 1999 00:26:27 -0500 X-Authentication-Warning: isil.maya.com: prevost set sender to prevost@maya.com using -f Sender: weis To: Jerome Vouillon Cc: Xavier Leroy , caml-list@inria.fr Subject: Re: Internals details for cmmgen.ml References: <87emcv5i5d.fsf@isil.maya.com> <19991211190908.14090@pauillac.inria.fr> <87d7s5rs09.fsf@isil.maya.com> <19991218195635.35263@pauillac.inria.fr> From: John Prevost Date: 23 Dec 1999 00:26:27 -0500 In-Reply-To: Jerome Vouillon's message of "Sat, 18 Dec 1999 19:56:35 +0100" Message-ID: <87so0uns70.fsf@isil.maya.com> User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Jerome Vouillon 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 : perms > val write_only : perms > val read_write : 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.