Kotlin
Kotlin label.
@
. : abc@
, fooBar@
(. ). , ,
loop@ for (i in 1..100) {
// ...
}
break continue :
loop@ for (i in 1..100) {
for (j in 1..100) {
if (...)
break@loop
}
}
break, @loop
, , loop@
.
continue .
Kotlin , (.:local functions) function literals. return . -. , :
fun foo() {
ints.forEach {
if (it == 0) return
print(it)
}
}
return , foo
.
( , -, -.) -, return:
fun foo() {
ints.forEach lit@ {
if (it == 0) return@lit
print(it)
}
}
-. : , , .
fun foo() {
ints.forEach {
if (it == 0) return@forEach
print(it)
}
}
fun foo() {
ints.forEach(fun(value: Int) {
if (value == 0) return
print(value)
})
}
,
return@a 1
" 1
@a
, " (@a 1)
".
10.11.2021 - 12:37: - Personalias -> WHO IS WHO - - _. 10.11.2021 - 12:36: - Conscience -> . ? - _. 10.11.2021 - 12:36: , , - Upbringing, Inlightening, Education -> ... - _. 10.11.2021 - 12:35: - Ecology -> - _. 10.11.2021 - 12:34: , - War, Politics and Science -> - _. 10.11.2021 - 12:34: , - War, Politics and Science -> . - _. 10.11.2021 - 12:34: , , - Upbringing, Inlightening, Education -> , - _. 10.11.2021 - 09:18: - New Technologies -> , 5G- - _. 10.11.2021 - 09:18: - Ecology -> - _. 10.11.2021 - 09:16: - Ecology -> - _. 10.11.2021 - 09:15: , , - Upbringing, Inlightening, Education -> - _. 10.11.2021 - 09:13: , , - Upbringing, Inlightening, Education -> - _. |