iPhone vs Android

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 13 11:40:37 PDT 2016


On 9/13/16 2:24 PM, deadalnix wrote:
> This is why ObjC exeption handling and ARC never worked well together.
> This is why C++ exception are dog slow and this is why Swift is nothrow
> by default.

Swift doesn't support exceptions AFAIK. It supports weird error handling 
that looks similar to exceptions, but is really just a standard return.

i.e. this:

do
{
    try someFunctionThatErrors(arg)
}
catch(Exception ex)
{
    // handle ex
}

really compiles like this:

var _err : Error?
someFunctionThatErrors(arg, &_err)
if(_err != nil)
{
    let ex = _err!.exception
}

-Steve


More information about the Digitalmars-d mailing list