also can you think of a more succinct way to refer...
# announcements
h
also can you think of a more succinct way to reference the class of a property than
foo::class
, and
KClass<Bar>
?
k
My
operator fun get(x: Int, y: Int)
would like to have a word with you!
h
huuuuuuh, is that like a table get operator?
k
Yeah, usable as
table[2, 3]
I don't really get what you mean with those last two questions, care to elaborate?
h
well, especially when you're doing sorting algorithms, there's a lot of using an element's index alongside the element itself. it'd be nice to have a clear nomenclature convention for distinguishing them, instead of
val t: T
and
val tIndex: Int
and the last question is probably unimportant since i haven't used
foo::class
notation since i first started coding in kotlin
k
That's a good convention though.
value
and
i
work well too simple smile
h
yeah, it's just that what if you need a and b?
i'd like to have something like lowercase are indices, and uppercase are elements
k
🤨
h
akin to that, not that specifically, just a way the names are written that indicates what they are versus the name itself
or perhaps allowing subscores for naming indices, i.e.
a_i
,
a_2
, etc
k
Hmm are you talking about variables containing indices or an alternative syntax for
[]
?
h
e.g.
Copy code
for (i in 0..arr.size) {
   val a_i = i
   val b_i = arr.size - i
   val a = arr[a_i]
   val b = arr[b_i]
   // do things
}