Mac Apps That Use Garbage Collection Must Move to ARC
Matthias Bentrup via Digitalmars-d
digitalmars-d at puremagic.com
Mon Feb 23 05:15:33 PST 2015
On Monday, 23 February 2015 at 12:30:55 UTC, Russel Winder wrote:
> On Mon, 2015-02-23 at 19:50 +1000, Manu via Digitalmars-d wrote:
>> O[…]
>> This is going to sound really stupid... but do people actually
>> use
>> exceptions regularly?
>> I've never used one. When I encounter code that does, I just
>> find it
>> really annoying to debug. I've never 'gotten' exceptions. I'm
>> not sure
>> why error codes are insufficient, other than the obvious fact
>> that
>> they hog the one sacred return value.
>> D is just a whisker short of practical multiple-return-values.
>> If we
>> cracked that, we could use alternative (superior?) error state
>> return
>> mechanisms. I'd be really into that.
> […]
>
> Return codes for value returning functions only work if the
> function
> returns a pair, the return value and the error code: it is
> generally
> impossible to work with return values that serve the purpose of
> return
> value and error code. C got this fairly wrong, Go gets it
> fairly right.
You wouldn't need new syntax (though I think multiple returns
would be a nice addition), I think you can compile try/catch
exception syntax into error codes internally.
More information about the Digitalmars-d
mailing list