DMD 1.027 and 2.011 releases
Georg Wrede
georg at nospam.org
Mon Mar 3 14:37:21 PST 2008
Robert Fraser wrote:
> Graham St Jack wrote:
>
>> It will be a good trick if you can pull it off. I don't see how it can
>> be done without examining the source code of all the called functions,
>> leaving us back where we started with throw specs.
>
>
> I think the idea would be that nothrow is part of the function signature
> and a nothrow function can only call other nothrow functions or wrap any
> function calls or news in a catch(Exception) (since there's no way to
> know specifically which exceptions could be thrown).
Yes. Therefore, the compiler has to know which functions are "nothrow",
at compile time.
Keeping track of this would be a lot of work -- ONE single time when
implementing the bokkeeping of it. Later, the compiler programmer
(Walter?) would only have to deal with this when creating totally new
basic functions or severely altering the existing ones.
And at that time it would not feel like a lot of work. Probably it would
be like filling in a few items on a row in a (sql-like) table of
function properties for the compiler.
More information about the Digitalmars-d-announce
mailing list