Proposed ? Syntax #546
Replies: 2 comments
-
Is it really useful though? At present, you can add the trace-if-false operator when calling the identifier in an expression, so you could simply do: let boolean_var = boolean_expr
boolean_var? && some_other_predicate? Plus, I wouldn't actually remove or change the syntax for existing bool expressions. Only add a new syntax / allow the operator to be set on identifiers. |
Beta Was this translation helpful? Give feedback.
-
hm I'm not feeling it to be honest |
Beta Was this translation helpful? Give feedback.
-
Currently, boolean logging syntax is on expressions like so:
anywhere a boolean expression is, it may be logged.
We can introduce a less flexible, but more visually simple syntax, usable in any variable declaration of booleans:
This shifts the operator to the LHS. If the boolean expression is very complex, this lets you avoid an extra layer of parenthesis, and makes your boolean logic clearer.
Potential problem: confusion with optionals. Suggestion: use different operator overall. Suffix exclamation point (true!) makes the most sense to me.
@KtorZ
Beta Was this translation helpful? Give feedback.
All reactions