On Thu, 04 Dec 2014 12:55:34 +0000
bearophile via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> This seems acceptable only if the compiler switch "-scope" 
> implies functions to be @safe by default and @system on request, 
> because currently lot of D programmers don't apply annotations 
> like @safe to their D code. Opt-in safety doesn't work well (and 
> in D we still have the problems caused by null pointers and 
> references).
actually, for me explicit attributes doesn't work well at all. and D
compiler can't infer atributes for functions (ok, it can, but it can't
apply that without changing function signature). that's why alot of my
code compiles awfully slow with separate compilation: i'm used to write
argument-less templates everywhere, so compiler can infer and apply
attributes by itself. i even stopped commenting that practice, 'cause
it means that much of the code will carry comments like this:

  // template to allow attribute inference
  void foo() (A a, int c) { ... }


i think that something is very wrong with the function attributes. but
i still can't think out how to improve that. but it still feels wrong.

that's not about "D designers made a mistake", that's about "i want to
invent a better thing!" ;-)

Attachment: signature.asc
Description: PGP signature

Reply via email to