52 lines
894 B
Plaintext
Vendored
52 lines
894 B
Plaintext
Vendored
object FiveTimes {
|
|
private constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
class IntCell {
|
|
constructor(value: Int) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
var value: Int
|
|
field = value
|
|
get
|
|
set
|
|
|
|
}
|
|
|
|
interface IReceiver {
|
|
operator fun FiveTimes.iterator(): IntCell {
|
|
return IntCell(value = 5)
|
|
}
|
|
|
|
operator fun IntCell.hasNext(): Boolean {
|
|
return greater(arg0 = <this>.<get-value>(), arg1 = 0)
|
|
}
|
|
|
|
operator fun IntCell.next(): Int {
|
|
return { // BLOCK
|
|
val <unary>: Int = <this>.<get-value>()
|
|
<this>.<set-value>(<set-?> = <unary>.dec())
|
|
<unary>
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
fun IReceiver.test() {
|
|
{ // BLOCK
|
|
val <iterator>: IntCell = (<this>, FiveTimes).iterator()
|
|
while ((<this>, <iterator>).hasNext()) { // BLOCK
|
|
val i: Int = (<this>, <iterator>).next()
|
|
println(message = i)
|
|
}
|
|
}
|
|
}
|