Adding syntacti sugar for simple "readonly" attribute ?

Ali Çehreli acehreli at yahoo.com
Thu Oct 26 22:24:11 UTC 2017


On 10/26/2017 02:19 PM, LunaticWare wrote:

 > i don't know if this is the correct way to suggest enhancement to D,

Improvement proposals are handled through DIPs here:

   https://github.com/dlang/DIPs

 > so maybe we could add syntactic sugar for "readonly" attributes.

There is the following project that comes close:

   http://forum.dlang.org/thread/zdcrkrktfsmvghmidamf@forum.dlang.org

class WithAccessors
{
     @Read @Write
     private int num_;

     mixin(GenerateFieldAccessors);
}

Ali



More information about the Digitalmars-d mailing list