This file is generated for E2E parsing.
Document ID: gzxcxou4uk9-mtf8adu2
This document contains a variety of concise, self-contained code examples across multiple programming languages, demonstrating common patterns, data structures, I/O, and control flow to exercise parsing in a realistic yet compact way.
Each example includes a short description followed by a fenced code block.
Where helpful, examples may include brief variations in syntax or structure so the parser encounters a wider range of constructs across different ecosystems.
This example shows a strongly-typed user interface and a function that formats user info. It highlights TypeScript's type safety.
interface User { id: number; name: string; active: boolean }
function formatUser(u: User): string { return `${u.id}:${u.name}:${u.active}` }
console.log(formatUser({ id: 1, name: 'Ada', active: true }));Demonstrates Kotlin data classes and the copy method. Encourages immutable-style updates.
data class User(val id:Int, val name:String, val active:Boolean)
fun main(){
val u1 = User(1, "Ada", true)
val u2 = u1.copy(active = false)
println(u2)
}