// Created on savesnippets.com · https://savesnippets.com/6InBbTJ1ugoDjm fun main() { // Pair construction val pair: Pair = "age" to 30 println(pair.first) // age println(pair.second) // 30 // Destructure with componentN val (key, value) = pair println("$key = $value") // The whole point: map literals val config: Map = mapOf( "host" to "localhost", "port" to 8080, "debug" to true, ) // Triple — for three-valued returns where you don't want a data class fun divmod(a: Int, b: Int): Triple = Triple(a / b, a % b, b != 0) val (q, r, ok) = divmod(17, 5) println("$q remainder $r (ok=$ok)") // ⚠️ For >3 values or anything meaningful, use a data class — Pair/Triple // have generic field names (.first/.second/.third) that don't document intent. }