scope() statements and return

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 6 06:48:23 PDT 2014


On 10/6/14, 12:27 AM, Walter Bright wrote:
> On 10/5/2014 10:09 AM, Dicebot wrote:
>> On Sunday, 5 October 2014 at 17:03:07 UTC, Andrei Alexandrescu wrote:
>>> On 10/5/14, 9:42 AM, Dicebot wrote:
>>>> On Sunday, 5 October 2014 at 16:30:47 UTC, Ola Fosheim Grøstad wrote:
>>>>> Does D have exception chaining?
>>>>
>>>> Yes. http://dlang.org/phobos/object.html#.Throwable.next
>>>> Though it seems to do more harm then good so far.
>>>
>>> What harm does it do? -- Andrei
>>
>> Good chunk of issues with pre-allocated exceptions (and possible
>> cycles in
>> reference counted ones) comes from the chanining possibility. At the
>> same time I
>> have yet to see it actively used as a feature.
>>
>> Doesn't mean it is bad thing, just not used wide enough to compensate for
>> trouble right now.
>
> FWIW, I'm skeptical as well of the value of chaining relative to its
> cost in complexity.

It's one of those designs in which there's little room to turn. We 
wanted to (a) allow destructors to throw, (b) conserve information. 
Offering access to all exceptions caught was a natural consequence. -- 
Andrei


More information about the Digitalmars-d mailing list