Negation of attributes (DIP 79)
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jun 4 09:19:23 PDT 2015
On Thursday, 4 June 2015 at 08:46:50 UTC, Daniel Kozák wrote:
> If I will go with !attr, there will be no way to add
> compile-time
> expressions to it. But if we start with attr(true) or
> attr(false), it
> can be easily extended to support compile-time expressions in
> future.
I can see that. But I also see no point in designing it for
possible extensibility later rather than just outright doing it
now. At most, I can see implementing it with just attr(true) and
attr(false) initially in order to get it in with the idea that we
_will_ add full support for arbitrary, compile-time boolean
expressions later, and not that we _might_ such support later.
But my guess is that there really isn't much difference in the
amount of work required to allow arbitrary compile-time boolean
expressions, because we do that sort of thing in plenty of places
already, so it's not like that would have to be done from
scratch. I'm not a compiler dev though, and they'd have a better
idea about that.
Regardless, it's quite clear that we have cases in generic code
where attr(boolean expression) will be useful, so we should just
go for it.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list