# 031: Anonymous Functions
# Functions without names (lambdas)

# Store in variable
double = (x) => x * 2

show double(5)  # 10

# Pass as argument
apply_twice(f, x):
  f(f(x))

result = apply_twice((n) => n + 1, 10)
show result  # 12

# Multiple parameters
add = (a, b) => a + b
show add(3, 4)  # 7

# Multi-line anonymous function
greet = (name) => {
  message = "Hello, {name}!"
  message.uppercase()
}

show greet("alex")  # HELLO, ALEX!
