Do we really need @unsafe?

Justin Johansson no at spam.com
Tue Nov 10 18:45:46 PST 2009


Walter Bright Wrote:

> bearophile wrote:
> > Walter Bright:
> > 
> >> Furthermore, why would a safe module wish to expose unsafe functions? 
> >> Shouldn't the programmer instead be obliged to produce trusted functions 
> >> in it?
> > 
> > If what you say is right, then what's the purpose/advantage of using:
> > module foo;
> > @safe:
> > 
> > Instead of this?
> > module(safe) foo;
> 
> 
> 
> ...unsafe functions...
> @safe:
> ...safe functions...
> @trusted:
> ...trusted functions...

entia non sunt multiplicanda praeter necessitatem

I would err on Walter's side;
the fewer the number of options/keywords to achieve the required functionality
the better and no fewer.

Justin







More information about the Digitalmars-d mailing list