The "no gc" crowd

Walter Bright newshound2 at digitalmars.com
Thu Oct 10 00:18:09 PDT 2013


On 10/9/2013 11:34 PM, Jacob Carlborg wrote:
> On 2013-10-10 02:22, Sean Kelly wrote:
>
>> Only that this would have to be communicated to the user, since moving data
>> later is problematic. Today, I think it's common to construct an object as
>> unshared and then cast it.
>
> What is the reason to not create it as "shared" in the first place?

1. Shared data cannot be passed to regular functions.

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.

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.


More information about the Digitalmars-d mailing list