First Draft: Static Single Assignment
Peter C
peterc at gmail.com
Sun Nov 30 03:09:12 UTC 2025
On Tuesday, 18 November 2025 at 10:24:17 UTC, Jonathan M Davis
wrote:
>
> ...
> 2. Adding _any_ keyword is a breaking change, so the odds of it
> happening are pretty low in general. If there's a strong case
> for it with a particular feature, then it might happen, but if
> an existing keyword can reasonably be used instead (or some
> other syntax which wouldn't be a breaking change), that's
> almost certainly what's going to happen when adding a feature.
> ...
> - Jonathan M Davis
Again, a *contextual* keyword like 'fixed' would solve the issue
of compatability.
Why do I think something other than 'final' is needed?
Because of this 'real world' example:
It's from:
https://github.com/ProjectDVN/dvn/blob/main/source/dvn/application.d
i.e. adding yet another overloaded meaning to 'final' would be
conceptually confusing at the very least. I would call it out
further, as being poor language design!
public final class Application
{
private:
FontCollection _fonts;
bool _running;
Tid _uiTid;
int _fps;
Color _defaultWindowColor;
Window[] _windows;
bool _allowWASDMovement;
size_t _concurrencyLevel;
size_t _messageLevel;
bool _isDebugMode;
public:
final:
this(int defaultFps = 60)
{
this(getColorByName("white"), defaultFps);
}
this(Color defaultWindowColor,int defaultFps = 60)
{
if (defaultFps <= 0 || defaultFps > 240)
{
throw new ApplicationException("Invalid default fps.");
}
_defaultWindowColor = defaultWindowColor;
_fonts = new FontCollection;
_fps = defaultFps;
_windows = [];
_concurrencyLevel = 4;
_messageLevel = 42;
if (!_app)
{
_app = this;
}
}
More information about the dip.development
mailing list