elect
09/06/2017, 5:34 PMelizarov
09/06/2017, 8:49 PMelizarov
09/06/2017, 8:50 PMelect
09/07/2017, 6:57 AMEnumSet
usageelect
09/07/2017, 6:57 AMelect
09/07/2017, 6:59 AMelect
09/07/2017, 6:59 AMEnumSet
just couldn't keep up, https://github.com/kotlin-graphics/imgui/blob/9b86cb1f31ae92d5bdf5fb227ffe723d2a6faade/src/main/kotlin/imgui/imgui/widgetsColorEditorPicker.kt#L98-L111elect
09/07/2017, 7:00 AMelect
09/07/2017, 7:17 AM! & | ^ ~ << >>
on primitives, or at least on `Int`s, will cause more harm than benefits.
Look at all the major languages out there: c, c++, java, go, rust, switft, javascript, php, etc... All of them have them.
There are some kotlin killing features that are being studied and implemented like the nullability handling. Not having bitwise operator not. There'd be a reason I say... 🙂elizarov
09/07/2017, 8:26 AMelizarov
09/07/2017, 8:27 AMinfix fun Int.or(other: Cond) = this or other.i
infix fun Int.has(b: Cond) = (this and b.i) != 0
infix fun Int.hasnt(b: Cond) = (this and b.i) == 0
infix fun Int.wo(b: Cond) = this and b.i.inv()
elizarov
09/07/2017, 8:28 AMelizarov
09/07/2017, 8:29 AMinfix fun Int.has(b: Int) = (this and b) != 0
infix fun Int.hasNot(b: Int) = (this and b) == 0
infix fun Int.wo(b: Int) = this and b.inv()
elect
09/07/2017, 10:21 AMEnumSet
option, after spending a whole day, it didnt work, I had to revert everything backelect
09/07/2017, 10:21 AMelect
09/07/2017, 10:22 AMhas
and hasnt
have been prooved to be more redable, even more because they play nice with operator priority, ie: } else if (flags has Cef.HEX && flags hasnt Cef.NoInputs) {
elect
09/07/2017, 10:23 AM!has
would be perfect (but this is another issue.. 🙂 )elect
09/07/2017, 10:25 AMgroostav
09/08/2017, 8:13 PMthis is another issuethis is literally true: https://youtrack.jetbrains.com/issue/KT-5351
elect
09/08/2017, 8:14 PM