-
-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why aren't conditions boolean expressions? #2207
Comments
I would definitely support this if it was possible to add. Looks really useful. |
For reversing booleans, maybe some sort of
This would be more in the spirit of skript, athough not as universally applicable as
as an additional expresseion |
Seems like |
It's currently a condition, EWS is proposing that all conditions basically become expressions that return booleans, and the condition then becomes
I'd agree that we would need more english-sounding ones like those. But I would definitely like to keep |
And Skript already supports |
@Moderocky yes, that's faster to type, however imo there should be a clear line between skript and skript-mirror-esque syntax. |
This would be a really useful change long-term so I'll set it higher priority to hopefully encourage someone getting to it sooner. |
I think is still open because the PR isn't merged |
the PR hasn't been merged yet. I am also not really fond of merging that PR as things are right now, if we merge that PR it means users will be able to use conditions as expressions which has always been a dumb limitation in Skript, but it is there mainly because there's no good way to make the pattern look correct, grammatically speaking. See the following example:
this looks indeed weird to the eyes, hence why it was limited but this can be simply solved by adding the prefix |
The whole idea of having booleans as expressions is just great and make things much easier in many cases. However, the weird looking thing is kinda true but it isn't a big deal because even in other languages they look kinda similar As you said, as for now IMO, it is not a big deal and maybe later someone will make a PR for this. |
IMO it'd be better to deal with the syntax choice before it's merged, otherwise it might take too long and people will have gotten used to the syntax. The problem with using |
Again, this is not necessary! If you want me to explain it better, I'll provide you with the full implementation of ConditionalExpression in skript-parser. Basically, conditional expressions cannot be used unless specified.
Some more examples;
|
That would be an option, but since the number of syntaxes where that'd be necessary is small, wouldn't it be easier to use an all-matching regex instead of an extra type flag? |
An all matching regex is far less productive:
This is not really 'an option' anymore, it is a design choice. This issue should be discussed thoroughly as the PR is not ready yet to be merged, especially given that the community is divided about the matter. |
Question
I'm not sure if this has been discussed already, but why can't conditions be used as boolean expressions? Would it be too hard to implement?
For example:
send "Can you fly? %player can fly%" to player
Also,
ifs
could support booleans, for exampleif %booleans%
. Multiple booleans could work liketrue, false and true
(&&) andtrue, false or true
(||).So, something like this would be valid:
Reversing booleans might also be useful:
These are just ideas.
My guess is that it's either too hard to add or it destroys parse time, but I don't think it's that bad for readability.
The text was updated successfully, but these errors were encountered: