On 5/18/15 8:20 AM, Atila Neves wrote:
One thing I like about `enforce` is that the program's run-time checks
become positive instead of negative statements which I think is a lot
more readable. i.e.

     enforce(foo && bar > 4, "...");

instead of

    if(!foo || bar <=3) throw new Exception("...");

Yes, but that's a minor nuisance. I often do not rewrite conditions by distributing the negation to avoid this problem. In that case, the "operation" becomes basically:

if(!(...))

We could introduce a new 'when' keyword:

when(...)

joking, joking!!! don't start flaming :)

Alternatively, we could fix lazy parameters so they don't disable inlining (though the weight carried by enforce is so minor, I still don't think it's worth having).

-Steve

Reply via email to