zed icon indicating copy to clipboard operation
zed copied to clipboard

Consistent boolean operators

Open philrz opened this issue 2 years ago • 0 comments

At the time this issue is being opened, Zed is at commit d55ca74.

As of the merge of #4768, we've now got boolean operators and, or, not, and !. Personally, I find it a little strange that we offer two variations for negation but only the word-based and/or without offering the alternatives &&/||. It's surely not an urgent matter, but in the interest of having the language be consistent and follow a certain set of principles, we may want to simplify this.

For instance, if we were of the Python-like mindset "There should be one-- and preferably only one --obvious way to do it" we might consider having only and, or, and not. Or if we're not afraid to have multiple approaches to seem friendlier to users that come from programming languages like C and Go, perhaps we'd want to support &&, ||, and ! as well.

If we were to drop !, since we don't really know how many users out there might be depending on that currently, I expect we'd want to deprecate gradually. For instance, we could first drop mention of it from the docs and have the tooling surface a warning when it's used but let it continue to function for now. Then at some point later we could actually drop it from the parser.

philrz avatar Sep 26 '23 19:09 philrz