Proposal 2: Exceptions and @nogc

rjframe via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 11 04:39:20 PDT 2017


On Mon, 10 Apr 2017 16:43:40 -0700, Walter Bright wrote:

> On 4/10/2017 2:44 PM, Jonathan Marler wrote:
>> Another way to think of it is that this proposal makes "throw new" into
>> a special operator that is different than composing the "throw" and
>> "new" operations independently. Once you realize this it's easy to
>> understand and explain to others as well, i.e.
>>
>> "throw"     operator (throw a Throwable object)
>> "new"       operator (create a GC object)
>> "throw new" operator (create and throw a reference-counted Throwable
>> object)
> 
> That's right. Thanks for helping out, your explanations are better than
> mine!
> 
> (Once I realized this myself, the implementation got a lot simpler.)

I have no problem with this specific change, but this method of solving 
problems is going to turn D into a horrible language with all kinds of 
weird edge cases. I left Python for D mostly because the language was 
becoming one hack built on top of another; it would be nice if D could 
avoid that path. The occasional kludge may be necessary, but it shouldn't 
be normal or the first thought.

--Ryan


More information about the Digitalmars-d mailing list