/comparison-dsl

Provides && and || operators for integers resulting from comparisons

Primary LanguageScala

comparison-dsl

Provides && and || operators for integers resulting from comparisons.

Instead of

if (c0 != 0) {
  c0
} else if (c1 != 0) {
  c1
} else c2

write

c0 && c1 && c2

.

Instead of

if (c0 == 0) {
  0
} else if (c1 == 0) {
  0
} else c2

write

c0 || c1 || c2

.

SBT Dependency

"me.jeffshaw.comparison" %% "comparison-dsl" % "1.0.1"