@safe(bool)

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 22 04:02:06 PDT 2017


Am Sun, 20 Aug 2017 00:29:11 +0000
schrieb Nicholas Wilson <iamthewilsonator at hotmail.com>:

> On Saturday, 19 August 2017 at 17:10:54 UTC, bitwise wrote:
> > I'm still concerned about having to read code that's laced full 
> > of custom attributes, the resolution of which may span several 
> > files, templates, etc.
> >
> > I also think this type of thing could have a detrimental effect 
> > on modularity when you end up having to include "myAttribs.d" 
> > in every single file you want to work on. I would much rather 
> > have a flexible in-language solution, or a solution that didn't 
> > require me to define my own attributes.  
> 
> Having worked on a project with a lot of attributes, my 
> suggestion would be to import it via a package.d, you'll be 
> importing that anyway.

+1
A bigger project /usually/ has some default imports. Typical
use cases are unifying compiler versions and architectures,
back-porting new Phobos features and custom error handling and
logging.
For example, in dub the modules in the "internal" package are
imported into most of the bigger modules.
You can also create a file template with documentation header,
license and default imports if you need to create a lot of
modules.

-- 
Marco



More information about the Digitalmars-d mailing list