benleggiero
08/17/2017, 11:39 PM+?
to append a new element to the end of an array only if that new element is not null.karelpeeters
08/17/2017, 11:39 PMbenleggiero
08/17/2017, 11:42 PMinfix fun
. I don't think "alphanumeric" is less messy than "mathematical".benleggiero
08/17/2017, 11:44 PMlsh
is the least-intuitive way to shift the bits in an integer to the left. <<
and shiftBitsLeft
are both better, but lsh
sits at the crossroads of "what does that mean?" and "what was that operator again?"trevjones
08/17/2017, 11:44 PMtrevjones
08/17/2017, 11:45 PMkarelpeeters
08/17/2017, 11:45 PMshl
vs <<
thing, but only because they're already established operators.karelpeeters
08/17/2017, 11:46 PMtrevjones
08/17/2017, 11:46 PMlsh
or shl
? πjw
08/17/2017, 11:46 PMbenleggiero
08/17/2017, 11:46 PM#define
πkarelpeeters
08/17/2017, 11:47 PMshl
.benleggiero
08/17/2017, 11:47 PMinfix fun shiftBitsLeft
πjw
08/17/2017, 11:48 PMkarelpeeters
08/17/2017, 11:48 PMjw
08/17/2017, 11:49 PMbenleggiero
08/17/2017, 11:49 PMjw
08/17/2017, 11:49 PMinline fun Int.isBitSet(bit: Int) = ...
or whatever you want)benleggiero
08/17/2017, 11:59 PMraulraja
08/18/2017, 12:02 AM>>=
for aliases to flatMap
and others which are common in most FP langs used by the community.codeslubber
08/18/2017, 2:50 AMelect
08/18/2017, 7:42 AMbenleggiero
08/18/2017, 12:16 PMtschuchort
08/18/2017, 4:06 PMtschuchort
08/18/2017, 4:08 PMkarelpeeters
08/18/2017, 4:11 PMbenleggiero
08/18/2017, 4:13 PMkarelpeeters
08/18/2017, 4:14 PMctrl+b
βΊοΈkarelpeeters
08/18/2017, 4:14 PMpixelbumper
08/18/2017, 4:33 PMelect
08/18/2017, 4:35 PMpixelbumper
08/18/2017, 4:36 PMbenleggiero
08/18/2017, 4:37 PMshiftingBitsRightInsertingZeroes
, exclusiveOr
, concatenateUnlessNull
to >>>
, ^
, and +?
gildor
08/18/2017, 4:43 PMxor
as name for exclusive or is probably even more common than ^
pixelbumper
08/18/2017, 4:58 PMshrInsertingZeroes
would be more consistent with the current set of instructions).
But as @jw already suggested it could encourage developers to write less convolutedly long one liners and split it into functions/more lines.
At the end of the day we could probably live with either approaches thoughelect
08/18/2017, 5:04 PM&
on primitives. There is a reason why most of major languages out there today have that.. cmon
Anyway, as I said, I'm convinced it's not a matter of if
, but when
Kbenleggiero
08/18/2017, 5:05 PMβ
, especially for people coming from more pure math. Why not define all three and inline
them to the same bytecode so everyone can use Kotlin in a way they find comfortable and intuitive?
@pixelbumper Like I said above, allowing people to define their own inline
custom operators as aliases to ones they find more confusing is a key to making people really comfortable using a new language, without bloating the compiled code.gildor
08/18/2017, 5:08 PMbenleggiero
08/18/2017, 5:10 PMgildor
08/18/2017, 5:10 PMbenleggiero
08/18/2017, 5:12 PMgildor
08/18/2017, 5:13 PMpixelbumper
08/18/2017, 5:14 PMelect
08/18/2017, 5:14 PMgildor
08/18/2017, 5:15 PMgildor
08/18/2017, 5:17 PMbenleggiero
08/19/2017, 11:06 PMinline fun Int.`<<`(bitCount: Int)
but it wouldn't compile claiming Name contains illegal characters: <
jimn
08/21/2017, 6:06 AMjimn
08/21/2017, 6:07 AMjimn
08/21/2017, 6:09 AMjimn
08/21/2017, 6:14 AMjimn
08/21/2017, 6:17 AMcodeslubber
08/21/2017, 2:36 PMbenleggiero
08/21/2017, 2:41 PMraulraja
08/21/2017, 2:45 PMraulraja
08/21/2017, 2:52 PM@alias(">>=")
fun flatMap ...
I'd even settle for a compromise if to define one you had to provide an alternative representation if the real concern is readability or usage semantics.karelpeeters
08/21/2017, 2:58 PMcodeslubber
08/21/2017, 3:14 PMbenleggiero
08/21/2017, 3:33 PMraulraja
08/21/2017, 4:44 PMident
` which does not seem to me like a real way to have your custom operators / identifiers.jimn
08/22/2017, 2:15 AM