5 lines
162 B
Groovy
5 lines
162 B
Groovy
|
|
final rels = [ (-1) : '<', 0 : '==', 1 : '>' ].asImmutable()
|
||
|
|
def comparisonSpaceship = { a, b ->
|
||
|
|
println "a ? b = ${a} ? ${b} = a ${rels[a <=> b]} b"
|
||
|
|
}
|