true is truthy is true#17
Open
creaturesofhabit wants to merge 3 commits into
Open
Conversation
change guide to reflect `if`'s actual modern behavior
| 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>. |
Member
There was a problem hiding this comment.
You backwards'd this, keep to true/truthy
|
|
||
| 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? |
Member
There was a problem hiding this comment.
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. | ||
|
|
Member
There was a problem hiding this comment.
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>. |
Member
There was a problem hiding this comment.
missing a space before the parens, and missing the lastmost clause of the sentence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
change guide to reflect
if's actual modern behavior