all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
/** returns a if it is nonzero, otherwise b() */
|
||||
def nonzeroOr(a, b) { return if (a.isZero()) { b() } else { a } }
|
||||
|
||||
["Here", "are", "some", "sample", "strings", "to", "be", "sorted"] \
|
||||
.sort(fn a, b {
|
||||
nonzeroOr(b.size().op__cmp(a.size()),
|
||||
fn { a.compareToIgnoreCase(b) })
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue