Re: Semantics of casting **to** shared?

2010-09-04 Thread dsimcha
== Quote from Denis Koroskin (2kor...@gmail.com)'s article > I loved the recent clone() idea. I think it might be better to disable > casting to (and from) shared (and immutable) and make a (deep?) copy of an > object instead. This will make sure that the isn't any dangling reference > left. I stro

Re: Semantics of casting **to** shared?

2010-09-04 Thread dsimcha
== Quote from Jason House (jason.james.ho...@gmail.com)'s article > safeD doesn't mean your code is safe... only "memory safe". Similarly, > "shared" sort of partitions data and there is no provably safe way to create or use it. I have no idea if your example is truly legit safeD or not... 1. Us

Re: Semantics of casting **to** shared?

2010-09-04 Thread Denis Koroskin
On Sat, 04 Sep 2010 22:05:05 +0400, dsimcha wrote: I noticed that the following code compiles even in SafeD. Is this a bug? If not, what are the semantics of casting unshared to shared? TDPL doesn't seem to mention this. Isn't it dangerous to have shared and unshared references to the

Re: Semantics of casting **to** shared?

2010-09-04 Thread Jason House
safeD doesn't mean your code is safe... only "memory safe". Similarly, "shared" sort of partitions data and there is no provably safe way to create or use it. I have no idea if your example is truly legit safeD or not... dsimcha Wrote: > I noticed that the following code compiles even in SafeD.

Semantics of casting **to** shared?

2010-09-04 Thread dsimcha
I noticed that the following code compiles even in SafeD. Is this a bug? If not, what are the semantics of casting unshared to shared? TDPL doesn't seem to mention this. Isn't it dangerous to have shared and unshared references to the same memory? @safe: class Foo { uint num; } void main(