Skip to content

Clarify condition by splitting it up into explicitly named bools.#385

Open
otherdaniel wants to merge 3 commits intoWICG:mainfrom
otherdaniel:380-clarify
Open

Clarify condition by splitting it up into explicitly named bools.#385
otherdaniel wants to merge 3 commits intoWICG:mainfrom
otherdaniel:380-clarify

Conversation

@otherdaniel
Copy link
Copy Markdown
Collaborator

@otherdaniel otherdaniel commented Mar 23, 2026

Split the dreaded multi-line condition into several subclauses, assign each to an appropriately named boolean, and then test those bools.

That's more verbose than I usually go for, but it's surely more readable than the old version.

Fix: #380


Preview | Diff

@evilpie
Copy link
Copy Markdown
Collaborator

evilpie commented Mar 31, 2026

I have been thinking it might be cleaner to add a new algorithm like is attribute allowed. This might also be useful for #387, because we could use it like "is attribute allowed is".

@otherdaniel
Copy link
Copy Markdown
Collaborator Author

I have been thinking it might be cleaner to add a new algorithm like is attribute allowed. This might also be useful for #387, because we could use it like "is attribute allowed is".

Done. Please take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attribute allowing conditions seem wrong

2 participants