DIP1000: Scoped Pointers (Discussion)

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 15 16:30:04 PDT 2016


On Mon, Aug 15, 2016 at 02:43:01PM -0700, Walter Bright via Digitalmars-d wrote:
> On 8/15/2016 7:48 AM, Chris Wright wrote:
> > Oh god, the attribute explosion is getting worse.
> > 
> > I think at this point the proper way to use attribute-based D
> > features is to write your code without them, then write a tool that
> > will add all the attributes to your source code that it can while
> > not breaking anything.  Like now it's sensible to write a method:
> > 
> > public final void foo() scope inout @nogc nothrow @safe pure {}
> > 
> > I think the solution is to turn every function into a no-args
> > template, but then you can't use virtual methods.
> 
> 
> We've made a lot of progress with inferring attributes, and I have
> some ideas to do that even more.

I'm looking forward to the day we have pervasive attribute inferrence
throughout the language.  It's the only sane way to deal with
attributes, because they inevitably grow unmanageably numerous. In an
ideal world I'd say *all* attributes should be inferred (and only
specified where the user wishes to ensure the attribute is actually
inferred). But in our non-ideal world it would be interesting to see how
far we can get.


T

-- 
A program should be written to model the concepts of the task it performs rather than the physical world or a process because this maximizes the potential for it to be applied to tasks that are conceptually similar and, more important, to tasks that have not yet been conceived. -- Michael B. Allen


More information about the Digitalmars-d mailing list