Allow 'Chained' Boolean Opperations: eg. X<Y<Z #11786
Closed
HydraheadHunter
started this conversation in
Scripting
Replies: 2 comments 1 reply
-
See: |
Beta Was this translation helpful? Give feedback.
1 reply
-
Thanks for the proposal! Consolidating in #4004. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In mathematics and general parlance, you can chain boolean operators together and be understood. For example, x>y>z. means, x is less than y and y is less than z and not just because the transitive value says so: x>y>z!=w is also grokable. This is not a feature available in any coding language I'm familar with (I'm familar with very few coding languages admittedly). I think it'd be a nice option to have for a non-zero number of use cases.
Describe the project you're working on
Still working on that game inspired by Make Ten. Still not directly relevant to the request, and only included for completeness of the template.
Describe the problem or limitation you are having in your project
Writing
x>y and y>z
starts to take up a lot of horizontal space if you use descriptive variable names or need to do ranges on several axi, or both.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Being able to remove a semantically redundant

and y
would reduce the length of the line by about 25% for the x>y>z case. See below.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
and
.x>y>z
, would be parsed:x>y and y>z
x>y>=z
, would be parsed:x>y and y>=z
x>y>=z!=w
would be parsed:x>y and y>=z and z!=w
You could, entheory, make for more nuanced chained opperations with additional rules. Using a special character to swap the implied
and
for anor
and using parenthesis to 'double up' an opperation, egx>(y,z)-> x>y and x>z
, both spring to mind as potentially useful expansions of scope; but, they are beyond the initial scope of purpose.If this enhancement will not be used often, can it be worked around with a few lines of script?
This enhancement would be a small, optional quality of life improvement, for compacting code in a niche number of uses cases. Most programmers would likely never use nor be affected by it.
Is there a reason why this should be core and not an add-on in the asset library?
I do not believe you can make changes to the scripting language via the asset library. Do correct my assumption if I'm wrogn.
Beta Was this translation helpful? Give feedback.
All reactions