Wait, is it possible to get the keys of a map from...
# announcements
p
Wait, is it possible to get the keys of a map from a closure inside of the same map? I guess not? I basically have something like this:
Copy code
val commands = mapOf<Command, (WebSocket, List<String>) -> Unit>(
            Command("ping", "A ping command") to { socket, _ ->
                sendMessage(socket, "Pong!")
            },
            Command("help", "What you're reading") to { socket, subcommand ->
                // Get the keys of this map here
            }
    )