Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ?? and !! instead of ? and ??...make ? a SET? test
For reasons of visibility, Perl6 chose to use ?? and !! instead of ? and : for a ternary operator: https://docs.perl6.org/language/operators#infix_??_!! This actually does appear to look better. Consider: 1 > 2 ? [a] ?? () ?? () ?? [x] ?? () ?? [y] 1 > 2 ?? [a] !! () !! () !! [x] !! () !! [y] The operator stands out better in the second case, and is more clearly differentiated. With agreement from @draegtun, this makes the change for Ren-C. (Note that ?? and !! are not generic replacements for IF and ELSE. If you write `condition ?? 1 + 1 !! 2 + 2` then both additions will be run, since to "block" an evaluation there must be a BLOCK! involved. So while evaluation is allowed, if you use it, note that they are ordinary function parameters and both will be evaluated.) This then shifts `? var` to be equivalent to `set? 'var`, as a test to see how that works out...as it's common to want to know if a variable is set or not. (If it works out, then perhaps `! var` for `unset? 'var` would be a better use than the not-actually-clarifying synonym of ! for NOT)
- Loading branch information