This file is generated for E2E parsing.
Document ID: 3f0hgeqd6zz-mj8z1kab
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.
Uses Scala collections to filter and map a list with a clear pipeline.
object Main {
def main(args: Array[String]): Unit = {
val nums = List(1,2,3,4,5)
val oddsSquared = nums.filter(_ % 2 == 1).map(n => n*n)
println(oddsSquared)
}
}Filters and projects a sequence using C# LINQ. Demonstrates expressive collection manipulation.
using System;
using System.Linq;
class Program {
static void Main(){
var nums = new[]{1,2,3,4,5};
var squares = nums.Where(n=>n%2==1).Select(n=>n*n);
Console.WriteLine(string.Join(",", squares));
}
}