Improving assert-printing in DMD

Per Nordlöw via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 1 23:31:08 PDT 2015


On Thursday, 1 October 2015 at 19:04:51 UTC, Andrei Alexandrescu 
wrote:
> * I don't think we need a new flag, just make the new behavior 
> work.

So you mean that extra diagnostics should kick in when extra 
overloads are made visible via import of, for instance, 
`core.assert`?

> * Should the lowering happen only on the function called if the 
> assertion actually fails? Then no more need for laziness and 
> other complications.

Could explain what you mean by *lowering*, please?

I'm currently unsure whether
     in L lhs
or
     lazy L lhs

should be used and whether or not we should use
     version(assert)

See the added example at
http://wiki.dlang.org/DIP83

> * Extend to other expressions (!=, ordering etc).

How should we categorize expressions? Like this
- Unary: assert(x UNOP y)
- Binary: assert(x BINOP y)
- Function Calls: assert(f(x,y))
- Other: assert(x)

Does it suffice to just mention these or should I be explicit 
exactly about which operators for each category that should be 
included?


More information about the Digitalmars-d mailing list