You're Doing In-Conditions Wrong
FeepingCreature
feepingcreature at gmail.com
Thu Jul 16 15:57:41 UTC 2020
On Thursday, 16 July 2020 at 13:56:36 UTC, Steven Schveighoffer
wrote:
> It's like having an if/else statement spread out over several
> modules.
>
Worse: it's like having an if expression and body spread over
several modules.
> I don't have a good answer. I don't know that implementing the
> contracts differently is going to achieve a better outcome. But
> I understand that the current situation is not ideal.
Well, the `else in()` idea from the other comment would work...
problem is you can have multiple `in()` statements that are anded
together, and then `else in` breaks down. So really, D went into
a problematic direction many years ago.
Iunno. I feel changing the spec and adding an opt-in
`InconditionLogicError`, with a very long deprecation period,
would be a way we could start digging our way out of the hole
again.
More information about the Digitalmars-d
mailing list