https://kotlinlang.org logo
Title
h

Hullaballoonatic

09/11/2018, 11:46 PM
sure would be nice to have
^
as a power operator
s

Sam

09/12/2018, 2:27 AM
keep in mind, ^ is xor in C and having that as power could be misleading
e

elizarov

09/12/2018, 6:04 AM
For C-family of languages,
**
as a power looks better.
👍 2
h

Hullaballoonatic

09/13/2018, 7:42 PM
fair enough, so why wouldn't kotlin include **?
i know i can make an infix ``**`` but i dun wanna ;_;
h

Hullaballoonatic

09/13/2018, 8:41 PM
they might as well get on introducing
^
for "or" functions too. I know they currently have
and
,
or
,
xor
etc boolean operators, but it seems like a waste to not make use of these free characters :S
like it's strange they don't use
&
and
^
for boolean
and
and
or
when they already use
!
for boolean
not
or they could also use
&&
and
||
for bitwise operators too 🤷‍♂️
h

Hullaballoonatic

09/13/2018, 10:14 PM
7 years old 😮
but hey kt-1440
"The main reason why the features you implemented are not in the language yet is that there are many questions about possible better uses of the syntactic elements they employ. There are very few special characters on our keyboards, so we have to be very cautious here. My personal hunch is that | and & have a decent chance of becoming overloadable operators in Kotlin at some point, but it’s less likely for ^, <<, >>, >>>. In any case, to make such decisions we have to finalize a few other bigger features with high syntactic uncertainty: collection literals, some DSL-related features, etc."
s

Sam

09/13/2018, 10:27 PM
h

Hullaballoonatic

09/13/2018, 10:28 PM
thanks for sharing
reading through the proposed features, i could not want collection literals and collection comprensions harder
oh fuck, and inline classes for units of measurement, though i do really enjoy https://git.tenkiv.org/software/Physikal
i also really support "no comma after any element of a list if it's followed by a new line"
that would be great for constructors
although a lot of these features feel like.... why is this even a question? (e.g. unsigned types, SAM conversions)
nvm, though, 1.3 is bringing quite a few of them, including inline classes, and unsigned ints 😄