I got to use a `when` as the condition of an `if`,...
# advent-of-code
k
I got to use a
when
as the condition of an
if
, and finally found a use for anonymous local objects.
👍 1
a
That is very neat 🙂 Love the way that you have built the Regex
m
a readable regex?! that’s witchcraft
k
Thanks! It's a habit I've picked up from when I was learning how to write a (simple) programming language, and I decided to write the parser with regexes 😕.
a
This is also a cunning line:
Copy code
operator fun <T> List<T>.component6() = get(5)
k
I was too close to not use destructured declaration.
a
I know but I hadn't even thought of extending it like that
I love this channel, I have learnt more Kotlin here in the last week than ever
👍 1
k
Same I've learned about
buildSequence
and a bunch of other tricks.
a
I am going to have to refactor today's solution to include some of your syntactical sugar just so I don't forget it. Sure it will come in useful on a later problem
k
Ah that reminds me to check the other solutions, I muted this channel for a bit while I couldn't work on this.