General

Profile

danga (Dan Garubba)

  • Login: danga
  • Registered on: 07/30/2018
  • Last sign in: 07/31/2018

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 1 0 1

Activity

08/02/2018

07:16 AM Ruby Feature #14951: New operator to evaluate truthy/falsy/logical equivalence
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)

07/31/2018

06:58 PM Ruby Feature #14951: New operator to evaluate truthy/falsy/logical equivalence
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)
02:34 AM Ruby Feature #14951: New operator to evaluate truthy/falsy/logical equivalence
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)

07/30/2018

07:57 PM Ruby Feature #14951: New operator to evaluate truthy/falsy/logical equivalence
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)
05:31 AM Ruby Feature #14951 (Open): New operator to evaluate truthy/falsy/logical equivalence
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)

Also available in: Atom