@future attribute / @future keyword?

Steven Schveighoffer schveiguy at gmail.com
Wed Mar 18 14:23:28 UTC 2020


On 3/18/20 6:20 AM, WebFreak001 wrote:
> I have read about @future before being some kind of opposite of 
> deprecated. However when trying to search about it now again I can't 
> find any mentions of it anywhere except on 
> https://dlang.org/spec/traits.html#isFuture
> 
> It's difficult enough to search for "future" but even if limiting it to 
> the spec it's the only search result: 
> https://www.google.com/search?domains=dlang.org&sourceid=google-search&q=%40future&sitesearch=dlang.org%2Fspec 
> 
> 
> There is this "future compiler concept": 
> https://forum.dlang.org/post/hjdstwzhcbrektlijvhm@forum.dlang.org
> which now is however leads to a dead link, so here is a fixed link: 
> https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1007.md
> 
> In the grammar @future isn't mentioned at all, has it been removed from 
> the language but the trait was left over?
> 
> Maybe the documentation here should be improved to avoid confusion.

Honestly, I think that concept was never fully implemented (or maybe 
followed properly). Simply because there has not been much complaint 
about symbols being added "too quickly".

99.99% of the time, you add a symbol to a module, and there are no ill 
effects. The problem at the time was a significant one for Sociomantic, 
I believe because of a change that they needed for switching from Tango 
to druntime.

If you grep druntime, there are 2 usages, both from about 2-3 years ago. 
Both were either submitted by sociomantic, or asked to add the @__future 
attribute from them.

I'm guessing that either interest was lost in keeping this up, or didn't 
notice when things were added, and it didn't affect them. Seems like all 
the focus was on the exception hierarchy (which needs TLC anyway). Maybe 
someone from that org can identify how this has helped them.

The whole concept itself has some rather obscure use cases. Perhaps in 
the future there will be an obvious use case, and we will be glad that 
we have it.

-Steve


More information about the Digitalmars-d-learn mailing list