[Grace-core] More thoughts on modules

Andrew P. Black black at cs.pdx.edu
Thu Jun 9 18:56:25 PDT 2011


If we WANT this sort of encapsulation, then I think that encapsulation policies, as described in our OOPSLA paper, provide it much more elegantly.  But then I would think that, wouldn't I?  We considered many alternatives before settling in what's in the paper.

I'm getting more and more attracted to the mix of lexical and inheritance chain scoping that we would get by allowing procedures as well as methods.  But I must say that I haven't thought through the consequences.  Has any other language actually done this, apart form ActionScript?  Rule of three and all that ...

    Andrew

On Jun 9, 2011, at 4:27 AM, James Noble wrote:

> I'd want to take that one stage further, even dynamically,
> writing something like
> 
> implementation module SafeForTours
>    implements M /// do I have to say this?   
>  {
>    import @Owned WhiteHouse;
>    class SafeOffice {
>    const realOffice = self.WhiteHouse.OvalOffice.new();
>    wallClockTime -> TimeOfDay {return realOffice.wallClockTime}
>     }
>    type T = SafeOffice.
>    const office = T.new()
> }



More information about the Grace-core mailing list