Thoughts about deprecation
smjg_1998 at yahoo.com
Sun Feb 12 09:44:20 PST 2012
On 12/02/2012 14:44, Timon Gehr wrote:
<snip excessive quote>
> I think (e) is not an ideal of deprecation. If a feature is deprecated, then checking
> whether it compiles should be deprecated too.
Oh yes, that's another possibility. Make an IsExpression on something deprecated emit a
deprecation error instead of returning either true or false. This satisfies (a), (b), (c)
And it satisfies a variant of (e): validity checking through compile-time reflection is
always either consistent with whether the compiler accepts the code or an error in itself.
This already covers the cases where the body of the IsExpression isn't syntactically
valid. Though there's a difference there in that the error happens at the parsing stage,
rather than the semantic analysis stage. But there's also a difference here in that
syntax doesn't depend on code elsewhere in the source file or in other source files, and
so there isn't much of a use case for syntactic validity checking as a form of reflection.
More information about the Digitalmars-d