Re: [static] [shared] [const|immutable]

2009-05-18 Thread Christopher Wright
Lionello Lunesu wrote: So one has to wonder what code will be generated for "shared immutable".. an immutable with (useless) locking? If that happens, Walter will get a bug report, and he'll change it so that shared immutable variables are silently converted to non-shared immutable variables.

Re: [static] [shared] [const|immutable]

2009-05-18 Thread Lionello Lunesu
BCS wrote: Hello Lionello, "Christopher Wright" wrote in message The point of a shared local variable is to pass it to another thread or set of threads, which will then be able to mutate it without trouble. As before, how can an int (value type) on the stack ever be shared with another thr

Re: [static] [shared] [const|immutable]

2009-05-18 Thread Lionello Lunesu
Christopher Wright wrote: Lionello Lunesu wrote: "Christopher Wright" wrote in message news:gugs7b$70...@digitalmars.com... Lionello Lunesu wrote: I like shared/const/immutable as much as the next guy, but there are now 2x2x3=12 ways to decorate a variable. Furthermore, by either declaring

Re: [static] [shared] [const|immutable]

2009-05-14 Thread BCS
Hello Lionello, "Christopher Wright" wrote in message The point of a shared local variable is to pass it to another thread or set of threads, which will then be able to mutate it without trouble. As before, how can an int (value type) on the stack ever be shared with another thread? It woul

Re: [static] [shared] [const|immutable]

2009-05-14 Thread BCS
Hello Lionello, "Christopher Wright" wrote in message The point of a shared local variable is to pass it to another thread or set of threads, which will then be able to mutate it without trouble. As before, how can an int (value type) on the stack ever be shared with another thread? It woul

Re: [static] [shared] [const|immutable]

2009-05-14 Thread BCS
Hello Lionello, //The code: immutable need not be shared shared immutable int sif = 0xDEAD0013; //068d static global is redundent static int Sf = 0xDEAD0101;//0678 static const int Scf = 0xDEAD0102; //068d static immutable int Sif = 0xDEAD0103; //068d static shared int Ssf =

Re: [static] [shared] [const|immutable]

2009-05-14 Thread Christopher Wright
Lionello Lunesu wrote: "Christopher Wright" wrote in message news:gugs7b$70...@digitalmars.com... Lionello Lunesu wrote: I like shared/const/immutable as much as the next guy, but there are now 2x2x3=12 ways to decorate a variable. Furthermore, by either declaring the variable globally or l

Re: [static] [shared] [const|immutable]

2009-05-14 Thread Lionello Lunesu
"Christopher Wright" wrote in message news:gugs7b$70...@digitalmars.com... Lionello Lunesu wrote: I like shared/const/immutable as much as the next guy, but there are now 2x2x3=12 ways to decorate a variable. Furthermore, by either declaring the variable globally or locally (stack), we end u

Re: [static] [shared] [const|immutable]

2009-05-14 Thread Christopher Wright
Lionello Lunesu wrote: I like shared/const/immutable as much as the next guy, but there are now 2x2x3=12 ways to decorate a variable. Furthermore, by either declaring the variable globally or locally (stack), we end up with 24 possible declaration. See the code at the end of this post. The de

[static] [shared] [const|immutable]

2009-05-14 Thread Lionello Lunesu
I like shared/const/immutable as much as the next guy, but there are now 2x2x3=12 ways to decorate a variable. Furthermore, by either declaring the variable globally or locally (stack), we end up with 24 possible declaration. See the code at the end of this post. Surely, some combinations shou