alias annotations - unque / owned / shared / lent

Jason House jason.james.house at gmail.com
Fri Feb 1 13:16:38 PST 2008


I probably should have included the full URL
http://archjava.fluid.cs.cmu.edu/papers/oopsla02.pdf

Both the const challenge and string alias invariant threads have mentioned "Unique()" qualifications on types.  The paper seems to expand this in a coherent type system that may be compatible with D.  

Jason House Wrote:

> In http://d.puremagic.com/issues/show_bug.cgi?id=1654, Andrei Alexandrescu pointed out the following paper:
> archjava.fluid.cs.cmu.edu/papers/oopsla02.pdf
> 
> Since it seems to resonate with my thoughts (on const casting), I figured I'd try to gauge the reactions of others.  I was also lazy and stopped reading when I hit the lambda calculus.
> 
> In a nut shell, they introduce the following types:
> 
> unique - A unique copy/reference to data
> owned - A piece of data with exclusive access rights by the containing class
> lent - A temporary copy of a variable.  Can be used within a function, but no residual copy can be kept, and it can't be returned from functions.
> shared - A global variable that can be accessed from many places
> 
> They also have alpha, but it seems to be a distinct type that doesn't play nicely with anything else, and I didn't see it described up front.
> 
> Page 4 of the document gives casting rules.
> 
> I guess I've always thought of stuff in a more complicated fashion where this type of property can be done based on write access rather than complete ownership.




More information about the Digitalmars-d mailing list