The "no gc" crowd
Jacob Carlborg
doob at me.com
Thu Oct 10 00:51:24 PDT 2013
On 2013-10-10 09:18, Walter Bright wrote:
> 1. Shared data cannot be passed to regular functions.
That I understand.
> 2. Functions that create data structures would have to know in advance
> that they'll be creating a shared object. I'm not so sure this would not
> be an invasive change.
If the function doesn't know it creates shared data it will assume it's
not and it won't use any synchronization. Then suddenly someone casts it
to "shared" and you're in trouble.
> 3. Immutable data is implicitly shared. But it is not created immutable
> - it is created as mutable data, then set to some state, then cast to
> immutable.
It should be possible to create immutable data in the first place. No
cast should be required.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list