Skip to content

true is truthy is true#17

Open
creaturesofhabit wants to merge 3 commits into
DenizenScript:masterfrom
creaturesofhabit:truthiness
Open

true is truthy is true#17
creaturesofhabit wants to merge 3 commits into
DenizenScript:masterfrom
creaturesofhabit:truthiness

Conversation

@creaturesofhabit

Copy link
Copy Markdown

change guide to reflect if's actual modern behavior

change guide to reflect `if`'s actual modern behavior
@CLAassistant

CLAassistant commented Jun 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

The way the `if` command in Denizen works is it processes the arguments using logical comparison techniques, then runs the code inside if the result is `true`, and does not if the result is anything else.

So, if a script does `- if <sometag> == true:`, you're essentially saying `if ( true == true ) == true:` ... which is pretty silly, right?
The way the `if` command in Denizen works is it processes the arguments using logical comparison techniques, then runs the code inside unless the result is falsy<span class="parens">(the word `false`, the number 0, an empty list, and so on)</span>.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You backwards'd this, keep to true/truthy

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unbackwards'd


So, if a script does `- if <sometag> == true:`, you're essentially saying `if ( true == true ) == true:` ... which is pretty silly, right?
The way the `if` command in Denizen works is it processes the arguments using logical comparison techniques, then runs the code inside unless the result is falsy<span class="parens">(the word `false`, the number 0, an empty list, and so on)</span>.
So, if a script does `- if <sometag> == true:`, you're essentially saying `if ( <sometag.is_truthy> == true ) == true:` ... which is pretty silly, right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change just is more confusing for no particular reason

### If True Is True Equal To Truly True Is The Truth

The way the `if` command in Denizen works is it processes the arguments using logical comparison techniques, then runs the code inside if the result is `true`, and does not if the result is anything else.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional blank link here got killed


The way the `if` command in Denizen works is it processes the arguments using logical comparison techniques, then runs the code inside if the result is `true`, and does not if the result is anything else.

The way the `if` command in Denizen works is it processes the arguments using logical comparison techniques, then runs the code inside if the result is truthy<span class="parens">(the word `true`, a non-empty list, a non-zero number, or so on)</span>.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a space before the parens, and missing the lastmost clause of the sentence

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.

3 participants