vngantk
05/27/2020, 2:05 PMlouiscad
05/27/2020, 3:48 PMCody Engel
05/27/2020, 4:10 PMvngantk
05/29/2020, 3:39 PMelect
05/29/2020, 3:41 PMCody Engel
05/29/2020, 3:54 PMelect
05/29/2020, 4:02 PMelect
05/29/2020, 4:07 PMelect
05/29/2020, 4:08 PMelect
05/29/2020, 4:15 PMloop{}
Cody Engel
05/29/2020, 4:57 PMloop
do? Also bitwise operators are supported however I can see that the syntactical differences could be confusing, I feel like that's a similar thing to tertiary operators though.elect
05/29/2020, 5:03 PMwhile (true) { }
, bitwise operators are not supportedelect
05/29/2020, 5:06 PM2+3
instead writing 2.plus(3)
Cody Engel
05/29/2020, 5:08 PMloop
could be created within a project fairly quickly. I don't know that it's something that needs to be backed into the language.elect
05/29/2020, 5:10 PMgildor
05/29/2020, 5:32 PMCody Engel
05/29/2020, 5:37 PMloop
gildor
05/29/2020, 5:38 PMgildor
05/29/2020, 5:40 PMCody Engel
05/29/2020, 5:42 PMelect
05/29/2020, 6:23 PMCody Engel
05/29/2020, 6:29 PMelect
05/29/2020, 6:41 PMdef matcher(an Object){
match(an){
person Person(yearOfBirth < 1970, favs(number == 12)) => "Person, born: {person.yearOfBirth}. Favourite word: {person.favs.word}"
x => "unknown input"
}
}
elect
05/29/2020, 6:43 PMdef matcher(n int){
match(n){
>5 and <10 => "greater than 5 but less than 10"
<10 => "less than 10"
else => "more than or equal to 10"
}
}
Cody Engel
05/29/2020, 7:28 PMfun matcher(n: Int) {
when (n) {
in 6..9 -> "greater than 5 but less than 10"
in Int.MIN_VALUE..9 -> "less than 10"
else -> "more than or equal to 10"
}
}
elect
05/29/2020, 7:28 PM<10
is way more intuitiveelect
05/29/2020, 7:29 PMn < 10
in kotlingildor
05/30/2020, 9:47 AMlouiscad
05/30/2020, 10:19 AMgildor
05/31/2020, 5:49 AMelect
05/31/2020, 3:23 PMwhen {
n > 5 && n < 10 => "greater than 5 but less than 10"
n < 10 => "less than 10"
else => "more than or equal to 10"
}
however, the case scenarios more significant are clearly those with some more verbose naming than a simple n
gildor
05/31/2020, 11:00 PM