You're Doing In-Conditions Wrong

FeepingCreature feepingcreature at gmail.com
Thu Jul 16 06:26:02 UTC 2020


On Wednesday, 15 July 2020 at 14:31:30 UTC, Timon Gehr wrote:
>
> Eiffel uses different syntax for require clauses on redefined 
> features. "require else". In D, this would amount to something 
> like:
>
> override void foo()else in(i==3){ ... }

This seems like a good approach.

On Wednesday, 15 July 2020 at 12:00:49 UTC, Steven Schveighoffer 
wrote:
> Why is not requiring you to restate the base code contract a 
> bad intent?

Because it solves a problem that, as far as I can tell from our 
codebase which uses inconditions basically everywhere, doesn't 
exist.

I have, to my recollection, *never* wanted to loosen an 
incondition by adding a totally unrelated condition that can't be 
written as a different phrasing of the parent incondition. And we 
have, uh, *counts* ~4.3k inconditions. (Of which 3.7k are some 
variant of "is not null" tests.) Shouldn't D focus on the common 
case?


More information about the Digitalmars-d mailing list