Am 23.10.2011, 21:51 Uhr, schrieb bearophile bearophileh...@lycos.com:
Jonathan M Davis:
my general take on it is that dmd should _never_ ignore attributes,
I agree. Such sloppiness is a very good source for problems, long term
ones too, and it makes it harder to learn D.
Bye,
void main() {
shared s1 = cast(shared)new S();
s1.onlyShared(); // ok
//s1.notShared(); // error: not callable using argument types () shared
auto s2 = new S();
//s2.onlyShared(); // error: not callable using argument types ()
s2.notShared(); // ok
}
I would rather
On 2011-10-23 20:14, Jonathan M Davis wrote:
On Sunday, October 23, 2011 14:32:34 simendsjo wrote:
What does shared for functions mean? I thought it was supposed to
automatically synchronize access, but this doesn't seem to be the case.
void f() shared {
// no synchronization
}
void f
On Sun, 23 Oct 2011 08:32:34 -0400, simendsjo simend...@gmail.com wrote:
What does shared for functions mean? I thought it was supposed to
automatically synchronize access, but this doesn't seem to be the case.
void f() shared {
// no synchronization
}
void f() {
synchronized
On 24.10.2011 17:23, Steven Schveighoffer wrote:
On Sun, 23 Oct 2011 08:32:34 -0400, simendsjo simend...@gmail.com wrote:
What does shared for functions mean? I thought it was supposed to
automatically synchronize access, but this doesn't seem to be the case.
void f() shared
On Mon, 24 Oct 2011 12:01:07 -0400, simendsjo simend...@gmail.com wrote:
On 24.10.2011 17:23, Steven Schveighoffer wrote:
On Sun, 23 Oct 2011 08:32:34 -0400, simendsjo simend...@gmail.com
wrote:
What does shared for functions mean? I thought it was supposed to
automatically synchronize
On 24.10.2011 21:41, Steven Schveighoffer wrote:
So you cannot create a function to be called on both shared and
unshared instances? For mutable/immutable there's const, but there is
no maybeShared.
No. There isn't a hybrid that works as well as const does. I suspect one
could be created,
What does shared for functions mean? I thought it was supposed to
automatically synchronize access, but this doesn't seem to be the case.
void f() shared {
// no synchronization
}
void f() {
synchronized {
// do stuff
}
}
On Sunday, October 23, 2011 14:32:34 simendsjo wrote:
What does shared for functions mean? I thought it was supposed to
automatically synchronize access, but this doesn't seem to be the case.
void f() shared {
// no synchronization
}
void f() {
synchronized {
// do stuff
On Sunday, October 23, 2011 20:22:01 simendsjo wrote:
On 23.10.2011 20:14, Jonathan M Davis wrote:
On Sunday, October 23, 2011 14:32:34 simendsjo wrote:
What does shared for functions mean? I thought it was supposed to
automatically synchronize access, but this doesn't seem to be the
case
Jonathan M Davis:
my general take on it is that dmd should _never_ ignore attributes,
I agree. Such sloppiness is a very good source for problems, long term ones
too, and it makes it harder to learn D.
Bye,
bearophile
11 matches
Mail list logo