Re: immutable struct/class is mutable!

2013-07-15 Thread JS
On Tuesday, 16 July 2013 at 02:59:50 UTC, Ali Çehreli wrote: On 07/15/2013 07:50 AM, JS wrote: > Why does isMutable and isAssignable return true for a struct/class that > are immutable? > > immutable struct A { } > > isMutable!A returns true. import std.traits; struct S {} alias ImmutableS =

Re: immutable struct/class is mutable!

2013-07-15 Thread Ali Çehreli
On 07/15/2013 07:50 AM, JS wrote: > Why does isMutable and isAssignable return true for a struct/class that > are immutable? > > immutable struct A { } > > isMutable!A returns true. import std.traits; struct S {} alias ImmutableS = immutable(S); void main() { static assert(!isMutable!Immu

Re: immutable struct/class is mutable!

2013-07-15 Thread Jonathan M Davis
On Tuesday, July 16, 2013 03:46:06 JS wrote: > On Tuesday, 16 July 2013 at 01:24:37 UTC, Jonathan M Davis wrote: > > On Monday, July 15, 2013 21:08:03 Dicebot wrote: > >> On Monday, 15 July 2013 at 18:39:08 UTC, JS wrote: > >> > and immutability doesn't nest. immutable struct A { struct B > >> > {

Re: immutable struct/class is mutable!

2013-07-15 Thread JS
On Tuesday, 16 July 2013 at 01:24:37 UTC, Jonathan M Davis wrote: On Monday, July 15, 2013 21:08:03 Dicebot wrote: On Monday, 15 July 2013 at 18:39:08 UTC, JS wrote: > and immutability doesn't nest. immutable struct A { struct B > { > }}, struct B is mutable. What I have meant by "may be inte

Re: immutable struct/class is mutable!

2013-07-15 Thread Jonathan M Davis
On Monday, July 15, 2013 21:08:03 Dicebot wrote: > On Monday, 15 July 2013 at 18:39:08 UTC, JS wrote: > > and immutability doesn't nest. immutable struct A { struct B { > > }}, struct B is mutable. > > What I have meant by "may be intended behavior" is that immutable > qualifier does not attach at

Re: immutable struct/class is mutable!

2013-07-15 Thread Dicebot
On Monday, 15 July 2013 at 18:39:08 UTC, JS wrote: and immutability doesn't nest. immutable struct A { struct B { }}, struct B is mutable. What I have meant by "may be intended behavior" is that immutable qualifier does not attach at aggregate definitions. At all. It is irrelevant to the fact

Re: immutable struct/class is mutable!

2013-07-15 Thread JS
On Monday, 15 July 2013 at 15:08:58 UTC, Dicebot wrote: On Monday, 15 July 2013 at 14:50:04 UTC, JS wrote: Why does isMutable and isAssignable return true for a struct/class that are immutable? immutable struct A { } isMutable!A returns true. looks like immutable struct A { int a; } a

Re: immutable struct/class is mutable!

2013-07-15 Thread JS
On Monday, 15 July 2013 at 16:17:02 UTC, John Colvin wrote: On Monday, 15 July 2013 at 15:59:44 UTC, JS wrote: On Monday, 15 July 2013 at 15:08:58 UTC, Dicebot wrote: On Monday, 15 July 2013 at 14:50:04 UTC, JS wrote: Why does isMutable and isAssignable return true for a struct/class that are

Re: immutable struct/class is mutable!

2013-07-15 Thread John Colvin
On Monday, 15 July 2013 at 15:59:44 UTC, JS wrote: On Monday, 15 July 2013 at 15:08:58 UTC, Dicebot wrote: On Monday, 15 July 2013 at 14:50:04 UTC, JS wrote: Why does isMutable and isAssignable return true for a struct/class that are immutable? immutable struct A { } isMutable!A returns true

Re: immutable struct/class is mutable!

2013-07-15 Thread JS
On Monday, 15 July 2013 at 15:08:58 UTC, Dicebot wrote: On Monday, 15 July 2013 at 14:50:04 UTC, JS wrote: Why does isMutable and isAssignable return true for a struct/class that are immutable? immutable struct A { } isMutable!A returns true. looks like immutable struct A { int a; } a

Re: immutable struct/class is mutable!

2013-07-15 Thread Dicebot
On Monday, 15 July 2013 at 14:50:04 UTC, JS wrote: Why does isMutable and isAssignable return true for a struct/class that are immutable? immutable struct A { } isMutable!A returns true. looks like immutable struct A { int a; } acts as a struct A { immutable: int a; } Now