« Return to Thread: annotations or traits to better scale scala up

Re: annotations or traits to better scale scala up

by Walter Smith :: Rate this Message:

Reply to Author | View in Thread

Daniel Sobral wrote:
On Wed, Jun 3, 2009 at 3:47 PM, Marcus Downing <marcus@minotaur.it> wrote:
>> Immutable: The class guarantees that it recursively has no variables and
>> is purely functional. (I think this is a must!)
>
> In most cases, this could be derived by the compiler rather than needing to
> be specified manually.
>
> What would you do with this metadata? How would it be treated differently?

I don't know what Walter has in mind, but to me it seems obvious that
the compiler ensures at compile time that your class is, in fact,
purely functional, by checking "recursively" all its component
classes. Useful against changes in external classes.
If I want a class A to be purely functional, I still may happen to use within it's definition some other class B that isn't. Right now the compiler accepts that, because there is no explicit distinction for it to derive the intention from. I'd like to specify that I want it to remain pure!

Walter

 « Return to Thread: annotations or traits to better scale scala up