Final by default?

Jonathan M Davis jmdavisProg at gmx.com
Thu Mar 13 01:18:51 PDT 2014


On Wednesday, March 12, 2014 15:50:06 Walter Bright wrote:
> So, there's the solution that has been proposed before:
> 
>     !final
>     !pure
>     !nothrow
>     etc.

It's arguably a bit ugly, but it's also arguably sorely needed - certainly the 
lack thereof has been complained about plenty of times before. So, completely 
aside from the issue of final by default, having a mechanism for negating all 
of these attributes would be quite valuable. And every other syntax that I can 
think of for this at the moment which wouldn't introduce another keyword would 
be overly verbose - though we were going to introduce keywords, something like 
not_final, not_pure, not_tothrow, etc. would be straightforward and probably 
wouldn't even break code (though you never know). The bang avoids that need 
though. The primary downside IMHO is how easily it could be missed when 
scanning over code, but we have that problem already when using bang in a 
condition, so that's nothing new.

- Jonathan M Davis


More information about the Digitalmars-d mailing list