The Crystal Programming Language Forum

And/or logical operators


I’m a little sad that Crystal doesn’t have the and / or keywords, as I use them exclusively instead of && / || in my Ruby code. I just feel that something pronounced “and” should also be written “and”. The operator precedence also makes more sense to me.

So anyway, I wanted to look into why the core team made that design choice and I couldn’t really find anything. It’s pretty hard to search for anything with just “and” / “or” / “logical” as keywords; I did find Synonyms for logical operators (not, and, or) that confirms if you really want the keywords “The only way is forking the compiler”.

Would someone be kind enough to provide insight into the “why” of this design, or point me to some archived discussion? Thank you.

See Incorporate 'and' and 'or' logic operators as well. · Issue #1449 · crystal-lang/crystal · GitHub.

Thanks! Exactly what I was looking for.

Its fascinating that any programming language is ever made at all, considering how much deep and interesting discussion happens on such a tiny language detail.

It also shows what a giant endeavour it is, and the importance of a guiding vision.