After getting the feedback here, I no longer support my original proposal. But I would be happy if something like `Object#iff?` existed instead. I think logical equivalence is a legitimate use case. And alternaive expressions for logical...danga (Dan Garubba)
jeremyevans0 (Jeremy Evans) wrote: > sawa (Tsuyoshi Sawada) wrote: > ... I agree. Because of the existing mixed semantics, and predicates returning `Integer`s, I'm wary of using `^` as a general purpose logical operator. However, `!a ^...danga (Dan Garubba)
Thanks. Essentially, this helper is a form of the boolean singleton normalization I apply at the application level. I understand there should be a high threshold for introducing new operators into a language, so I wanted to see if an...danga (Dan Garubba)
Sure. In my day job, I write testing code. So I've written an expression like: ~~~ ruby raise MyError unless in_scenario_x? == actions_performed_for_scenario_x? ~~~ To express: "raise an error unless the actions are performed for...danga (Dan Garubba)
I propose adding a new operator for truthy/falsy equivalence, similar to what was proposed on https://bugs.ruby-lang.org/issues/13067, but with new syntax. The main purpose would be for writing expressions for logical equivalence (i.e., ...danga (Dan Garubba)