// LANG-COMP-010-03: Closure Returns
// Demonstrates closures with explicit return values

fn main() {
    // Closure with implicit return
    let square = |x| { x * x }
    println(square(5))

    // Closure with multiple expressions
    let process = |n| {
        let doubled = n * 2
        let added = doubled + 10
        added
    }
    println(process(15))

    // Function returning closure with capture
    fn make_multiplier(factor) {
        |x| { x * factor }
    }

    let times_three = make_multiplier(3)
    println(times_three(7))
}
