Safe reference counting cannot be implemented as a library

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 28 01:50:08 PDT 2015


On Wednesday, 28 October 2015 at 08:07:40 UTC, Jacob Carlborg 
wrote:
> On 2015-10-28 07:07, Paulo Pinto wrote:
>
>> However their exceptions work in a more RC friendly way.
>
> Swift doesn't support exceptions. And in Objective-C exceptions 
> are like Errors in D. They should not be caught and the program 
> should terminate.
>
> The error handling support that was added in Swift 2.0 is 
> syntax sugar for the Objective-C pattern to use NSError out 
> parameters for error handling.

Hence why I mentioned they are more RC friendly.

Swift, because it doesn't have them.

Objective-C, because termination is the only option so no need to 
worry about preserving counters.

I was typing on the phone, so didn't want to provide the full 
explanation.

--
Paulo


More information about the Digitalmars-d mailing list