examples converted to new syntax
This commit is contained in:
@@ -30,8 +30,8 @@ class StandardFList<T> (override val head: T, override val tail: FList<T>) : FLi
|
||||
|
||||
fun <T> FList<T>.plus2(element: T): FList<T> =
|
||||
when(this) {
|
||||
is EmptyFList<*> => OneElementFList<T>(element)
|
||||
else => StandardFList<T>(element, this)
|
||||
is EmptyFList<*> -> OneElementFList<T>(element)
|
||||
else -> StandardFList<T>(element, this)
|
||||
}
|
||||
|
||||
fun <T> FList<T>.plus3(element: T) : FList<T> =
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
fun <T> Int.latch(op: fun CountDownLatch.() : T) : T {
|
||||
fun <T> Int.latch(op: CountDownLatch.() -> T) : T {
|
||||
val cdl = CountDownLatch(this)
|
||||
val res = cdl.op()
|
||||
cdl.await()
|
||||
|
||||
Reference in New Issue
Block a user