U
U.Mutlu
What I miss in the language, for ages now, is a keyword
that lets forget/undefine a defined variable:
void f()
{
int x;
...
forget x;
...
}
Such a construct would be useful when analysing/debugging/hand-optimizing
lenghty functions written by others. It helps make code more robust
by undefining the variable as soon as it's not needed anymore.
It also would aid the compiler for optimization.
(Of course one could create the variable in its own scope block,
but that's "cumbersome"/impractical to do for code of others.)
Another construct I miss is: making a variable const sometime later after definition,
ie. promoting it to const by using a keyword "freeze" or such (of course the reverse,
promoting from const to non-const, shall not be possible):
void f()
{
int x;
...
freeze x;
...
}
IMHO it would be very easy and simple to implement these into the language.
OTOH I'm not update with the recent developments of the language,
maybe they already added them? Or is it just wishful thinking?
that lets forget/undefine a defined variable:
void f()
{
int x;
...
forget x;
...
}
Such a construct would be useful when analysing/debugging/hand-optimizing
lenghty functions written by others. It helps make code more robust
by undefining the variable as soon as it's not needed anymore.
It also would aid the compiler for optimization.
(Of course one could create the variable in its own scope block,
but that's "cumbersome"/impractical to do for code of others.)
Another construct I miss is: making a variable const sometime later after definition,
ie. promoting it to const by using a keyword "freeze" or such (of course the reverse,
promoting from const to non-const, shall not be possible):
void f()
{
int x;
...
freeze x;
...
}
IMHO it would be very easy and simple to implement these into the language.
OTOH I'm not update with the recent developments of the language,
maybe they already added them? Or is it just wishful thinking?