@noreturn ?
Jonathan M Davis
jmdavisProg at gmx.com
Sun Dec 25 16:46:32 PST 2011
On Saturday, December 24, 2011 22:26:02 Andrei Alexandrescu wrote:
> On 12/24/2011 06:58 PM, Vladimir Panteleev wrote:
> > On Saturday, 24 December 2011 at 20:09:46 UTC, bearophile wrote:
> >> GNU C has a noreturn attribute since a lot of time. I don't fully
> >> understand why such attribute is so useful in C programs, but is
> >> something like a @noreturn function attribute useful in D too? Maybe
> >> to implement a better halt assert(0)?
> >
> > How about: scope(success) assert(0); ?
>
> The attribute should be migrated to the signature of the function such
> that calling code can take advantage of it.
>
> I personally think this is a small matter. Right now we have bigger
> rocks to move. It would be great if 2.058 had all [tdpl] bugs fixed.
It's the sort of thing that we could add at any time without breaking
backwards compatibility, so there's no rush unless it solves a burning
problem. But at best, it solves a minor inconvenience. Solving the TDPL on the
other hand would resolve a major usability issue for the language -
particularly how it affects newbies reading TDPL. But completely aside from the
newbies, it's a major milestone in actually having the full language
implemented so that there's a lot less of a distinction between the design and
the implementation.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list